Interaction keeps failing..

Tried to implement rock paper scissor, (custom events and commands handler)
24 Replies
d.js toolkit
d.js toolkit4mo ago
- 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 staff
san*~
san*~OP4mo ago
san*~
san*~OP4mo ago
this is my code!
d.js docs
d.js docs4mo ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
horohousu
horohousu4mo ago
what does "random confusing replies" mean?
san*~
san*~OP4mo ago
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
horohousu
horohousu4mo ago
can you take an image of it
san*~
san*~OP4mo ago
No description
san*~
san*~OP4mo ago
I also sent my code above
san*~
san*~OP4mo ago
No description
treble/luna
treble/luna4mo ago
Start by putting your code in a pastebin. Not a file
san*~
san*~OP4mo ago
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.
san*~
san*~OP4mo ago
Here
horohousu
horohousu4mo ago
would still need to know when exactly it fails to pinpoint the issues
san*~
san*~OP4mo ago
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
treble/luna
treble/luna4mo ago
Looks like you're editing the message That doesnt acknowledge the interaction Seems like you want to use interaction.update
san*~
san*~OP4mo ago
oh so wherever I am using reply.edit, should i use interaction.update instead? And the awaitmessagecomponent also remains the same?
treble/luna
treble/luna4mo ago
assuming you are using buttons or select menus and you want to update the message those are attached to, yes
san*~
san*~OP4mo ago
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.
san*~
san*~OP4mo ago
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''''
horohousu
horohousu4mo ago
the error seems pretty self-explanatory also interaction.update should be a function
treble/luna
treble/luna4mo ago
You should call that on the collected interactions also line 97 has a typo
san*~
san*~OP4mo ago
it finally worked!!! thank you so much guys! and sorry if I came across as rude or impatient!<3
treble/luna
treble/luna4mo ago
no worries
Want results from more Discord servers?
Add your server