RoleSelectMenuInteraction Component Collector not working

const firstActionRowButton = new ActionRowBuilder<RoleSelectMenuBuilder>().addComponents(roleSelect);
const response = await buttonInteraction.reply({ content: 'Select a staff role. Individuals with staff will have printing, unprinting and other control over the currency.', components: [firstActionRowButton], ephemeral : true });

let roleInteraction: RoleSelectMenuInteraction ;
try {
roleInteraction = await response.awaitMessageComponent({ time: 60_000 }) as RoleSelectMenuInteraction;
console.log('HERE');
}
catch (error) {
await buttonInteraction.editReply({ content :'Timed out.', components: [] });
return;
}
const firstActionRowButton = new ActionRowBuilder<RoleSelectMenuBuilder>().addComponents(roleSelect);
const response = await buttonInteraction.reply({ content: 'Select a staff role. Individuals with staff will have printing, unprinting and other control over the currency.', components: [firstActionRowButton], ephemeral : true });

let roleInteraction: RoleSelectMenuInteraction ;
try {
roleInteraction = await response.awaitMessageComponent({ time: 60_000 }) as RoleSelectMenuInteraction;
console.log('HERE');
}
catch (error) {
await buttonInteraction.editReply({ content :'Timed out.', components: [] });
return;
}
4 Replies
d.js toolkit
d.js toolkit12mo 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
War
WarOP12mo ago
It doesn't detect it even when I'm selecting a role
treble/luna
treble/luna12mo ago
add fetchReply: true when replying and you can jusr chain .catch to your call, no need for a try catch
War
WarOP12mo ago
Thanks, worked. Gotcha, will do,
Want results from more Discord servers?
Add your server