mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-05 06:26:08 +00:00
fix: builders camelCase
This commit is contained in:
parent
f69f89b042
commit
a793b528a0
@ -71,13 +71,13 @@ export type LastCreateApplicationCommands =
|
|||||||
*/
|
*/
|
||||||
export interface CreateApplicationCommand {
|
export interface CreateApplicationCommand {
|
||||||
name: string;
|
name: string;
|
||||||
nameLocalizations?: Localization;
|
name_localizations?: Localization;
|
||||||
description: string;
|
description: string;
|
||||||
descriptionLocalizations?: Localization;
|
description_localizations?: Localization;
|
||||||
type?: ApplicationCommandTypes;
|
type?: ApplicationCommandTypes;
|
||||||
options?: DiscordApplicationCommandOption[];
|
options?: DiscordApplicationCommandOption[];
|
||||||
defaultMemberPermissions?: PermissionResolvable;
|
default_member_permissions?: PermissionResolvable;
|
||||||
dmPermission?: boolean;
|
dm_permission?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@ import type { CreateApplicationCommand } from '../../biscuit';
|
|||||||
import { ApplicationCommandTypes } from '@biscuitland/api-types';
|
import { ApplicationCommandTypes } from '@biscuitland/api-types';
|
||||||
import { OptionBased } from './ApplicationCommandOption';
|
import { OptionBased } from './ApplicationCommandOption';
|
||||||
|
|
||||||
export abstract class ApplicationCommandBuilder implements CreateApplicationCommand {
|
export abstract class ApplicationCommandBuilder {
|
||||||
constructor(
|
constructor(
|
||||||
type: ApplicationCommandTypes = ApplicationCommandTypes.ChatInput,
|
type: ApplicationCommandTypes = ApplicationCommandTypes.ChatInput,
|
||||||
name: string = '',
|
name: string = '',
|
||||||
@ -100,10 +100,10 @@ export class ChatInputApplicationCommandBuilder extends ApplicationCommandBuilde
|
|||||||
name: this.name,
|
name: this.name,
|
||||||
description: this.description,
|
description: this.description,
|
||||||
options: this.options?.map((o) => o.toJSON()) ?? [],
|
options: this.options?.map((o) => o.toJSON()) ?? [],
|
||||||
defaultMemberPermissions: this.defaultMemberPermissions,
|
default_member_permissions: this.defaultMemberPermissions,
|
||||||
nameLocalizations: this.nameLocalizations,
|
name_localizations: this.nameLocalizations,
|
||||||
descriptionLocalizations: this.descriptionLocalizations,
|
description_localizations: this.descriptionLocalizations,
|
||||||
dmPermission: this.dmPermission,
|
dm_permission: this.dmPermission,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,8 @@ export class OptionBuilderLimitedValues extends OptionBuilder {
|
|||||||
return {
|
return {
|
||||||
...super.toJSON(),
|
...super.toJSON(),
|
||||||
choices: this.choices?.map((c) => c.toJSON()) ?? [],
|
choices: this.choices?.map((c) => c.toJSON()) ?? [],
|
||||||
minValue: this.minValue,
|
min_value: this.minValue,
|
||||||
maxValue: this.maxValue,
|
max_value: this.maxValue,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ export class OptionBuilderChannel extends OptionBuilder {
|
|||||||
override toJSON(): ApplicationCommandOption {
|
override toJSON(): ApplicationCommandOption {
|
||||||
return {
|
return {
|
||||||
...super.toJSON(),
|
...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}$` */
|
/** 1-32 character name matching lowercase `^[\w-]{1,32}$` */
|
||||||
name: string;
|
name: string;
|
||||||
/** Localization object for the `name` field. Values follow the same restrictions as `name` */
|
/** Localization object for the `name` field. Values follow the same restrictions as `name` */
|
||||||
nameLocalizations?: Localization;
|
name_localizations?: Localization;
|
||||||
/** 1-100 character description */
|
/** 1-100 character description */
|
||||||
description: string;
|
description: string;
|
||||||
/** Localization object for the `description` field. Values follow the same restrictions as `description` */
|
/** 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` */
|
/** If the parameter is required or optional--default `false` */
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
/** Choices for `string` and `int` types for the user to pick from */
|
/** 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 */
|
/** if autocomplete interactions are enabled for this `String`, `Integer`, or `Number` type option */
|
||||||
autocomplete?: boolean;
|
autocomplete?: boolean;
|
||||||
/** If the option is a channel type, the channels shown will be restricted to these types */
|
/** If the option is a channel type, the channels shown will be restricted to these types */
|
||||||
channelTypes?: ChannelTypes[];
|
channel_types?: ChannelTypes[];
|
||||||
/** Minimum number desired. */
|
/** Minimum number desired. */
|
||||||
minValue?: number;
|
min_value?: number;
|
||||||
/** Maximum number desired. */
|
/** Maximum number desired. */
|
||||||
maxValue?: number;
|
max_value?: number;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user