Getting "Unknown interaction" error even with interaction.deferReply()
Hey folks, I am getting a strange error with this code:
The problem is that I am randomly getting this error, and I can't figure out why since I am deferring the reply:
I searched online for the problem but without much success.
3 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!That means that discord is receiving your
deferReply()
more than 3 seconds after the interaction was created
It may just be a network/hardware issue rather than something solvable in your codei understand, but the thing is, i really have nothing that could possibly take 3 seconds until I defer. just a few if statements, but those are never going to take 3 seconds, not even 3 milliseconds.
before the class method gets called i mean, there is nothing that would take so long
i actually can't remember. the error seemed super random and i can't seem to be able to reproduce it right now, yesterday it was happening semi-frequently.
I think this mostly occurs around startup times so maybe it's not that big of a deal. If it becomes a problem I will have to look into it again, but at the moment I don't want to spend hours on this.
seems to be similar to this but there is no resolution available: https://github.com/discordjs/discord.js/issues/7005
it might be taking more than 3 seconds, but only after the
deferReply
this problem is on a local high end machine, ryzen 9 7900 pc so it's not slow
that's my entire code
so all you have before the defer is these two if statements:
yeah i was thinking the same
between receiving the initial interaction request and then the discord servers receiving my bot response
>3 seconds
discord could be laggy once in a while, might be related to that, but either way, thanks for trying to help, don't think there is much i can do about this