M1hnea
M1hnea
DIAdiscord.js - Imagine an app
Created by M1hnea on 9/10/2023 in #djs-questions
I got a question
5 replies
DIAdiscord.js - Imagine an app
Created by M1hnea on 9/9/2023 in #djs-questions
why I got interaction failed on start and cancel button
8 replies
DIAdiscord.js - Imagine an app
Created by M1hnea on 9/7/2023 in #djs-questions
Can someone fix this? Buttons are not working for this embed
client.on('interactionCreate', async (interaction) => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'expedition') {
const embed = new EmbedBuilder()
.setColor('Random')
.setThumbnail('https://media.discordapp.net/attachments/965922634875416606/1146195590355619992/oi8uyoih.png?width=443&height=443')
.addFields({
name: 'Host',
value: 'host name',
inline: true,
}, {
name: 'Location',
value: 'location selected',
inline: true,
})

const join = new ButtonBuilder()
.setCustomId('join')
.setLabel('Join')
.setStyle(ButtonStyle.Success);

const start = new ButtonBuilder()
.setCustomId('start')
.setLabel('Start')
.setStyle(ButtonStyle.Secondary);

const end = new ButtonBuilder()
.setCustomId('end')
.setLabel('End')
.setStyle(ButtonStyle.Primary);

const row = new ActionRowBuilder()
.addComponents(join, start, end);

await interaction({
components: [row],
});

interaction.reply({ embeds: [embed] });
}
});
client.on('interactionCreate', async (interaction) => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === 'expedition') {
const embed = new EmbedBuilder()
.setColor('Random')
.setThumbnail('https://media.discordapp.net/attachments/965922634875416606/1146195590355619992/oi8uyoih.png?width=443&height=443')
.addFields({
name: 'Host',
value: 'host name',
inline: true,
}, {
name: 'Location',
value: 'location selected',
inline: true,
})

const join = new ButtonBuilder()
.setCustomId('join')
.setLabel('Join')
.setStyle(ButtonStyle.Success);

const start = new ButtonBuilder()
.setCustomId('start')
.setLabel('Start')
.setStyle(ButtonStyle.Secondary);

const end = new ButtonBuilder()
.setCustomId('end')
.setLabel('End')
.setStyle(ButtonStyle.Primary);

const row = new ActionRowBuilder()
.addComponents(join, start, end);

await interaction({
components: [row],
});

interaction.reply({ embeds: [embed] });
}
});
17 replies