Interaction failed; Unable to use buttons

if (command === "button") {

const clickme = new ButtonBuilder()
.setCustomId('clickme')
.setLabel('Click Me!')
.setStyle(ButtonStyle.Primary);

const instead = new ButtonBuilder()
.setCustomId('instead')
.setLabel('Click Me Instead!')
.setStyle(ButtonStyle.Secondary);

const row = new ActionRowBuilder()
.addComponents(clickme, instead);

interaction.reply({
content: 'Hello there.......',
components: [row],
});
if (command === "button") {

const clickme = new ButtonBuilder()
.setCustomId('clickme')
.setLabel('Click Me!')
.setStyle(ButtonStyle.Primary);

const instead = new ButtonBuilder()
.setCustomId('instead')
.setLabel('Click Me Instead!')
.setStyle(ButtonStyle.Secondary);

const row = new ActionRowBuilder()
.addComponents(clickme, instead);

interaction.reply({
content: 'Hello there.......',
components: [row],
});
what's the issue?
6 Replies
d.js toolkit
d.js toolkit2y ago
• 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.
lupus
lupus2y ago
@sebastian. Can you verify that you're using the interactionCreate event or show the whole handler for that? Oh, wait, is command the commandname string? If it's the interaction variable, use command.commandName See also:
d.js docs
d.js docs2y ago
class ChatInputCommandInteraction (extends CommandInteraction) Represents a command interaction.
sebastian.
sebastian.OP2y ago
sebastian.
sebastian.OP2y ago
this is it FIXED IT truly sorry for bothering
lupus
lupus2y ago
Alright No worries Conflicting type guards :D
Want results from more Discord servers?
Add your server