How to avoid interaction listener mixing commands
Im coding a command which update a user from a database, it returns an embed message with user's information and it have a row with buttons to select properties to change. The problem is that when i make another instance of the command every embed used previously also change with the new responses.
11 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Don't create listeners in commands. Use collectors.
If you are waiting for button or select menu input from a specific message, don't create the collector on the channel.
• Channel collectors return component interactions for any component within that channel.
So should I change my client.on(interactionCreate.....
for a collector?
Yes
Ok i will try it
I dont find out how should I make the change to collector, changed the listener for the collector with same code inside but now i receive interaction failed when clicking buttons, any idea ? @syjalo
i changed to this
returned interaction failed when clicked button
I suppose your
message
is the command message from user that doesn't have the buttons. You need to use mensaje
that worked, thanks so much sir
i was over 2 hours trying to find out whats was going wrong