Ответ на кнопку в слеш команде discordjs
Мой код:
client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;
if (interaction.commandName === 'warn') {
const role = interaction.options.getRole('роль');
const member = interaction.options.getMember('цель');
const row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId('primary')
.setLabel('Легкое')
.setStyle('PRIMARY'),
new MessageButton()
.setCustomId('secondary')
.setLabel('Среднее')
.setStyle('SECONDARY'),
);
await interaction.reply({ content: 'Выберите тяжесть наказания:', ephemeral: true, components: [row] });
member.roles.add(role);
};
});
Как сделать ответ на обе кнопки и временную выдачу роли игроку по ним?