Button not firing interactionCreate event

I'm making a simple event signup bot tailored to my server. When registering for an event, you have to choose a character either from a list of existing characters or create a new one. When choosing the option to create a new character I never get a interactionCreate event to either the client's event listener or to awaitMessageComponent either. It's entirely possible I'm being really dumb here (have been working for several hours today and honestly should probably take a break), but I really can't figure it out. Screenshots of both the code and some relevant bot messages below. I'm getting zero console messages too. Tried putting one inside the filter option on awaitMessageComponent as well and nada. [email protected] node v20.11.0
No description
No description
4 Replies
d.js toolkit
d.js toolkit4w 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
Mundane
MundaneOP4w ago
Code from screenshot:
const characters = await prisma.character.findMany({ where: { memberId } });
let components: BaseMessageOptions['components'] = [
new ActionRowBuilder<ButtonBuilder>()
.addComponents(
new ButtonBuilder()
.setCustomId('pjnnjsdfg-new-char')
.setLabel('New Character')
.setStyle(ButtonStyle.Primary)
)
];
if (characters.length > 0) {
components.unshift(new ActionRowBuilder<StringSelectMenuBuilder>()
.addComponents(
new StringSelectMenuBuilder()
.setCustomId('char')
.addOptions(characters.map((char) => new StringSelectMenuOptionBuilder()
.setLabel(char.name)
.setValue(char.id)
.setDescription(`Level ${ char.level } ${ char.archetype }`)
)
)
)
);
}
const response = await interaction.reply({
content: 'Choose a character to signup with:',
components,
ephemeral: true,
});
const answer = await response.awaitMessageComponent();
console.log('we here now'); // nope
if (answer === null) {
return;
}
const characters = await prisma.character.findMany({ where: { memberId } });
let components: BaseMessageOptions['components'] = [
new ActionRowBuilder<ButtonBuilder>()
.addComponents(
new ButtonBuilder()
.setCustomId('pjnnjsdfg-new-char')
.setLabel('New Character')
.setStyle(ButtonStyle.Primary)
)
];
if (characters.length > 0) {
components.unshift(new ActionRowBuilder<StringSelectMenuBuilder>()
.addComponents(
new StringSelectMenuBuilder()
.setCustomId('char')
.addOptions(characters.map((char) => new StringSelectMenuOptionBuilder()
.setLabel(char.name)
.setValue(char.id)
.setDescription(`Level ${ char.level } ${ char.archetype }`)
)
)
)
);
}
const response = await interaction.reply({
content: 'Choose a character to signup with:',
components,
ephemeral: true,
});
const answer = await response.awaitMessageComponent();
console.log('we here now'); // nope
if (answer === null) {
return;
}
Amgelo
Amgelo4w ago
try adding fetchReply: true to your reply
Mundane
MundaneOP4w ago
doesn't seem to change anything actually I take it all back, I just had removed my log :facepalm: thanks!
Want results from more Discord servers?
Add your server