diff --git a/packages/core/src/biscuit.ts b/packages/core/src/biscuit.ts index ad7ffac..a1d7b6a 100644 --- a/packages/core/src/biscuit.ts +++ b/packages/core/src/biscuit.ts @@ -71,13 +71,13 @@ export type LastCreateApplicationCommands = */ export interface CreateApplicationCommand { name: string; - nameLocalizations?: Localization; + name_localizations?: Localization; description: string; - descriptionLocalizations?: Localization; + description_localizations?: Localization; type?: ApplicationCommandTypes; options?: DiscordApplicationCommandOption[]; - defaultMemberPermissions?: PermissionResolvable; - dmPermission?: boolean; + default_member_permissions?: PermissionResolvable; + dm_permission?: boolean; } /** diff --git a/packages/core/src/builders/slash/ApplicationCommand.ts b/packages/core/src/builders/slash/ApplicationCommand.ts index 58ced79..97d9bd2 100644 --- a/packages/core/src/builders/slash/ApplicationCommand.ts +++ b/packages/core/src/builders/slash/ApplicationCommand.ts @@ -3,7 +3,7 @@ import type { CreateApplicationCommand } from '../../biscuit'; import { ApplicationCommandTypes } from '@biscuitland/api-types'; import { OptionBased } from './ApplicationCommandOption'; -export abstract class ApplicationCommandBuilder implements CreateApplicationCommand { +export abstract class ApplicationCommandBuilder { constructor( type: ApplicationCommandTypes = ApplicationCommandTypes.ChatInput, name: string = '', @@ -100,10 +100,10 @@ export class ChatInputApplicationCommandBuilder extends ApplicationCommandBuilde name: this.name, description: this.description, options: this.options?.map((o) => o.toJSON()) ?? [], - defaultMemberPermissions: this.defaultMemberPermissions, - nameLocalizations: this.nameLocalizations, - descriptionLocalizations: this.descriptionLocalizations, - dmPermission: this.dmPermission, + default_member_permissions: this.defaultMemberPermissions, + name_localizations: this.nameLocalizations, + description_localizations: this.descriptionLocalizations, + dm_permission: this.dmPermission, }; } } diff --git a/packages/core/src/builders/slash/ApplicationCommandOption.ts b/packages/core/src/builders/slash/ApplicationCommandOption.ts index 86a4504..293e11f 100644 --- a/packages/core/src/builders/slash/ApplicationCommandOption.ts +++ b/packages/core/src/builders/slash/ApplicationCommandOption.ts @@ -108,8 +108,8 @@ export class OptionBuilderLimitedValues extends OptionBuilder { return { ...super.toJSON(), choices: this.choices?.map((c) => c.toJSON()) ?? [], - minValue: this.minValue, - maxValue: this.maxValue, + min_value: this.minValue, + max_value: this.maxValue, }; } } @@ -166,7 +166,7 @@ export class OptionBuilderChannel extends OptionBuilder { override toJSON(): ApplicationCommandOption { return { ...super.toJSON(), - channelTypes: this.channelTypes ?? [], + channel_types: this.channelTypes ?? [], }; } } @@ -323,11 +323,11 @@ export interface ApplicationCommandOption { /** 1-32 character name matching lowercase `^[\w-]{1,32}$` */ name: string; /** Localization object for the `name` field. Values follow the same restrictions as `name` */ - nameLocalizations?: Localization; + name_localizations?: Localization; /** 1-100 character description */ description: string; /** Localization object for the `description` field. Values follow the same restrictions as `description` */ - descriptionLocalizations?: Localization; + description_localizations?: Localization; /** If the parameter is required or optional--default `false` */ required?: boolean; /** Choices for `string` and `int` types for the user to pick from */ @@ -337,9 +337,9 @@ export interface ApplicationCommandOption { /** if autocomplete interactions are enabled for this `String`, `Integer`, or `Number` type option */ autocomplete?: boolean; /** If the option is a channel type, the channels shown will be restricted to these types */ - channelTypes?: ChannelTypes[]; + channel_types?: ChannelTypes[]; /** Minimum number desired. */ - minValue?: number; + min_value?: number; /** Maximum number desired. */ - maxValue?: number; + max_value?: number; }