feat: add role menu

This commit is contained in:
Ryan Cao 2022-09-16 22:48:07 +08:00
parent 3367443e32
commit 8bcdddccae
No known key found for this signature in database
3 changed files with 131 additions and 26 deletions

22
src/commands/rolemenu.ts Normal file
View file

@ -0,0 +1,22 @@
import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
CacheType,
ChatInputCommandInteraction,
} from 'discord.js';
export const roleMenuCommand = async (
i: ChatInputCommandInteraction<CacheType>
) => {
const row = new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setCustomId('showRoleMenu')
.setLabel('Show role menu')
.setStyle(ButtonStyle.Primary)
);
await i.channel?.send({ content: '**Role menu**', components: [row] });
await i.reply({ content: 'Done!', ephemeral: true });
};