From 8e38c629af39e4f0fc3223304101bc7c97c61aab Mon Sep 17 00:00:00 2001 From: Superkooka Date: Thu, 30 Jun 2022 23:07:34 +0200 Subject: [PATCH] :sparkles: only 1 role can be selected with dropdown (configurable) --- src/commands/create-role-picker.ts | 2 +- src/config.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/create-role-picker.ts b/src/commands/create-role-picker.ts index 338cca2..f014e3d 100644 --- a/src/commands/create-role-picker.ts +++ b/src/commands/create-role-picker.ts @@ -42,7 +42,7 @@ export class CreateRolePickerCommand extends Command { const row = new MessageActionRow().addComponents( new MessageSelectMenu() .setMinValues(0) - .setMaxValues(role.length) + .setMaxValues(rolePicker.multi_select ? role.length : 1) .setCustomId(`interaction-poc-${rolePicker.name}`) .setPlaceholder(rolePicker.placeholder) .addOptions( diff --git a/src/config.ts b/src/config.ts index 7403b92..de8aa84 100644 --- a/src/config.ts +++ b/src/config.ts @@ -7,6 +7,7 @@ interface RolePicker { name: string, message: string, placeholder: string, + multi_select: boolean roles: Role[] }