@discordjs/builders
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -1,6 +0,5 @@ | ||
import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, ApplicationCommandOptionType, ChannelType, APIApplicationCommandChannelOptions, APIApplicationCommandOptionChoice, APIApplicationCommandOption, APIApplicationCommandSubCommandOptions, RESTPostAPIApplicationCommandsJSONBody, ApplicationCommandType } from 'discord-api-types/v9'; | ||
import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9'; | ||
import { z } from 'zod'; | ||
import { Snowflake } from 'discord-api-types/globals'; | ||
import { URL } from 'url'; | ||
import * as discord_api_types from 'discord-api-types'; | ||
@@ -452,9 +451,41 @@ declare const fieldNamePredicate: z.ZodString; | ||
declare class SlashCommandBooleanOption extends SlashCommandOptionBase { | ||
declare class SharedNameAndDescription { | ||
readonly name: string; | ||
readonly description: string; | ||
/** | ||
* Sets the name | ||
* | ||
* @param name The name | ||
*/ | ||
setName(name: string): this; | ||
/** | ||
* Sets the description | ||
* | ||
* @param description The description | ||
*/ | ||
setDescription(description: string): this; | ||
} | ||
declare abstract class ApplicationCommandOptionBase extends SharedNameAndDescription { | ||
abstract readonly type: ApplicationCommandOptionType; | ||
readonly required = false; | ||
/** | ||
* Marks the option as required | ||
* | ||
* @param required If this option should be required | ||
*/ | ||
setRequired(required: boolean): this; | ||
abstract toJSON(): APIApplicationCommandBasicOption; | ||
protected runRequiredValidations(): void; | ||
} | ||
declare class SlashCommandBooleanOption extends ApplicationCommandOptionBase { | ||
readonly type: ApplicationCommandOptionType.Boolean; | ||
constructor(); | ||
toJSON(): APIApplicationCommandBooleanOption; | ||
} | ||
declare abstract class ApplicationCommandOptionWithChannelTypesBase extends SlashCommandOptionBase<ApplicationCommandOptionType.Channel> implements ToAPIApplicationCommandOptions { | ||
channelTypes?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[]; | ||
declare const allowedChannelTypes: readonly [ChannelType.GuildText, ChannelType.GuildVoice, ChannelType.GuildCategory, ChannelType.GuildNews, ChannelType.GuildStore, ChannelType.GuildNewsThread, ChannelType.GuildPublicThread, ChannelType.GuildPrivateThread, ChannelType.GuildStageVoice]; | ||
declare type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number]; | ||
declare class ApplicationCommandOptionChannelTypesMixin { | ||
readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[]; | ||
/** | ||
@@ -465,3 +496,3 @@ * Adds a channel type to this option | ||
*/ | ||
addChannelType(channelType: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>): this; | ||
addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes): this; | ||
/** | ||
@@ -472,14 +503,31 @@ * Adds channel types to this option | ||
*/ | ||
addChannelTypes(channelTypes: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[]): this; | ||
toJSON(): APIApplicationCommandChannelOptions; | ||
addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this; | ||
} | ||
declare class SlashCommandChannelOption extends ApplicationCommandOptionWithChannelTypesBase { | ||
declare class SlashCommandChannelOption extends ApplicationCommandOptionBase { | ||
readonly type: ApplicationCommandOptionType.Channel; | ||
constructor(); | ||
toJSON(): APIApplicationCommandChannelOption; | ||
} | ||
interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypesMixin { | ||
} | ||
declare abstract class ApplicationCommandOptionWithChoicesBase<T extends string | number> extends SlashCommandOptionBase<ApplicationCommandOptionType.String | ApplicationCommandOptionType.Number | ApplicationCommandOptionType.Integer> implements ToAPIApplicationCommandOptions { | ||
choices?: APIApplicationCommandOptionChoice[]; | ||
declare abstract class ApplicationCommandNumericOptionMinMaxValueMixin { | ||
protected readonly maxValue?: number; | ||
protected readonly minValue?: number; | ||
/** | ||
* Sets the maximum number value of this option | ||
* @param max The maximum value this option can be | ||
*/ | ||
abstract setMaxValue(max: number): this; | ||
/** | ||
* Sets the minimum number value of this option | ||
* @param min The minimum value this option can be | ||
*/ | ||
abstract setMinValue(min: number): this; | ||
} | ||
declare class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends string | number> { | ||
readonly choices?: APIApplicationCommandOptionChoice<T>[]; | ||
readonly autocomplete?: boolean; | ||
readonly type: ApplicationCommandOptionType; | ||
/** | ||
@@ -498,2 +546,3 @@ * Adds a choice for this option | ||
addChoices(choices: [name: string, value: T][]): Omit<this, 'setAutocomplete'>; | ||
setChoices<Input extends [name: string, value: T][]>(choices: Input): Input extends [] ? this & Pick<ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T>, 'setAutocomplete'> : Omit<this, 'setAutocomplete'>; | ||
/** | ||
@@ -503,114 +552,43 @@ * Marks the option as autocompletable | ||
*/ | ||
setAutocomplete<U extends boolean>(autocomplete: U): U extends true ? Omit<this, 'addChoice' | 'addChoices'> : this & Pick<ApplicationCommandOptionWithChoicesBase<T>, 'addChoice' | 'addChoices'>; | ||
toJSON(): APIApplicationCommandOption; | ||
setAutocomplete<U extends boolean>(autocomplete: U): U extends true ? Omit<this, 'addChoice' | 'addChoices'> : this & Pick<ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T>, 'addChoice' | 'addChoices'>; | ||
} | ||
declare abstract class ApplicationCommandNumberOptionBase extends ApplicationCommandOptionWithChoicesBase<number> { | ||
protected maxValue?: number; | ||
protected minValue?: number; | ||
/** | ||
* Sets the maximum number value of this option | ||
* @param max The maximum value this option can be | ||
*/ | ||
abstract setMaxValue(max: number): this; | ||
/** | ||
* Sets the minimum number value of this option | ||
* @param min The minimum value this option can be | ||
*/ | ||
abstract setMinValue(min: number): this; | ||
toJSON(): { | ||
min_value: number | undefined; | ||
max_value: number | undefined; | ||
type: discord_api_types.ApplicationCommandOptionType.String | discord_api_types.ApplicationCommandOptionType.Integer | discord_api_types.ApplicationCommandOptionType.Number; | ||
choices?: discord_api_types.APIApplicationCommandOptionChoice[] | undefined; | ||
autocomplete?: false | undefined; | ||
name: string; | ||
description: string; | ||
required?: boolean | undefined; | ||
} | { | ||
min_value: number | undefined; | ||
max_value: number | undefined; | ||
type: discord_api_types.ApplicationCommandOptionType.Subcommand | discord_api_types.ApplicationCommandOptionType.SubcommandGroup; | ||
options?: discord_api_types.APIApplicationCommandOption[] | undefined; | ||
name: string; | ||
description: string; | ||
required?: boolean | undefined; | ||
autocomplete?: undefined; | ||
} | { | ||
min_value: number | undefined; | ||
max_value: number | undefined; | ||
type: discord_api_types.ApplicationCommandOptionType.Boolean | discord_api_types.ApplicationCommandOptionType.User | discord_api_types.ApplicationCommandOptionType.Role | discord_api_types.ApplicationCommandOptionType.Mentionable; | ||
name: string; | ||
description: string; | ||
required?: boolean | undefined; | ||
autocomplete?: undefined; | ||
} | { | ||
min_value: number | undefined; | ||
max_value: number | undefined; | ||
type: discord_api_types.ApplicationCommandOptionType.Channel; | ||
channel_types?: (discord_api_types.ChannelType.GuildText | discord_api_types.ChannelType.GuildVoice | discord_api_types.ChannelType.GuildCategory | discord_api_types.ChannelType.GuildNews | discord_api_types.ChannelType.GuildStore | discord_api_types.ChannelType.GuildNewsThread | discord_api_types.ChannelType.GuildPublicThread | discord_api_types.ChannelType.GuildPrivateThread | discord_api_types.ChannelType.GuildStageVoice)[] | undefined; | ||
name: string; | ||
description: string; | ||
required?: boolean | undefined; | ||
autocomplete?: undefined; | ||
} | { | ||
min_value: number | undefined; | ||
max_value: number | undefined; | ||
type: discord_api_types.ApplicationCommandOptionType.Integer | discord_api_types.ApplicationCommandOptionType.Number; | ||
choices?: discord_api_types.APIApplicationCommandOptionChoice[] | undefined; | ||
autocomplete?: false | undefined; | ||
name: string; | ||
description: string; | ||
required?: boolean | undefined; | ||
} | { | ||
min_value: number | undefined; | ||
max_value: number | undefined; | ||
type: discord_api_types.ApplicationCommandOptionType.String; | ||
autocomplete: true; | ||
name: string; | ||
description: string; | ||
required?: boolean | undefined; | ||
} | { | ||
min_value: number | undefined; | ||
max_value: number | undefined; | ||
type: discord_api_types.ApplicationCommandOptionType.Integer | discord_api_types.ApplicationCommandOptionType.Number; | ||
autocomplete: true; | ||
name: string; | ||
description: string; | ||
required?: boolean | undefined; | ||
}; | ||
} | ||
declare class SlashCommandIntegerOption extends ApplicationCommandNumberOptionBase { | ||
declare class SlashCommandIntegerOption extends ApplicationCommandOptionBase implements ApplicationCommandNumericOptionMinMaxValueMixin { | ||
readonly type: ApplicationCommandOptionType.Integer; | ||
constructor(); | ||
setMaxValue(max: number): this; | ||
setMinValue(min: number): this; | ||
toJSON(): APIApplicationCommandIntegerOption; | ||
} | ||
interface SlashCommandIntegerOption extends ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> { | ||
} | ||
declare class SlashCommandMentionableOption extends SlashCommandOptionBase { | ||
declare class SlashCommandMentionableOption extends ApplicationCommandOptionBase { | ||
readonly type: ApplicationCommandOptionType.Mentionable; | ||
constructor(); | ||
toJSON(): APIApplicationCommandMentionableOption; | ||
} | ||
declare class SlashCommandNumberOption extends ApplicationCommandNumberOptionBase { | ||
declare class SlashCommandNumberOption extends ApplicationCommandOptionBase implements ApplicationCommandNumericOptionMinMaxValueMixin { | ||
readonly type: ApplicationCommandOptionType.Number; | ||
constructor(); | ||
setMaxValue(max: number): this; | ||
setMinValue(min: number): this; | ||
toJSON(): APIApplicationCommandNumberOption; | ||
} | ||
interface SlashCommandNumberOption extends ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> { | ||
} | ||
declare class SlashCommandRoleOption extends SlashCommandOptionBase { | ||
declare class SlashCommandRoleOption extends ApplicationCommandOptionBase { | ||
readonly type: ApplicationCommandOptionType.Role; | ||
constructor(); | ||
toJSON(): APIApplicationCommandRoleOption; | ||
} | ||
declare class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase<string> { | ||
declare class SlashCommandStringOption extends ApplicationCommandOptionBase { | ||
readonly type: ApplicationCommandOptionType.String; | ||
constructor(); | ||
toJSON(): APIApplicationCommandStringOption; | ||
} | ||
interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> { | ||
} | ||
declare class SlashCommandUserOption extends SlashCommandOptionBase { | ||
declare class SlashCommandUserOption extends ApplicationCommandOptionBase { | ||
readonly type: ApplicationCommandOptionType.User; | ||
constructor(); | ||
toJSON(): APIApplicationCommandUserOption; | ||
} | ||
@@ -671,19 +649,2 @@ | ||
declare class SharedNameAndDescription { | ||
readonly name: string; | ||
readonly description: string; | ||
/** | ||
* Sets the name | ||
* | ||
* @param name The name | ||
*/ | ||
setName(name: string): this; | ||
/** | ||
* Sets the description | ||
* | ||
* @param description The description | ||
*/ | ||
setDescription(description: string): this; | ||
} | ||
/** | ||
@@ -706,3 +667,3 @@ * Represents a folder for subcommands | ||
*/ | ||
readonly options: ToAPIApplicationCommandOptions[]; | ||
readonly options: SlashCommandSubcommandBuilder[]; | ||
/** | ||
@@ -714,3 +675,3 @@ * Adds a new subcommand to this group | ||
addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this; | ||
toJSON(): APIApplicationCommandSubCommandOptions; | ||
toJSON(): APIApplicationCommandSubcommandGroupOption; | ||
} | ||
@@ -736,4 +697,4 @@ interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription { | ||
*/ | ||
readonly options: ToAPIApplicationCommandOptions[]; | ||
toJSON(): APIApplicationCommandSubCommandOptions; | ||
readonly options: ApplicationCommandOptionBase[]; | ||
toJSON(): APIApplicationCommandSubcommandOption; | ||
} | ||
@@ -801,15 +762,2 @@ interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> { | ||
declare class SlashCommandOptionBase<OptionType extends ApplicationCommandOptionType = ApplicationCommandOptionType> extends SharedNameAndDescription implements ToAPIApplicationCommandOptions { | ||
required: boolean; | ||
readonly type: OptionType; | ||
constructor(type: OptionType); | ||
/** | ||
* Marks the option as required | ||
* | ||
* @param required If this option should be required | ||
*/ | ||
setRequired(required: boolean): this; | ||
toJSON(): APIApplicationCommandOption; | ||
} | ||
declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void; | ||
@@ -822,3 +770,3 @@ declare function validateName$1(name: unknown): asserts name is string; | ||
declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void; | ||
declare function assertReturnOfBuilder<T extends SlashCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T; | ||
declare function assertReturnOfBuilder<T extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T; | ||
@@ -825,0 +773,0 @@ declare const Assertions$1_validateDescription: typeof validateDescription; |
@@ -1,4 +0,4 @@ | ||
var _e=Object.create;var x=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var Fe=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty;var Je=(t,e,n)=>e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ge=t=>x(t,"__esModule",{value:!0});var N=(t,e)=>{for(var n in e)x(t,n,{get:e[n],enumerable:!0})},Pe=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ue(e))!Ge.call(t,r)&&(n||r!=="default")&&x(t,r,{get:()=>e[r],enumerable:!(o=Ae(e,r))||o.enumerable});return t},Ve=(t,e)=>Pe(ge(x(t!=null?_e(Fe(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),qe=(t=>(e,n)=>t&&t.get(e)||(n=Pe(ge({}),e,1),t&&t.set(e,n),n))(typeof WeakMap!="undefined"?new WeakMap:0),g=(t,e,n,o)=>{for(var r=o>1?void 0:o?Ae(e,n):e,f=t.length-1,A;f>=0;f--)(A=t[f])&&(r=(o?A(e,n,r):A(r))||r);return o&&r&&x(e,n,r),r};var i=(t,e,n)=>(Je(t,typeof e!="symbol"?e+"":e,n),n);var xt={};N(xt,{ContextMenuCommandAssertions:()=>ye,ContextMenuCommandBuilder:()=>Le,Embed:()=>P,EmbedAssertions:()=>ne,Faces:()=>ve,SlashCommandAssertions:()=>re,SlashCommandBooleanOption:()=>_,SlashCommandBuilder:()=>W,SlashCommandChannelOption:()=>U,SlashCommandIntegerOption:()=>G,SlashCommandMentionableOption:()=>J,SlashCommandNumberOption:()=>V,SlashCommandRoleOption:()=>q,SlashCommandStringOption:()=>z,SlashCommandSubcommandBuilder:()=>l,SlashCommandSubcommandGroupBuilder:()=>b,SlashCommandUserOption:()=>j,TimestampStyles:()=>pt,blockQuote:()=>Xe,bold:()=>Ze,channelMention:()=>ot,codeBlock:()=>ze,formatEmoji:()=>at,hideLinkEmbed:()=>Ye,hyperlink:()=>et,inlineCode:()=>je,italic:()=>We,memberNicknameMention:()=>it,quote:()=>He,roleMention:()=>rt,spoiler:()=>tt,strikethrough:()=>Qe,time:()=>st,underscore:()=>Ke,userMention:()=>nt});var ne={};N(ne,{authorNamePredicate:()=>Q,colorPredicate:()=>H,descriptionPredicate:()=>X,embedFieldPredicate:()=>Te,embedFieldsArrayPredicate:()=>M,fieldInlinePredicate:()=>R,fieldLengthPredicate:()=>Ie,fieldNamePredicate:()=>S,fieldValuePredicate:()=>B,footerTextPredicate:()=>Y,timestampPredicate:()=>ee,titlePredicate:()=>te,urlPredicate:()=>u,validateFieldLength:()=>E});var s=require("zod"),S=s.z.string().min(1).max(256),B=s.z.string().min(1).max(1024),R=s.z.boolean().optional(),Te=s.z.object({name:S,value:B,inline:R}),M=Te.array(),Ie=s.z.number().lte(25);function E(t,e){Ie.parse(t.length+e)}var Q=S.nullable(),u=s.z.string().url().nullish(),H=s.z.number().gte(0).lte(16777215).nullable(),X=s.z.string().min(1).max(4096).nullable(),Y=s.z.string().min(1).max(2048).nullable(),ee=s.z.union([s.z.number(),s.z.date()]).nullable(),te=S.nullable();var P=class{constructor(e={}){i(this,"fields");i(this,"title");i(this,"description");i(this,"url");i(this,"color");i(this,"timestamp");i(this,"thumbnail");i(this,"image");i(this,"video");i(this,"author");i(this,"provider");i(this,"footer");this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.thumbnail=e.thumbnail,this.image=e.image,this.video=e.video,this.author=e.author,this.provider=e.provider,this.footer=e.footer,this.fields=e.fields??[],e.timestamp&&(this.timestamp=new Date(e.timestamp).toISOString())}get length(){return(this.title?.length??0)+(this.description?.length??0)+this.fields.reduce((e,n)=>e+n.name.length+n.value.length,0)+(this.footer?.text.length??0)+(this.author?.name.length??0)}addField(e){return this.addFields(e)}addFields(...e){return M.parse(e),E(this.fields,e.length),this.fields.push(...P.normalizeFields(...e)),this}spliceFields(e,n,...o){return M.parse(o),E(this.fields,o.length-n),this.fields.splice(e,n,...P.normalizeFields(...o)),this}setAuthor(e){if(e===null)return this.author=void 0,this;let{name:n,iconURL:o,url:r}=e;return Q.parse(n),u.parse(o),u.parse(r),this.author={name:n,url:r,icon_url:o},this}setColor(e){return H.parse(e),this.color=e??void 0,this}setDescription(e){return X.parse(e),this.description=e??void 0,this}setFooter(e){if(e===null)return this.footer=void 0,this;let{text:n,iconURL:o}=e;return Y.parse(n),u.parse(o),this.footer={text:n,icon_url:o},this}setImage(e){return u.parse(e),this.image=e?{url:e}:void 0,this}setThumbnail(e){return u.parse(e),this.thumbnail=e?{url:e}:void 0,this}setTimestamp(e=Date.now()){return ee.parse(e),this.timestamp=e?new Date(e).toISOString():void 0,this}setTitle(e){return te.parse(e),this.title=e??void 0,this}setURL(e){return u.parse(e),this.url=e??void 0,this}toJSON(){return{...this}}static normalizeFields(...e){return e.flat(1/0).map(n=>(S.parse(n.name),B.parse(n.value),R.parse(n.inline),{name:n.name,value:n.value,inline:n.inline??void 0}))}};function ze(t,e){return typeof e=="undefined"?`\`\`\` | ||
var Ge=Object.create;var O=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var ze=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var je=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ce=t=>O(t,"__esModule",{value:!0});var w=(t,e)=>{for(var i in e)O(t,i,{get:e[i],enumerable:!0})},fe=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qe(e))!We.call(t,r)&&(i||r!=="default")&&O(t,r,{get:()=>e[r],enumerable:!(o=he(e,r))||o.enumerable});return t},Ze=(t,e)=>fe(Ce(O(t!=null?Ge(ze(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Ke=(t=>(e,i)=>t&&t.get(e)||(i=fe(Ce({}),e,1),t&&t.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0),p=(t,e,i,o)=>{for(var r=o>1?void 0:o?he(e,i):e,A=t.length-1,R;A>=0;A--)(R=t[A])&&(r=(o?R(e,i,r):R(r))||r);return o&&r&&O(e,i,r),r};var n=(t,e,i)=>(je(t,typeof e!="symbol"?e+"":e,i),i);var yt={};w(yt,{ContextMenuCommandAssertions:()=>ue,ContextMenuCommandBuilder:()=>Je,Embed:()=>M,EmbedAssertions:()=>ie,Faces:()=>Ae,SlashCommandAssertions:()=>re,SlashCommandBooleanOption:()=>J,SlashCommandBuilder:()=>j,SlashCommandChannelOption:()=>y,SlashCommandIntegerOption:()=>P,SlashCommandMentionableOption:()=>q,SlashCommandNumberOption:()=>T,SlashCommandRoleOption:()=>z,SlashCommandStringOption:()=>I,SlashCommandSubcommandBuilder:()=>c,SlashCommandSubcommandGroupBuilder:()=>x,SlashCommandUserOption:()=>W,TimestampStyles:()=>ut,blockQuote:()=>nt,bold:()=>Ye,channelMention:()=>mt,codeBlock:()=>Qe,formatEmoji:()=>dt,hideLinkEmbed:()=>ot,hyperlink:()=>rt,inlineCode:()=>He,italic:()=>Xe,memberNicknameMention:()=>pt,quote:()=>it,roleMention:()=>lt,spoiler:()=>at,strikethrough:()=>tt,time:()=>ct,underscore:()=>et,userMention:()=>st});var ie={};w(ie,{authorNamePredicate:()=>Q,colorPredicate:()=>H,descriptionPredicate:()=>X,embedFieldPredicate:()=>be,embedFieldsArrayPredicate:()=>_,fieldInlinePredicate:()=>k,fieldLengthPredicate:()=>xe,fieldNamePredicate:()=>S,fieldValuePredicate:()=>E,footerTextPredicate:()=>Y,timestampPredicate:()=>ee,titlePredicate:()=>te,urlPredicate:()=>u,validateFieldLength:()=>L});var m=require("zod"),S=m.z.string().min(1).max(256),E=m.z.string().min(1).max(1024),k=m.z.boolean().optional(),be=m.z.object({name:S,value:E,inline:k}),_=be.array(),xe=m.z.number().lte(25);function L(t,e){xe.parse(t.length+e)}var Q=S.nullable(),u=m.z.string().url().nullish(),H=m.z.number().gte(0).lte(16777215).nullable(),X=m.z.string().min(1).max(4096).nullable(),Y=m.z.string().min(1).max(2048).nullable(),ee=m.z.union([m.z.number(),m.z.date()]).nullable(),te=S.nullable();var M=class{constructor(e={}){n(this,"fields");n(this,"title");n(this,"description");n(this,"url");n(this,"color");n(this,"timestamp");n(this,"thumbnail");n(this,"image");n(this,"video");n(this,"author");n(this,"provider");n(this,"footer");this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.thumbnail=e.thumbnail,this.image=e.image,this.video=e.video,this.author=e.author,this.provider=e.provider,this.footer=e.footer,this.fields=e.fields??[],e.timestamp&&(this.timestamp=new Date(e.timestamp).toISOString())}get length(){return(this.title?.length??0)+(this.description?.length??0)+this.fields.reduce((e,i)=>e+i.name.length+i.value.length,0)+(this.footer?.text.length??0)+(this.author?.name.length??0)}addField(e){return this.addFields(e)}addFields(...e){return _.parse(e),L(this.fields,e.length),this.fields.push(...M.normalizeFields(...e)),this}spliceFields(e,i,...o){return _.parse(o),L(this.fields,o.length-i),this.fields.splice(e,i,...M.normalizeFields(...o)),this}setAuthor(e){if(e===null)return this.author=void 0,this;let{name:i,iconURL:o,url:r}=e;return Q.parse(i),u.parse(o),u.parse(r),this.author={name:i,url:r,icon_url:o},this}setColor(e){return H.parse(e),this.color=e??void 0,this}setDescription(e){return X.parse(e),this.description=e??void 0,this}setFooter(e){if(e===null)return this.footer=void 0,this;let{text:i,iconURL:o}=e;return Y.parse(i),u.parse(o),this.footer={text:i,icon_url:o},this}setImage(e){return u.parse(e),this.image=e?{url:e}:void 0,this}setThumbnail(e){return u.parse(e),this.thumbnail=e?{url:e}:void 0,this}setTimestamp(e=Date.now()){return ee.parse(e),this.timestamp=e?new Date(e).toISOString():void 0,this}setTitle(e){return te.parse(e),this.title=e??void 0,this}setURL(e){return u.parse(e),this.url=e??void 0,this}toJSON(){return{...this}}static normalizeFields(...e){return e.flat(1/0).map(i=>(S.parse(i.name),E.parse(i.value),k.parse(i.inline),{name:i.name,value:i.value,inline:i.inline??void 0}))}};function Qe(t,e){return typeof e=="undefined"?`\`\`\` | ||
${t}\`\`\``:`\`\`\`${t} | ||
${e}\`\`\``}function je(t){return`\`${t}\``}function We(t){return`_${t}_`}function Ze(t){return`**${t}**`}function Ke(t){return`__${t}__`}function Qe(t){return`~~${t}~~`}function He(t){return`> ${t}`}function Xe(t){return`>>> ${t}`}function Ye(t){return`<${t}>`}function et(t,e,n){return n?`[${t}](${e} "${n}")`:`[${t}](${e})`}function tt(t){return`||${t}||`}function nt(t){return`<@${t}>`}function it(t){return`<@!${t}>`}function ot(t){return`<#${t}>`}function rt(t){return`<@&${t}>`}function at(t,e=!1){return`<${e?"a":""}:_:${t}>`}function st(t,e){return typeof t!="number"&&(t=Math.floor((t?.getTime()??Date.now())/1e3)),typeof e=="string"?`<t:${t}:${e}>`:`<t:${t}>`}var pt={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},ve=(o=>(o.Shrug="\xAF\\_(\u30C4)\\_/\xAF",o.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",o.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",o))(ve||{});var re={};N(re,{assertReturnOfBuilder:()=>h,validateDefaultPermission:()=>ie,validateDescription:()=>D,validateMaxChoicesLength:()=>oe,validateMaxOptionsLength:()=>d,validateName:()=>k,validateRequired:()=>L,validateRequiredParameters:()=>c});var w=Ve(require("@sindresorhus/is")),T=require("zod");function c(t,e,n){k(t),D(e),d(n)}var mt=T.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function k(t){mt.parse(t)}var dt=T.z.string().min(1).max(100);function D(t){dt.parse(t)}var $e=T.z.boolean();function ie(t){$e.parse(t)}function L(t){$e.parse(t)}var Ne=T.z.unknown().array().max(25);function d(t){Ne.parse(t)}function oe(t){Ne.parse(t)}function h(t,e){let n=e.name;if(w.default.nullOrUndefined(t))throw new TypeError(`Expected to receive a ${n} builder, got ${t===null?"null":"undefined"} instead.`);if(w.default.primitive(t))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof t}) instead.`);if(!(t instanceof e)){let o=t,r=w.default.function_(t)?t.name:o.constructor.name,f=Reflect.get(o,Symbol.toStringTag),A=f?`${r} [${f}]`:r;throw new TypeError(`Expected to receive a ${n} builder, got ${A} instead.`)}}var De=require("ts-mixer");var ae=require("discord-api-types/v9");var C=class{constructor(){i(this,"name");i(this,"description")}setName(e){return k(e),Reflect.set(this,"name",e),this}setDescription(e){return D(e),Reflect.set(this,"description",e),this}};var p=class extends C{constructor(e){super();i(this,"required",!1);i(this,"type");this.type=e}setRequired(e){return L(e),this.required=e,this}toJSON(){return c(this.name,this.description,[]),L(this.required),{type:this.type,name:this.name,description:this.description,required:this.required}}};var _=class extends p{constructor(){super(ae.ApplicationCommandOptionType.Boolean);i(this,"type",ae.ApplicationCommandOptionType.Boolean)}};var me=require("discord-api-types/v9");var m=require("discord-api-types/v9"),se=require("zod");var lt=[m.ChannelType.GuildCategory,m.ChannelType.GuildNews,m.ChannelType.GuildNewsThread,m.ChannelType.GuildStore,m.ChannelType.GuildStageVoice,m.ChannelType.GuildText,m.ChannelType.GuildVoice,m.ChannelType.GuildPublicThread,m.ChannelType.GuildPrivateThread],ut=se.z.union(lt.map(t=>se.z.literal(t))),pe=class extends p{constructor(){super(...arguments);i(this,"channelTypes")}addChannelType(e){return this.channelTypes??=[],ut.parse(e),this.channelTypes.push(e),this}addChannelTypes(e){return e.forEach(n=>this.addChannelType(n)),this}toJSON(){return{...super.toJSON(),type:this.type,channel_types:this.channelTypes}}};var U=class extends pe{constructor(){super(me.ApplicationCommandOptionType.Channel);i(this,"type",me.ApplicationCommandOptionType.Channel)}};var de=require("discord-api-types/v9");var Be=require("discord-api-types/v9"),O=require("zod");var F=O.z.string().min(1).max(100),Re=O.z.number().gt(-1/0).lt(1/0),ct=O.z.tuple([F,O.z.union([F,Re])]).array(),ht=O.z.boolean(),I=class extends p{constructor(){super(...arguments);i(this,"choices");i(this,"autocomplete")}addChoice(e,n){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices??=[],oe(this.choices),F.parse(e),this.type===Be.ApplicationCommandOptionType.String?F.parse(n):Re.parse(n),this.choices.push({name:e,value:n}),this}addChoices(e){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");ct.parse(e);for(let[n,o]of e)this.addChoice(n,o);return this}setAutocomplete(e){if(ht.parse(e),e&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return Reflect.set(this,"autocomplete",e),this}toJSON(){if(this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...super.toJSON(),choices:this.choices,autocomplete:this.autocomplete}}};var v=class extends I{constructor(){super(...arguments);i(this,"maxValue");i(this,"minValue")}toJSON(){return{...super.toJSON(),min_value:this.minValue,max_value:this.maxValue}}};var Me=require("zod"),Ee=Me.z.number().int().nonnegative(),G=class extends v{constructor(){super(de.ApplicationCommandOptionType.Integer);i(this,"type",de.ApplicationCommandOptionType.Integer)}setMaxValue(e){return Ee.parse(e),this.maxValue=e,this}setMinValue(e){return Ee.parse(e),this.minValue=e,this}};var le=require("discord-api-types/v9");var J=class extends p{constructor(){super(le.ApplicationCommandOptionType.Mentionable);i(this,"type",le.ApplicationCommandOptionType.Mentionable)}};var ue=require("discord-api-types/v9");var we=require("zod"),ke=we.z.number().nonnegative(),V=class extends v{constructor(){super(ue.ApplicationCommandOptionType.Number);i(this,"type",ue.ApplicationCommandOptionType.Number)}setMaxValue(e){return ke.parse(e),this.maxValue=e,this}setMinValue(e){return ke.parse(e),this.minValue=e,this}};var ce=require("discord-api-types/v9");var q=class extends p{constructor(){super(ce.ApplicationCommandOptionType.Role);i(this,"type",ce.ApplicationCommandOptionType.Role)}};var he=require("discord-api-types/v9");var z=class extends I{constructor(){super(he.ApplicationCommandOptionType.String);i(this,"type",he.ApplicationCommandOptionType.String)}};var Ce=require("discord-api-types/v9");var j=class extends p{constructor(){super(Ce.ApplicationCommandOptionType.User);i(this,"type",Ce.ApplicationCommandOptionType.User)}};var $=class{constructor(){i(this,"options")}addBooleanOption(e){return this._sharedAddOptionMethod(e,_)}addUserOption(e){return this._sharedAddOptionMethod(e,j)}addChannelOption(e){return this._sharedAddOptionMethod(e,U)}addRoleOption(e){return this._sharedAddOptionMethod(e,q)}addMentionableOption(e){return this._sharedAddOptionMethod(e,J)}addStringOption(e){return this._sharedAddOptionMethod(e,z)}addIntegerOption(e){return this._sharedAddOptionMethod(e,G)}addNumberOption(e){return this._sharedAddOptionMethod(e,V)}_sharedAddOptionMethod(e,n){let{options:o}=this;d(o);let r=typeof e=="function"?e(new n):e;return h(r,n),o.push(r),this}};var be=require("discord-api-types/v9"),fe=require("ts-mixer");var b=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(e){let{options:n}=this;d(n);let o=typeof e=="function"?e(new l):e;return h(o,l),n.push(o),this}toJSON(){return c(this.name,this.description,this.options),{type:be.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};b=g([(0,fe.mix)(C)],b);var l=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return c(this.name,this.description,this.options),{type:be.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};l=g([(0,fe.mix)(C,$)],l);var W=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return c(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(e=>e.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(e){return ie(e),Reflect.set(this,"defaultPermission",e),this}addSubcommandGroup(e){let{options:n}=this;d(n);let o=typeof e=="function"?e(new b):e;return h(o,b),n.push(o),this}addSubcommand(e){let{options:n}=this;d(n);let o=typeof e=="function"?e(new l):e;return h(o,l),n.push(o),this}};W=g([(0,De.mix)($,C)],W);var ye={};N(ye,{validateDefaultPermission:()=>Oe,validateName:()=>Z,validateRequiredParameters:()=>Se,validateType:()=>K});var y=require("zod"),xe=require("discord-api-types/v9");function Se(t,e){Z(t),K(e)}var Ct=y.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u);function Z(t){Ct.parse(t)}var bt=y.z.union([y.z.literal(xe.ApplicationCommandType.User),y.z.literal(xe.ApplicationCommandType.Message)]);function K(t){bt.parse(t)}var ft=y.z.boolean();function Oe(t){ft.parse(t)}var Le=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(e){return Z(e),Reflect.set(this,"name",e),this}setType(e){return K(e),Reflect.set(this,"type",e),this}setDefaultPermission(e){return Oe(e),Reflect.set(this,"defaultPermission",e),this}toJSON(){return Se(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};module.exports=qe(xt);0&&(module.exports={ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SlashCommandAssertions,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,blockQuote,bold,channelMention,codeBlock,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention}); | ||
${e}\`\`\``}function He(t){return`\`${t}\``}function Xe(t){return`_${t}_`}function Ye(t){return`**${t}**`}function et(t){return`__${t}__`}function tt(t){return`~~${t}~~`}function it(t){return`> ${t}`}function nt(t){return`>>> ${t}`}function ot(t){return`<${t}>`}function rt(t,e,i){return i?`[${t}](${e} "${i}")`:`[${t}](${e})`}function at(t){return`||${t}||`}function st(t){return`<@${t}>`}function pt(t){return`<@!${t}>`}function mt(t){return`<#${t}>`}function lt(t){return`<@&${t}>`}function dt(t,e=!1){return`<${e?"a":""}:_:${t}>`}function ct(t,e){return typeof t!="number"&&(t=Math.floor((t?.getTime()??Date.now())/1e3)),typeof e=="string"?`<t:${t}:${e}>`:`<t:${t}>`}var ut={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Ae=(o=>(o.Shrug="\xAF\\_(\u30C4)\\_/\xAF",o.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",o.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",o))(Ae||{});var re={};w(re,{assertReturnOfBuilder:()=>C,validateDefaultPermission:()=>ne,validateDescription:()=>D,validateMaxChoicesLength:()=>oe,validateMaxOptionsLength:()=>d,validateName:()=>U,validateRequired:()=>F,validateRequiredParameters:()=>h});var V=Ze(require("@sindresorhus/is")),v=require("zod");function h(t,e,i){U(t),D(e),d(i)}var ht=v.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function U(t){ht.parse(t)}var Ct=v.z.string().min(1).max(100);function D(t){Ct.parse(t)}var Oe=v.z.boolean();function ne(t){Oe.parse(t)}function F(t){Oe.parse(t)}var Se=v.z.unknown().array().max(25);function d(t){Se.parse(t)}function oe(t){Se.parse(t)}function C(t,e){let i=e.name;if(V.default.nullOrUndefined(t))throw new TypeError(`Expected to receive a ${i} builder, got ${t===null?"null":"undefined"} instead.`);if(V.default.primitive(t))throw new TypeError(`Expected to receive a ${i} builder, got a primitive (${typeof t}) instead.`);if(!(t instanceof e)){let o=t,r=V.default.function_(t)?t.name:o.constructor.name,A=Reflect.get(o,Symbol.toStringTag),R=A?`${r} [${A}]`:r;throw new TypeError(`Expected to receive a ${i} builder, got ${R} instead.`)}}var Fe=require("ts-mixer");var ye=require("discord-api-types/v9");var f=class{constructor(){n(this,"name");n(this,"description")}setName(e){return U(e),Reflect.set(this,"name",e),this}setDescription(e){return D(e),Reflect.set(this,"description",e),this}};var s=class extends f{constructor(){super(...arguments);n(this,"required",!1)}setRequired(e){return F(e),Reflect.set(this,"required",e),this}runRequiredValidations(){h(this.name,this.description,[]),F(this.required)}};var J=class extends s{constructor(){super(...arguments);n(this,"type",ye.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};var ge=require("discord-api-types/v9"),Pe=require("ts-mixer");var l=require("discord-api-types/v9"),ae=require("zod"),ft=[l.ChannelType.GuildText,l.ChannelType.GuildVoice,l.ChannelType.GuildCategory,l.ChannelType.GuildNews,l.ChannelType.GuildStore,l.ChannelType.GuildNewsThread,l.ChannelType.GuildPublicThread,l.ChannelType.GuildPrivateThread,l.ChannelType.GuildStageVoice],bt=ae.z.union(ft.map(t=>ae.z.literal(t))),se=class{constructor(){n(this,"channel_types")}addChannelType(e){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),bt.parse(e),this.channel_types.push(e),this}addChannelTypes(e){return e.forEach(i=>this.addChannelType(i)),this}};var y=class extends s{constructor(){super(...arguments);n(this,"type",ge.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};y=p([(0,Pe.mix)(se)],y);var Re=require("discord-api-types/v9"),Me=require("ts-mixer"),ve=require("zod");var N=class{constructor(){n(this,"maxValue");n(this,"minValue")}};var Te=require("discord-api-types/v9"),g=require("zod");var G=g.z.string().min(1).max(100),Ie=g.z.number().gt(-1/0).lt(1/0),$e=g.z.tuple([G,g.z.union([G,Ie])]).array(),xt=g.z.boolean(),b=class{constructor(){n(this,"choices");n(this,"autocomplete");n(this,"type")}addChoice(e,i){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),oe(this.choices),G.parse(e),this.type===Te.ApplicationCommandOptionType.String?G.parse(i):Ie.parse(i),this.choices.push({name:e,value:i}),this}addChoices(e){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");$e.parse(e);for(let[i,o]of e)this.addChoice(i,o);return this}setChoices(e){if(e.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");$e.parse(e),Reflect.set(this,"choices",[]);for(let[i,o]of e)this.addChoice(i,o);return this}setAutocomplete(e){if(xt.parse(e),e&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return Reflect.set(this,"autocomplete",e),this}};var Ne=ve.z.number().int().nonnegative(),P=class extends s{constructor(){super(...arguments);n(this,"type",Re.ApplicationCommandOptionType.Integer)}setMaxValue(e){return Ne.parse(e),Reflect.set(this,"maxValue",e),this}setMinValue(e){return Ne.parse(e),Reflect.set(this,"minValue",e),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};P=p([(0,Me.mix)(N,b)],P);var Be=require("discord-api-types/v9");var q=class extends s{constructor(){super(...arguments);n(this,"type",Be.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};var we=require("discord-api-types/v9"),Ee=require("ts-mixer"),ke=require("zod");var _e=ke.z.number().nonnegative(),T=class extends s{constructor(){super(...arguments);n(this,"type",we.ApplicationCommandOptionType.Number)}setMaxValue(e){return _e.parse(e),Reflect.set(this,"maxValue",e),this}setMinValue(e){return _e.parse(e),Reflect.set(this,"minValue",e),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};T=p([(0,Ee.mix)(N,b)],T);var Le=require("discord-api-types/v9");var z=class extends s{constructor(){super(...arguments);n(this,"type",Le.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};var Ve=require("discord-api-types/v9"),Ue=require("ts-mixer");var I=class extends s{constructor(){super(...arguments);n(this,"type",Ve.ApplicationCommandOptionType.String)}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};I=p([(0,Ue.mix)(b)],I);var De=require("discord-api-types/v9");var W=class extends s{constructor(){super(...arguments);n(this,"type",De.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};var B=class{constructor(){n(this,"options")}addBooleanOption(e){return this._sharedAddOptionMethod(e,J)}addUserOption(e){return this._sharedAddOptionMethod(e,W)}addChannelOption(e){return this._sharedAddOptionMethod(e,y)}addRoleOption(e){return this._sharedAddOptionMethod(e,z)}addMentionableOption(e){return this._sharedAddOptionMethod(e,q)}addStringOption(e){return this._sharedAddOptionMethod(e,I)}addIntegerOption(e){return this._sharedAddOptionMethod(e,P)}addNumberOption(e){return this._sharedAddOptionMethod(e,T)}_sharedAddOptionMethod(e,i){let{options:o}=this;d(o);let r=typeof e=="function"?e(new i):e;return C(r,i),o.push(r),this}};var pe=require("discord-api-types/v9"),me=require("ts-mixer");var x=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[])}addSubcommand(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new c):e;return C(o,c),i.push(o),this}toJSON(){return h(this.name,this.description,this.options),{type:pe.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};x=p([(0,me.mix)(f)],x);var c=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[])}toJSON(){return h(this.name,this.description,this.options),{type:pe.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};c=p([(0,me.mix)(f,B)],c);var j=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[]);n(this,"defaultPermission")}toJSON(){return h(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(e=>e.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(e){return ne(e),Reflect.set(this,"defaultPermission",e),this}addSubcommandGroup(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new x):e;return C(o,x),i.push(o),this}addSubcommand(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new c):e;return C(o,c),i.push(o),this}};j=p([(0,Fe.mix)(B,f)],j);var ue={};w(ue,{validateDefaultPermission:()=>ce,validateName:()=>Z,validateRequiredParameters:()=>de,validateType:()=>K});var $=require("zod"),le=require("discord-api-types/v9");function de(t,e){Z(t),K(e)}var At=$.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u);function Z(t){At.parse(t)}var Ot=$.z.union([$.z.literal(le.ApplicationCommandType.User),$.z.literal(le.ApplicationCommandType.Message)]);function K(t){Ot.parse(t)}var St=$.z.boolean();function ce(t){St.parse(t)}var Je=class{constructor(){n(this,"name");n(this,"type");n(this,"defaultPermission")}setName(e){return Z(e),Reflect.set(this,"name",e),this}setType(e){return K(e),Reflect.set(this,"type",e),this}setDefaultPermission(e){return ce(e),Reflect.set(this,"defaultPermission",e),this}toJSON(){return de(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};module.exports=Ke(yt);0&&(module.exports={ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SlashCommandAssertions,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,blockQuote,bold,channelMention,codeBlock,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@discordjs/builders", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "A set of builders that you can use when creating your bot", | ||
@@ -59,3 +59,3 @@ "scripts": { | ||
"@sindresorhus/is": "^4.2.0", | ||
"discord-api-types": "^0.25.2", | ||
"discord-api-types": "^0.26.0", | ||
"ts-mixer": "^6.0.0", | ||
@@ -62,0 +62,0 @@ "tslib": "^2.3.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
206655
943
+ Addeddiscord-api-types@0.26.1(transitive)
- Removeddiscord-api-types@0.25.2(transitive)
Updateddiscord-api-types@^0.26.0