I have a select menu where once a menu item is selected, it should send an embed with some info but it doesn't, only "This interaction failed" is displayed. There is no error in the console.
Here is my code:
if (!args[0]) {
const home = new EmbedBuilder()
.setAuthor({
name: `Welcome to the help panel.`,
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 512 }),
})
.setColor(COLORS)
.setDescription(
`You can start streaming music straight away without any setup, just run the \`${PREFIX}play\` command, give it something to search for and you're good to go! \n\nUnlock exclusive benefits by purchasing a premium membership: **[Buy Premium](https://www.patreon.com/join/EliMusic)** \n\n**All Link:** [WebSite](https://elimusic.top/) | [Vote](https://top.gg/bot/944606401219690516/vote) | [Support](https://discord.gg/Q4RWKU2UqB)`,
)
.setFooter({
text: `© MihaiT`,
iconURL: message.author.displayAvatarURL(),
});
const info = new EmbedBuilder()
.setColor(COLORS)
.setAuthor({
name: `Eli's Commands`,
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 512 }),
})
.addFields(
{
name: `<:Eli_Bot:972786663078105128> Info`,
value: `Detailed help for an order: \`${PREFIX}help [commands]\` \nFor more help, visit our [support server](https://discord.gg/Q4RWKU2UqB)`,
},
{
name: `<:Eli_ADD:972784975172751380> Comandos`,
value: `\`${PREFIX}about\`: Stats and bots details. \n\`${PREFIX}help\`: Help commands. \n\`${PREFIX}invite\`: You receive a link so you can invite me to any server you manage. \n\`${PREFIX}vote\`: Vote for Nakano on Top.gg \n\`${PREFIX}support\`: To join communities.`,
},
)
.setFooter({
text: `© MihaiT`,
iconURL: message.author.displayAvatarURL(),
});
const components = (state) => [
new ActionRowBuilder().addComponents(
new SelectMenuBuilder()
.setCustomId('help-menu')
.setPlaceholder('Please Select a Category')
.setDisabled(state)
.addOptions([
{
label: `Home`,
value: `home`,
description: `Go home`,
emoji: `<:EliOfficial:972798080393052191>`,
},
{
label: `Info`,
value: `info`,
description: `See info commands`,
emoji: `<:Eli_Bot:972786663078105128>`,
},
]),
),
];
message.reply({
embeds: [home],
allowedMentions: { repliedUser: false },
components: components(true),
});
const filter = (interaction) => interaction.user.id === message.author.id;
const collector = message.channel.createMessageComponentCollector({
filter,
componentType: 'SELECT_MENU',
max: 10,
});
collector.on('collect', (interaction) => {
if (interaction.values[0] === 'home') {
interaction.reply({ embeds: [home], ephemeral: true });
} else if (interaction.values[0] === 'info') {
interaction.reply({ embeds: [info], ephemeral: true });
}
});
}
If you look at the image below, you will see that it doesn't give me anything after I select an option. I use discord.js v14.