Answer the question
In order to leave comments, you need to log in
How to make a submenu in select menu?
How to make it so that when you click on an argument in the select menu, it is updated and another one appears, associated with 1 argument arguments?
client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;
if (interaction.commandName === 'ping') {
const row = new MessageActionRow()
.addComponents(
new MessageSelectMenu()
.setCustomId('select')
.setPlaceholder('Nothing selected')
.addOptions([
{
label: 'Своя игра',
value: 'svoya_igra',
},
{
label: 'Угадай мелодию',
value: 'yagadai_malodiu',
},
{
label: 'Osu',
value: 'osu',
},
]),
);
await interaction.reply({ content: 'Выберете ивент:', components: [row] });
}
});
client.on('interactionCreate', async interaction => {
if (!interaction.isSelectMenu()) return;
if (interaction.customId === 'select') {
switch (interaction.values[0]) {
case 'one':
interaction.update({ content: 'o_0' });
break;
}
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question