Collector not replying on pressing on choices of a select menu

SourceBin
Help.js
Discord.js Slash Command With Collectors
26 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 OP
treble/luna
treble/luna4mo ago
add fetchReply:true when replying add fetchReply:true when replying
Anurag Bansal
Anurag Bansal4mo ago
It still says "This Interaction Failed"
treble/luna
treble/luna4mo ago
Check if your collector fires at all
Anurag Bansal
Anurag Bansal4mo ago
Using console.log? Let me
Anurag Bansal
Anurag Bansal4mo ago
I added a console.log in collector outside if statement and everytime I click on a select menu choice, collector does fire
No description
treble/luna
treble/luna4mo ago
Then debug your if statements The first 2 checks will always be truthy so those can be removed
Anurag Bansal
Anurag Bansal4mo ago
I don't see any problem with if statements and they even work fine when I use the same code in interactionCreate But not inside the collector I also tried getting rid of if (!interaction.isStringSelectMenu()) return;
treble/luna
treble/luna4mo ago
Not that one, the interaction && interaction.values both will always be truthy That should error too ok no thats your entire issue Your original interaction doesnt have any values as its a ChatInputCommandinteraction The only checking you do with the interaction you collected is the user id You're not doing anything with the interaction you collected
Anurag Bansal
Anurag Bansal4mo ago
It's still not working
const selectMenuCollector = menu.createMessageComponentCollector({
filter: (i) => i.customId === "selecthelp",
componentType: ComponentType.StringSelect,
time: 60000,
});
const selectMenuCollector = menu.createMessageComponentCollector({
filter: (i) => i.customId === "selecthelp",
componentType: ComponentType.StringSelect,
time: 60000,
});
But I am getting Collector is On message in terminal which means it is a problem with interaction.values[]
treble/luna
treble/luna4mo ago
yes because there are no values on a ChatInputCommandInteraction, as i said before
Anurag Bansal
Anurag Bansal4mo ago
I don't understand that, what do you mean?
treble/luna
treble/luna4mo ago
.
Anurag Bansal
Anurag Bansal4mo ago
There is an interaction.reply in every if statement
treble/luna
treble/luna4mo ago
and how did you name the interaction you collected
Anurag Bansal
Anurag Bansal4mo ago
.setValue()?
treble/luna
treble/luna4mo ago
no In your collector you named your interaction i didnt you?
Anurag Bansal
Anurag Bansal4mo ago
Yes What is the thing that I am missing
treble/luna
treble/luna4mo ago
then why dont use use it anywhere in your code?
Anurag Bansal
Anurag Bansal4mo ago
What interaction are you taking about? 😭
treble/luna
treble/luna4mo ago
The one you collected The one you named i
Anurag Bansal
Anurag Bansal4mo ago
Ohhh yes!!! Where do I use it?
treble/luna
treble/luna4mo ago
Where you used interaction
Anurag Bansal
Anurag Bansal4mo ago
Is there an example available?
treble/luna
treble/luna4mo ago
No This is pretty basic at this point You named your collected interaction i Yet still use the interaction from the slash command
Anurag Bansal
Anurag Bansal4mo ago
Done 👍🏼 /thank wolvinny