K
K
K1tekat2022-03-14 18:36:55
JavaScript
K1tekat, 2022-03-14 18:36:55

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;
    }
}
})

How I tried to do it, but nothing worked.
An example of what I want to do:
Main menu 622f60ee20523994150970.jpeg
view View when this argument is clicked622f610a38b74701484000.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question