From f9fb29d702c5f5701a444df03f83ca743642d44c Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Tue, 23 Aug 2022 15:02:31 +0000 Subject: [PATCH] fix: missing reverse transformers --- bot.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot.ts b/bot.ts index e9f9dc1d3..5df0f4f14 100644 --- a/bot.ts +++ b/bot.ts @@ -152,7 +152,7 @@ import { } from "./transformers/automodActionExecution.ts"; import { routes } from "./util/routes.ts"; import { transformAllowedMentionsToDiscordAllowedMentions } from "./transformers/reverse/allowedMentions.ts"; -import { AllowedMentions } from "./mod.ts"; +import { AllowedMentions, transformApplicationCommandOptionChoiceToDiscordApplicationCommandOptionChoice, transformApplicationCommandOptionToDiscordApplicationCommandOption } from "./mod.ts"; export function createBot(options: CreateBotOptions): Bot { const bot = { @@ -410,6 +410,8 @@ export interface Transformers { team: (bot: Bot, payload: Team) => DiscordTeam; application: (bot: Bot, payload: Application) => DiscordApplication; snowflake: (snowflake: bigint) => string; + applicationCommandOption: (bot: Bot, payload: ApplicationCommandOption) => DiscordApplicationCommandOption; + applicationCommandOptionChoice: (bot: Bot, payload: ApplicationCommandOptionChoice) => DiscordApplicationCommandOptionChoice; }; snowflake: (snowflake: string) => bigint; gatewayBot: (payload: DiscordGetGatewayBot) => GetGatewayBot; @@ -470,6 +472,8 @@ export function createTransformers(options: Partial) { team: options.reverse?.team || transformTeamToDiscordTeam, application: options.reverse?.application || transformApplicationToDiscordApplication, snowflake: options.reverse?.snowflake || bigintToSnowflake, + applicationCommandOption: options.reverse?.applicationCommandOption || transformApplicationCommandOptionToDiscordApplicationCommandOption, + applicationCommandOptionChoice: options.reverse?.applicationCommandOptionChoice || transformApplicationCommandOptionChoiceToDiscordApplicationCommandOptionChoice, }, automodRule: options.automodRule || transformAutoModerationRule, automodActionExecution: options.automodActionExecution || transformAutoModerationActionExecution,