Mundane
Mundane
DIAdiscord.js - Imagine an app
Created by Mundane on 11/29/2024 in #djs-questions
Button not firing interactionCreate event
thanks!
7 replies
DIAdiscord.js - Imagine an app
Created by Mundane on 11/29/2024 in #djs-questions
Button not firing interactionCreate event
actually I take it all back, I just had removed my log :facepalm:
7 replies
DIAdiscord.js - Imagine an app
Created by Mundane on 11/29/2024 in #djs-questions
Button not firing interactionCreate event
doesn't seem to change anything
7 replies
DIAdiscord.js - Imagine an app
Created by Mundane on 11/29/2024 in #djs-questions
Button not firing interactionCreate event
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;
}
7 replies