async function execute(interaction) {
const hello = new ButtonBuilder()
.setCustomId('hello')
.setLabel('Say Hello')
.setStyle(ButtonStyle.Primary);
const hi = new ButtonBuilder()
.setCustomId('hi')
.setLabel('Say Hi')
.setStyle(ButtonStyle.Primary);
const wassup = new ButtonBuilder()
.setCustomId('wassup')
.setLabel('Say wassup')
.setStyle(ButtonStyle.Primary);
const row = new ActionRowBuilder().addComponents(hello, hi, wassup);
const response = await interaction.reply({
content: 'Choose your messages',
components: [row],
});
const userChoice = await response.awaitMessageComponent();
switch (userChoice.customId) {
case "hello": return await userChoice.update("hello");
case "hi": return await userChoice.update("hi")
case "wassup": return await userChoice.update("wassup")
}
};
async function execute(interaction) {
const hello = new ButtonBuilder()
.setCustomId('hello')
.setLabel('Say Hello')
.setStyle(ButtonStyle.Primary);
const hi = new ButtonBuilder()
.setCustomId('hi')
.setLabel('Say Hi')
.setStyle(ButtonStyle.Primary);
const wassup = new ButtonBuilder()
.setCustomId('wassup')
.setLabel('Say wassup')
.setStyle(ButtonStyle.Primary);
const row = new ActionRowBuilder().addComponents(hello, hi, wassup);
const response = await interaction.reply({
content: 'Choose your messages',
components: [row],
});
const userChoice = await response.awaitMessageComponent();
switch (userChoice.customId) {
case "hello": return await userChoice.update("hello");
case "hi": return await userChoice.update("hi")
case "wassup": return await userChoice.update("wassup")
}
};