BUTTON interact help meeee

hi I would like to make a command with buttons but I can't create the interactions there is always an error
11 Replies
d.js toolkit
d.js toolkit12mo 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 staff
./u.7-z
./u.7-zOP12mo ago
const { Client, ButtonBuilder, Interaction, ButtonInteraction, ActionRowBuilder, ButtonStyle, SlashCommandBuilder, EmbedBuilder, InteractionType } = require('discord.js');

module.exports = {
name: 'hello',
description: 'r',
async execute(message) {


const embed = new EmbedBuilder()
.setTitle('Plein de petit boutton')
.setDescription('Encore des petit boutton')
.setColor('#0099ff');



const bouttonA1 = new ButtonBuilder()
.setStyle(ButtonStyle.Primary)
.setLabel('1')
.setCustomId('int1')

const bouttonA2 = new ButtonBuilder()
.setStyle(ButtonStyle.Danger)
.setLabel('12')
.setCustomId('int2')





const bouttonS1 = new ActionRowBuilder()
.addComponents(bouttonA1, bouttonA2)


await message.reply({
content: `Are you sure you want to ban } for reason: $}?`,
components: [bouttonS1],
})


}
}
const { Client, ButtonBuilder, Interaction, ButtonInteraction, ActionRowBuilder, ButtonStyle, SlashCommandBuilder, EmbedBuilder, InteractionType } = require('discord.js');

module.exports = {
name: 'hello',
description: 'r',
async execute(message) {


const embed = new EmbedBuilder()
.setTitle('Plein de petit boutton')
.setDescription('Encore des petit boutton')
.setColor('#0099ff');



const bouttonA1 = new ButtonBuilder()
.setStyle(ButtonStyle.Primary)
.setLabel('1')
.setCustomId('int1')

const bouttonA2 = new ButtonBuilder()
.setStyle(ButtonStyle.Danger)
.setLabel('12')
.setCustomId('int2')





const bouttonS1 = new ActionRowBuilder()
.addComponents(bouttonA1, bouttonA2)


await message.reply({
content: `Are you sure you want to ban } for reason: $}?`,
components: [bouttonS1],
})


}
}
treble/luna
treble/luna12mo ago
and what is that error
./u.7-z
./u.7-zOP12mo ago
no error juste button no interact
d.js docs
d.js docs12mo ago
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops. - Once you do, log relevant values and if-conditions - More sophisticated debugging methods are breakpoints and runtime inspections: learn more
./u.7-z
./u.7-zOP12mo ago
??
treble/luna
treble/luna12mo ago
!! You should know how to debug
./u.7-z
./u.7-zOP12mo ago
is not bug
TheActualGamer1YT
@./u.7-z You did say there was errors happening
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
./u.7-z
./u.7-zOP11mo ago
No it's good someone helped me thank you
Want results from more Discord servers?
Add your server