From 58a0064cbf58990e813ec7c3cfb2cd7fd775c93d Mon Sep 17 00:00:00 2001 From: yhx-12243 Date: Tue, 4 Jun 2024 14:20:45 -0400 Subject: [PATCH] feat(discord): add natural number/bigint support (#280) --- adapters/discord/src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adapters/discord/src/utils.ts b/adapters/discord/src/utils.ts index 26c485fe..111205d9 100644 --- a/adapters/discord/src/utils.ts +++ b/adapters/discord/src/utils.ts @@ -334,6 +334,8 @@ const types = { number: Discord.ApplicationCommand.OptionType.NUMBER, integer: Discord.ApplicationCommand.OptionType.INTEGER, posint: Discord.ApplicationCommand.OptionType.INTEGER, + natural: Discord.ApplicationCommand.OptionType.INTEGER, + bigint: Discord.ApplicationCommand.OptionType.INTEGER, user: Discord.ApplicationCommand.OptionType.STRING, channel: Discord.ApplicationCommand.OptionType.STRING, guild: Discord.ApplicationCommand.OptionType.STRING, @@ -401,7 +403,7 @@ export function encodeCommandOptions(cmd: Universal.Command): Discord.Applicatio name: option.name.toLowerCase(), type: types[option.type] ?? types.text, required: false, - min_value: option.type === 'posint' ? 1 : undefined, + min_value: option.type === 'posint' ? 1 : option.type === 'natural' ? 0 : undefined, }) } }