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 toolkit•3y 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
lupus•3y 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 docs•3y ago
class ChatInputCommandInteraction (extends CommandInteraction) Represents a command interaction.
sebastian
sebastianOP•3y ago
sebastian
sebastianOP•3y ago
this is it FIXED IT truly sorry for bothering
lupus
lupus•3y ago
Alright No worries Conflicting type guards :D

Did you find this page helpful?