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 toolkit12mo 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
lupus12mo 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 docs12mo ago
class ChatInputCommandInteraction (extends CommandInteraction) Represents a command interaction.
sebastian.
sebastian.12mo ago
sebastian.
sebastian.12mo ago
this is it FIXED IT truly sorry for bothering
lupus
lupus12mo ago
Alright No worries Conflicting type guards :D