mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 09:50:07 +00:00
* feat: add support for customizers * Fixing typescript build errors * add customers for transformGatewayBot and transformThreadMemberGuildCreate customizers and transformer
19 lines
728 B
TypeScript
19 lines
728 B
TypeScript
import type { DiscordApplicationCommandOptionChoice, Locales } from '@discordeno/types'
|
|
import type { Bot } from '../index.js'
|
|
|
|
export function transformApplicationCommandOptionChoice(bot: Bot, payload: DiscordApplicationCommandOptionChoice): ApplicationCommandOptionChoice {
|
|
const applicationCommandOptionChoice = {
|
|
name: payload.name,
|
|
nameLocalizations: payload.name_localizations ?? undefined,
|
|
value: payload.value,
|
|
} as ApplicationCommandOptionChoice
|
|
|
|
return bot.transformers.customizers.applicationCommandOptionChoice(bot, payload, applicationCommandOptionChoice)
|
|
}
|
|
|
|
export interface ApplicationCommandOptionChoice {
|
|
nameLocalizations?: Record<Locales, string>
|
|
name: string
|
|
value: string | number
|
|
}
|