fix: missing reverse transformers

This commit is contained in:
Skillz4Killz
2022-08-23 15:02:31 +00:00
committed by GitHub
parent b16a3136cf
commit f9fb29d702
+5 -1
View File
@@ -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<Transformers>) {
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,