only 1 role can be selected with dropdown (configurable)

This commit is contained in:
Aymeric GUERACAGUE 2022-06-30 23:07:34 +02:00
parent 1cfc4a8fa8
commit 8e38c629af
Signed by: Superkooka
GPG Key ID: F78F2B172E894865
2 changed files with 2 additions and 1 deletions

View File

@ -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(

View File

@ -7,6 +7,7 @@ interface RolePicker {
name: string,
message: string,
placeholder: string,
multi_select: boolean
roles: Role[]
}