slash command reply taking a minute or two to send message despite logging fine
(the code was too big for the message it's after this one)
context: I'm working on a mod of the api and for some reason when I run the command it won't reply or send messages but it'll log just fine then it'll wait for a few minutes and only then will it try to send a message. the only time I get an error is if I use reply but since it took so long it can't even get the reply so it says unknown interaction. I've asked a few of my other developer friends if they know why it's happening and none of the ideas they've given me have worked nor do they have any idea why it's happening.
14 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!this is the stuff for the command:
function code:
when I run the command it logs in my console but it doesn't reply
Have you tried
.deferReply()
to extend the reply time limit and see whether the reply will actually land?I've tried putting await ctx.deferReply() before the reply and it worked once then stopped working every time afterwards
"stopped working" as in there is no reply till the token expires? (15 min)
it did the same thing as it did without it where it'd say that it was getting the command for a few seconds then it would say that the application didn't respond
That's weird. That means the
.deferReply()
doesn't even run. Do you perhaps have another listener for the command that runs prior to that?there should only be one listener for it that I put in the constructor
I see
I just noticed, I think you miss
function
keyword at the beginning. You don't get error from that? Because it shouldn't be valid.it's inside of a class you don't need the function keyword for those
Oh I see. I thought it's an independent function
as far as I know despite how weird my methods of registering commands were (it was for simplicity because I didn't want the user to go through the hassle of getting the application id so I made it where they could just put in the token and it'd use cool api stuff to get the id for them and register it) I don't believe that it's because of problems with registering or anything
everyone I've talked to has said that it should work