Interaction keeps failing..
Tried to implement rock paper scissor, (custom events and commands handler)
24 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!
- ✅
Marked as resolved by staffthis is my code!
what does "random confusing replies" mean?
see I added a for loop for game to continue for given amount of rounds but it finishes in 1 round, plus there is an issue with the way I am handling interactions
Just needed guidance on if I am using the editReplies, interaction replies wrongly
''Message edited from to sany1989 won this round! :P
Current Score :
sany1989 : 1
<@1192361697290240070> : 0
Message edited from to''
It edits the message but then it also displays that interaction has failed at the same time
can you take an image of it
I also sent my code above
Start by putting your code in a pastebin. Not a file
Pastebin
discordjsrps - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Here
would still need to know when exactly it fails to pinpoint the issues
okay , i use the slash command , i add the user i want to play with, and the number of rounds.
I send the command in the channel, after that whenever me or that other person tries to click on one of the three buttons
the interaction loads for sometime then fails
Looks like you're editing the message
That doesnt acknowledge the interaction
Seems like you want to use interaction.update
oh so wherever I am using reply.edit, should i use interaction.update instead?
And the awaitmessagecomponent also remains the same?
assuming you are using buttons or select menus and you want to update the message those are attached to, yes
Pastebin
discordjsrps - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
it said interaction.update was not a function so i used interaction.editReply like you said
but then as soon as i ran my command i got this-
'''Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ChatInputCommandInteraction.reply (D:\NODEJS\discord-bot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:104:46)
at Object.run (D:\NODEJS\discord-bot\src\commands\Misc\rockpaperscis\rock-paper.js:59:39)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Client.<anonymous> (D:\NODEJS\discord-bot\node_modules\commandkit\dist\index.js:643:7) {
code: 'InteractionAlreadyReplied''''
the error seems pretty self-explanatory
also interaction.update should be a function
You should call that on the collected interactions
also line 97 has a typo
it finally worked!!! thank you so much guys! and sorry if I came across as rude or impatient!<3
no worries