mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
fix: missing reverse transformers
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user