Select Menus
Create menus that let users choose one or more options.
Select Menu Handler
Create it inside selects/color.ts.
1import { Select } from 'discordjs-nextgen';23const colorSelect = Select.create('color_pick')4 .placeholder('Choose a color')5 .options([6 { label: 'Red', value: 'red' },7 { label: 'Blue', value: 'blue' }8 ])9 .onSelect(async (ctx) => {10 const selected = ctx.values.color_pick;11 await ctx.reply(`Selected color: ${selected}`);12 });1314export default colorSelect;
Different Select Types
The Select helper can target user, role, channel and other menu types.
1Select.create('user_pick', { type: 'user' })2 .placeholder('Choose a user')3 .onSelect(async (ctx) => {4 const userId = ctx.values.user_pick;5 await ctx.reply(`Selected user: <@${userId}>`);6 });
Features
- One Select helper for multiple menu types.
- Fast onSelect callback flow.
- Immediate access through ctx.values.
- Folder-based modular loading.