I keep getting Unknown Interaction errors in my console.
I accidentally closed the last post.
I have lots of people using my bot each day and there seems to always be Unknown Interaction errors when people use commands. I haven't been able to recreate this issue myself and it doesn't even happen 100% of the time (sometimes that code runs fine, and other times it throws that error). I don't really see what the problem is in my code.
Refer to the image, the circled file is what this code is..
The line console is referring to is the:
12 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!could it be because im using await? should I do
return interaction.reply()
?Common causes of
DiscordAPIError[10062]: Unknown interaction
:
- Initial response took more than 3 seconds ➞ defer the response *.
- Wrong interaction object inside a collector.
- Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance)
* Note: you cannot defer modal or autocomplete value responsesah perfect
thank you
my bot gets rate limited by Discord regularly, do you think it's because of all of these unknown interaction errors? Bearing in mind, there's only about 1 per 10 to 30 seconds or so
I do think it's something else but just asking
Quick question, @Qjuh when i do deferReply am i able to change the bot is thinking text?
Nah Discord API rate limit
And by regularly, I mean like, at least 3 times per day
It's a massive pain in the ass
Chill out it's a thread
it ain't no plane
@Qjuh can you deferReply for a button interaction?
I have a feature that replaces (update) the image instead of sending it separately (reply).
This is the file that runs when that button is pressed:
It doesn't seem to be working for deferUpdate()
do you know what the problem could be?
Ah yeah sorry
It outputs unknown interaction in my console when pressed
and says 'Failed to respond' or whatever
line 9 is the deferUpdate() one
yeah
for additional context, this is my retrieveHandler function which you seen earlier:
don't worry about the 'this coud fail sometimes?' comment, it needs removing
ohhh
weird, it works perfectly fine now, could be a bug?
also here:
well it's on the InteractionCreate file
InteractionCreate.js
Im using gcommands aswell
yeah that makes sense actually
I don't really have a way around that
it is haha
I made a function to just retrieve the members but I dont think it's needed anymore.
Soon to be removed in a future update
it serves the exact same purpose of simply using collection.findOneAndUpdate()
anyway, thanks for your help with this
hey sorry, just another question @Qjuh
Will interaction.showModal() still work when the interaction is deferred?
for context, in my export it defers the reply, and then at the bottom (if checks are all successful) it'll show the modal
ahh
I had this error
dont mind the text
actually... i've not shown you the correct file.
I'm not really sure how this error has came about.
riight
okay
there's no way around this? sometimes my code might not complete before 3s
How can I complete the checks before showing the modal tho?
The checks would then come after the modal which is not what i was wanting
I mean this error doesn't happen all the time, but it's something i'd like to just fix anyway
pain, okay no worries
thank you