help with interaction
Hi! I'm new using discordjs, also learning to program. I have this piece of code where i wait for a StringSelect response from the user
cardSelect its a StringSelectMenuBuilder
this interaction works well, it pass the next if block
envSelectResponse its a StringSelectMenuBuilder
i dont know why when my code gets to the userResponseMsg and the user is supposed to interact with it (selecting the string option) i get a 'Failed interaction'
i dont know if the problem is the collector, or if im using wrong the awaitMessageComponent method or idk 💀
im sorry if its a stupid question
10 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!Are there any errors in your console?
array will never equal to string, use
round1RivalInteraction.values[0] == 'envido'
Hi, no i dont get any error in console
the code gets inside the if block, if i put a console.log before the userResponseEnv the console.log runs, but it doesnt run after the userResponseEnv, its like it get stucked in that line
Yeah, what kin said then, I missed that part as well
show ur latest code
Actually since they're not using the strict equality operator,
["value"]
will be equal to "value"
This is the piece of code I'm having trouble with kin
When do you actually get the 'Failed interaction' msg?
When you send:
-
${rival} elige tu jugada:
- or ${user} aceptas el ${round1RivalInteraction.values}
?${user} aceptas el ${round1RivalInteraction.values}
Here is where i get the 'Failed interaction'
I made it work, I just edited the round1response
message
I added this before the if block
now I have a question, its necessary to edit the msg after getting a response from the user with the string select menu?
thanks!!!