@discordjs/builders 0.13.0-dev.1647259738.2297c2b → 0.13.0-dev.1648123730.b520c3d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var j=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var ge=(e,t,n)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var o=(e,t)=>j(e,"name",{value:t,configurable:!0});var R=(e,t)=>{for(var n in t)j(e,n,{get:t[n],enumerable:!0})};var u=(e,t,n,r)=>{for(var p=r>1?void 0:r?ye(t,n):t,T=e.length-1,L;T>=0;T--)(L=e[T])&&(p=(r?L(t,n,p):L(p))||p);return r&&p&&j(t,n,p),p};var i=(e,t,n)=>(ge(e,typeof t!="symbol"?t+"":t,n),n);var Ht={};R(Ht,{RGBPredicate:()=>z,authorNamePredicate:()=>ft,colorPredicate:()=>At,descriptionPredicate:()=>xt,embedFieldPredicate:()=>Kt,embedFieldsArrayPredicate:()=>G,fieldInlinePredicate:()=>Zt,fieldLengthPredicate:()=>Qt,fieldNamePredicate:()=>F,fieldValuePredicate:()=>zt,footerTextPredicate:()=>yt,timestampPredicate:()=>gt,titlePredicate:()=>Ot,urlPredicate:()=>g,validateFieldLength:()=>W});import{z as l}from"zod";var F=l.string().min(1).max(256),zt=l.string().min(1).max(1024),Zt=l.boolean().optional(),Kt=l.object({name:F,value:zt,inline:Zt}),G=Kt.array(),Qt=l.number().lte(25);function W(e,t){Qt.parse((t?.length??0)+e)}o(W,"validateFieldLength");var ft=F.nullable(),g=l.string().url().nullish(),z=l.number().int().gte(0).lte(255),At=l.number().int().gte(0).lte(16777215).nullable().or(l.tuple([z,z,z])),xt=l.string().min(1).max(4096).nullable(),yt=l.string().min(1).max(2048).nullable(),gt=l.union([l.number(),l.date()]).nullable(),Ot=F.nullable();var Z=class{constructor(t={}){i(this,"data");this.data={...t},t.timestamp&&(this.data.timestamp=new Date(t.timestamp).toISOString())}addFields(...t){return this.data.fields?this.data.fields.push(...t):this.data.fields=t,this}spliceFields(t,n,...r){return this.data.fields?this.data.fields.splice(t,n,...r):this.data.fields=r,this}setFields(...t){return this.spliceFields(0,this.data.fields?.length??0,...t),this}setAuthor(t){return t===null?(this.data.author=void 0,this):(this.data.author={name:t.name,url:t.url,icon_url:t.iconURL},this)}setColor(t){if(Array.isArray(t)){let[n,r,p]=t;return this.data.color=(n<<16)+(r<<8)+p,this}return this.data.color=t??void 0,this}setDescription(t){return this.data.description=t??void 0,this}setFooter(t){return t===null?(this.data.footer=void 0,this):(this.data.footer={text:t.text,icon_url:t.iconURL},this)}setImage(t){return this.data.image=t?{url:t}:void 0,this}setThumbnail(t){return this.data.thumbnail=t?{url:t}:void 0,this}setTimestamp(t=Date.now()){return this.data.timestamp=t?new Date(t).toISOString():void 0,this}setTitle(t){return this.data.title=t??void 0,this}setURL(t){return this.data.url=t??void 0,this}toJSON(){return{...this.data}}};o(Z,"UnsafeEmbedBuilder");var Xt=class extends Z{addFields(...t){return W(t.length,this.data.fields),super.addFields(...G.parse(t))}spliceFields(t,n,...r){return W(r.length-n,this.data.fields),super.spliceFields(t,n,...G.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(ft.parse(t.name),g.parse(t.iconURL),g.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(At.parse(t))}setDescription(t){return super.setDescription(xt.parse(t))}setFooter(t){return t===null?super.setFooter(null):(yt.parse(t.text),g.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(g.parse(t))}setThumbnail(t){return super.setThumbnail(g.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(gt.parse(t))}setTitle(t){return super.setTitle(Ot.parse(t))}setURL(t){return super.setURL(g.parse(t))}};o(Xt,"EmbedBuilder");function lo(e,t){return typeof t=="undefined"?`\`\`\`
|
|
2
2
|
${e}\`\`\``:`\`\`\`${e}
|
|
3
|
-
${t}\`\`\``}o(lo,"codeBlock");function uo(e){return`\`${e}\``}o(uo,"inlineCode");function co(e){return`_${e}_`}o(co,"italic");function ho(e){return`**${e}**`}o(ho,"bold");function Co(e){return`__${e}__`}o(Co,"underscore");function bo(e){return`~~${e}~~`}o(bo,"strikethrough");function fo(e){return`> ${e}`}o(fo,"quote");function Ao(e){return`>>> ${e}`}o(Ao,"blockQuote");function xo(e){return`<${e}>`}o(xo,"hideLinkEmbed");function yo(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(yo,"hyperlink");function go(e){return`||${e}||`}o(go,"spoiler");function Oo(e){return`<@${e}>`}o(Oo,"userMention");function So(e){return`<@!${e}>`}o(So,"memberNicknameMention");function Po(e){return`<#${e}>`}o(Po,"channelMention");function Io(e){return`<@&${e}>`}o(Io,"roleMention");function Mo(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Mo,"formatEmoji");function To(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(To,"time");var Ro={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Oe=(r=>(r.Shrug="\xAF\\_(\u30C4)\\_/\xAF",r.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",r.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",r))(Oe||{});var te={};R(te,{buttonLabelValidator:()=>Pt,buttonStyleValidator:()=>It,customIdValidator:()=>c,defaultValidator:()=>Rt,disabledValidator:()=>_,emojiValidator:()=>D,labelValueValidator:()=>J,minMaxValidator:()=>K,optionsValidator:()=>Yt,placeholderValidator:()=>Mt,urlValidator:()=>wt,validateRequiredButtonParameters:()=>vt,validateRequiredSelectMenuOptionParameters:()=>Bt,validateRequiredSelectMenuParameters:()=>Tt});import{ButtonStyle as St}from"discord-api-types/v9";import{z as d}from"zod";var c=d.string().min(1).max(100),D=d.object({id:d.string(),name:d.string(),animated:d.boolean()}).partial().strict(),_=d.boolean(),Pt=d.string().nonempty().max(80),It=d.number().int().min(St.Primary).max(St.Link),Mt=d.string().max(150),K=d.number().int().min(0).max(25),Yt=d.object({}).array().nonempty();function Tt(e,t){c.parse(t),Yt.parse(e)}o(Tt,"validateRequiredSelectMenuParameters");var J=d.string().min(1).max(100),Rt=d.boolean();function Bt(e,t){J.parse(e),J.parse(t)}o(Bt,"validateRequiredSelectMenuOptionParameters");var wt=d.string().url();function vt(e,t,n,r,p){if(p&&r)throw new RangeError("URL and custom id are mutually exclusive");if(!t&&!n)throw new RangeError("Buttons must have a label and/or an emoji");if(e===St.Link){if(!p)throw new RangeError("Link buttons must have a url")}else if(p)throw new RangeError("Non-link buttons cannot have a url")}o(vt,"validateRequiredButtonParameters");import{ComponentType as Se}from"discord-api-types/v9";var h=class{constructor(t){i(this,"data");this.data=t}};o(h,"ComponentBuilder");import{ComponentType as Q}from"discord-api-types/v9";function H(e){if(e instanceof h)return e;switch(e.type){case Q.ActionRow:return new b(e);case Q.Button:return new X(e);case Q.SelectMenu:return new tt(e);case Q.TextInput:return new Y(e);default:throw new Error(`Cannot properly serialize component type: ${e.type}`)}}o(H,"createComponentBuilder");var b=class extends h{constructor({components:t,...n}={}){super({type:Se.ActionRow,...n});i(this,"components");this.components=t?.map(r=>H(r))??[]}addComponents(...t){return this.components.push(...t),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(b,"ActionRowBuilder");import{ComponentType as Pe}from"discord-api-types/v9";var et=class extends h{constructor(t){super({type:Pe.Button,...t})}setStyle(t){return this.data.style=t,this}setURL(t){return this.data.url=t,this}setCustomId(t){return this.data.custom_id=t,this}setEmoji(t){return this.data.emoji=t,this}setDisabled(t=!0){return this.data.disabled=t,this}setLabel(t){return this.data.label=t,this}toJSON(){return{...this.data}}};o(et,"UnsafeButtonBuilder");var X=class extends et{setStyle(t){return super.setStyle(It.parse(t))}setURL(t){return super.setURL(wt.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setEmoji(t){return super.setEmoji(D.parse(t))}setDisabled(t=!0){return super.setDisabled(_.parse(t))}setLabel(t){return super.setLabel(Pt.parse(t))}toJSON(){return vt(this.data.style,this.data.label,this.data.emoji,this.data.custom_id,this.data.url),super.toJSON()}};o(X,"ButtonBuilder");var ne={};R(ne,{labelValidator:()=>oe,maxLengthValidator:()=>Et,minLengthValidator:()=>Nt,placeholderValidator:()=>Lt,requiredValidator:()=>Vt,textInputStyleValidator:()=>ee,validateRequiredParameters:()=>Dt,valueValidator:()=>$t});import{TextInputStyle as Ie}from"discord-api-types/v9";import{z as I}from"zod";var ee=I.nativeEnum(Ie),Nt=I.number().int().min(0).max(4e3),Et=I.number().int().min(1).max(4e3),Vt=I.boolean(),$t=I.string().max(4e3),Lt=I.string().max(100),oe=I.string().min(1).max(45);function Dt(e,t,n){c.parse(e),ee.parse(t),oe.parse(n)}o(Dt,"validateRequiredParameters");import{ComponentType as Me}from"discord-api-types/v9";import ie from"fast-deep-equal";var B=class extends h{constructor(t){super({type:Me.TextInput,...t})}setCustomId(t){return this.data.custom_id=t,this}setLabel(t){return this.data.label=t,this}setStyle(t){return this.data.style=t,this}setMinLength(t){return this.data.min_length=t,this}setMaxLength(t){return this.data.max_length=t,this}setPlaceholder(t){return this.data.placeholder=t,this}setValue(t){return this.data.value=t,this}setRequired(t=!0){return this.data.required=t,this}toJSON(){return{...this.data}}equals(t){return t instanceof B?ie(t.data,this.data):ie(t,this.data)}};o(B,"UnsafeTextInputBuilder");var Y=class extends B{setMinLength(t){return super.setMinLength(Nt.parse(t))}setMaxLength(t){return super.setMaxLength(Et.parse(t))}setRequired(t=!0){return super.setRequired(Vt.parse(t))}setValue(t){return super.setValue($t.parse(t))}setPlaceholder(t){return super.setPlaceholder(Lt.parse(t))}toJSON(){return Dt(this.data.custom_id,this.data.style,this.data.label),super.toJSON()}};o(Y,"TextInputBuilder");var ot=class{constructor({components:t,...n}={}){i(this,"data");i(this,"components",[]);this.data={...n},this.components=t?.map(r=>H(r))??[]}setTitle(t){return this.data.title=t,this}setCustomId(t){return this.data.custom_id=t,this}addComponents(...t){return this.components.push(...t.map(n=>n instanceof b?n:new b(n))),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(ot,"UnsafeModalBuilder");var ae={};R(ae,{componentsValidator:()=>re,titleValidator:()=>nt,validateRequiredParameters:()=>Jt});import{z as _t}from"zod";var nt=_t.string().min(1).max(45),re=_t.array(_t.instanceof(b)).min(1);function Jt(e,t,n){c.parse(e),nt.parse(t),re.parse(n)}o(Jt,"validateRequiredParameters");var se=class extends ot{setCustomId(t){return super.setCustomId(c.parse(t))}setTitle(t){return super.setTitle(nt.parse(t))}toJSON(){return Jt(this.data.custom_id,this.data.title,this.components),super.toJSON()}};o(se,"ModalBuilder");import{ComponentType as Te}from"discord-api-types/v9";var C=class{constructor(t={}){this.data=t}setLabel(t){return this.data.label=t,this}setValue(t){return this.data.value=t,this}setDescription(t){return this.data.description=t,this}setDefault(t=!0){return this.data.default=t,this}setEmoji(t){return this.data.emoji=t,this}toJSON(){return{...this.data}}};o(C,"UnsafeSelectMenuOptionBuilder");var it=class extends h{constructor(t){let{options:n,...r}=t??{};super({type:Te.SelectMenu,...r});i(this,"options");this.options=n?.map(p=>new C(p))??[]}setPlaceholder(t){return this.data.placeholder=t,this}setMinValues(t){return this.data.min_values=t,this}setMaxValues(t){return this.data.max_values=t,this}setCustomId(t){return this.data.custom_id=t,this}setDisabled(t=!0){return this.data.disabled=t,this}addOptions(...t){return this.options.push(...t.map(n=>n instanceof C?n:new C(n))),this}setOptions(...t){return this.options.splice(0,this.options.length,...t.map(n=>n instanceof C?n:new C(n))),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}};o(it,"UnsafeSelectMenuBuilder");var tt=class extends it{setPlaceholder(t){return super.setPlaceholder(Mt.parse(t))}setMinValues(t){return super.setMinValues(K.parse(t))}setMaxValues(t){return super.setMaxValues(K.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setDisabled(t=!0){return super.setDisabled(_.parse(t))}toJSON(){return Tt(this.options,this.data.custom_id),super.toJSON()}};o(tt,"SelectMenuBuilder");var pe=class extends C{setDescription(t){return super.setDescription(J.parse(t))}setDefault(t=!0){return super.setDefault(Rt.parse(t))}setEmoji(t){return super.setEmoji(D.parse(t))}toJSON(){return Bt(this.data.label,this.data.value),super.toJSON()}};o(pe,"SelectMenuOptionBuilder");var le={};R(le,{assertReturnOfBuilder:()=>S,validateChoicesLength:()=>qt,validateDefaultPermission:()=>Ut,validateDescription:()=>at,validateMaxOptionsLength:()=>f,validateName:()=>rt,validateRequired:()=>st,validateRequiredParameters:()=>O});import kt from"@sindresorhus/is";import{z as k}from"zod";var Re=k.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function rt(e){Re.parse(e)}o(rt,"validateName");var Be=k.string().min(1).max(100);function at(e){Be.parse(e)}o(at,"validateDescription");var we=k.unknown().array().max(25);function f(e){we.parse(e)}o(f,"validateMaxOptionsLength");function O(e,t,n){rt(e),at(t),f(n)}o(O,"validateRequiredParameters");var me=k.boolean();function Ut(e){me.parse(e)}o(Ut,"validateDefaultPermission");function st(e){me.parse(e)}o(st,"validateRequired");var ve=k.number().lte(25);function qt(e,t){ve.parse((t?.length??0)+e)}o(qt,"validateChoicesLength");function S(e,t){let n=t.name;if(kt.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(kt.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,p=kt.function_(e)?e.name:r.constructor.name,T=Reflect.get(r,Symbol.toStringTag),L=T?`${p} [${T}]`:p;throw new TypeError(`Expected to receive a ${n} builder, got ${L} instead.`)}}o(S,"assertReturnOfBuilder");import{mix as He}from"ts-mixer";import{ApplicationCommandOptionType as Ne}from"discord-api-types/v9";var A=class{constructor(){i(this,"name");i(this,"description")}setName(t){return rt(t),Reflect.set(this,"name",t),this}setDescription(t){return at(t),Reflect.set(this,"description",t),this}};o(A,"SharedNameAndDescription");var m=class extends A{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return st(t),Reflect.set(this,"required",t),this}runRequiredValidations(){O(this.name,this.description,[]),st(this.required)}};o(m,"ApplicationCommandOptionBase");var pt=class extends m{constructor(){super(...arguments);i(this,"type",Ne.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(pt,"SlashCommandBooleanOption");import{ApplicationCommandOptionType as $e}from"discord-api-types/v9";import{mix as Le}from"ts-mixer";import{ChannelType as x}from"discord-api-types/v9";import{z as jt}from"zod";var Ee=[x.GuildText,x.GuildVoice,x.GuildCategory,x.GuildNews,x.GuildStore,x.GuildNewsThread,x.GuildPublicThread,x.GuildPrivateThread,x.GuildStageVoice],Ve=jt.array(jt.union(Ee.map(e=>jt.literal(e)))),mt=class{constructor(){i(this,"channel_types")}addChannelTypes(...t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Ve.parse(t),this.channel_types.push(...t),this}};o(mt,"ApplicationCommandOptionChannelTypesMixin");var w=class extends m{constructor(){super(...arguments);i(this,"type",$e.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(w,"SlashCommandChannelOption"),w=u([Le(mt)],w);import{ApplicationCommandOptionType as Je}from"discord-api-types/v9";import{mix as ke}from"ts-mixer";import{z as Ue}from"zod";var v=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(v,"ApplicationCommandNumericOptionMinMaxValueMixin");import{ApplicationCommandOptionType as De}from"discord-api-types/v9";import{z as U}from"zod";var Ft=U.string().min(1).max(100),de=U.number().gt(-1/0).lt(1/0),ue=U.object({name:Ft,value:U.union([Ft,de])}).array(),_e=U.boolean(),P=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");ue.parse(t),this.choices===void 0&&Reflect.set(this,"choices",[]),qt(t.length,this.choices);for(let{name:n,value:r}of t)this.type===De.String?Ft.parse(r):de.parse(r),this.choices.push({name:n,value:r});return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return ue.parse(t),Reflect.set(this,"choices",[]),this.addChoices(...t),this}setAutocomplete(t){if(_e.parse(t),t&&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",t),this}};o(P,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var ce=Ue.number().int(),N=class extends m{constructor(){super(...arguments);i(this,"type",Je.Integer)}setMaxValue(t){return ce.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return ce.parse(t),Reflect.set(this,"min_value",t),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}}};o(N,"SlashCommandIntegerOption"),N=u([ke(v,P)],N);import{ApplicationCommandOptionType as qe}from"discord-api-types/v9";var lt=class extends m{constructor(){super(...arguments);i(this,"type",qe.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(lt,"SlashCommandMentionableOption");import{ApplicationCommandOptionType as je}from"discord-api-types/v9";import{mix as Fe}from"ts-mixer";import{z as Ge}from"zod";var he=Ge.number(),E=class extends m{constructor(){super(...arguments);i(this,"type",je.Number)}setMaxValue(t){return he.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return he.parse(t),Reflect.set(this,"min_value",t),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}}};o(E,"SlashCommandNumberOption"),E=u([Fe(v,P)],E);import{ApplicationCommandOptionType as We}from"discord-api-types/v9";var dt=class extends m{constructor(){super(...arguments);i(this,"type",We.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(dt,"SlashCommandRoleOption");import{ApplicationCommandOptionType as ze}from"discord-api-types/v9";var ut=class extends m{constructor(){super(...arguments);i(this,"type",ze.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ut,"SlashCommandAttachmentOption");import{ApplicationCommandOptionType as Ze}from"discord-api-types/v9";import{mix as Ke}from"ts-mixer";var V=class extends m{constructor(){super(...arguments);i(this,"type",Ze.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}}};o(V,"SlashCommandStringOption"),V=u([Ke(P)],V);import{ApplicationCommandOptionType as Qe}from"discord-api-types/v9";var ct=class extends m{constructor(){super(...arguments);i(this,"type",Qe.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ct,"SlashCommandUserOption");var $=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,pt)}addUserOption(t){return this._sharedAddOptionMethod(t,ct)}addChannelOption(t){return this._sharedAddOptionMethod(t,w)}addRoleOption(t){return this._sharedAddOptionMethod(t,dt)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,ut)}addMentionableOption(t){return this._sharedAddOptionMethod(t,lt)}addStringOption(t){return this._sharedAddOptionMethod(t,V)}addIntegerOption(t){return this._sharedAddOptionMethod(t,N)}addNumberOption(t){return this._sharedAddOptionMethod(t,E)}_sharedAddOptionMethod(t,n){let{options:r}=this;f(r);let p=typeof t=="function"?t(new n):t;return S(p,n),r.push(p),this}};o($,"SharedSlashCommandOptions");import{ApplicationCommandOptionType as Ce}from"discord-api-types/v9";import{mix as be}from"ts-mixer";var M=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new y):t;return S(r,y),n.push(r),this}toJSON(){return O(this.name,this.description,this.options),{type:Ce.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(M,"SlashCommandSubcommandGroupBuilder"),M=u([be(A)],M);var y=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return O(this.name,this.description,this.options),{type:Ce.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(y,"SlashCommandSubcommandBuilder"),y=u([be(A,$)],y);var ht=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return O(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(t=>t.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(t){return Ut(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new M):t;return S(r,M),n.push(r),this}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new y):t;return S(r,y),n.push(r),this}};o(ht,"SlashCommandBuilder"),ht=u([He($,A)],ht);var Ae={};R(Ae,{validateDefaultPermission:()=>Gt,validateName:()=>Ct,validateRequiredParameters:()=>Wt,validateType:()=>bt});import{z as q}from"zod";import{ApplicationCommandType as fe}from"discord-api-types/v9";var Xe=q.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),Ye=q.union([q.literal(fe.User),q.literal(fe.Message)]),to=q.boolean();function Gt(e){to.parse(e)}o(Gt,"validateDefaultPermission");function Ct(e){Xe.parse(e)}o(Ct,"validateName");function bt(e){Ye.parse(e)}o(bt,"validateType");function Wt(e,t){Ct(e),bt(t)}o(Wt,"validateRequiredParameters");var xe=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return Ct(t),Reflect.set(this,"name",t),this}setType(t){return bt(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Gt(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Wt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(xe,"ContextMenuCommandBuilder");function Ar(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(Ar,"isJSONEncodable");function yr(e){return e!==null&&typeof e=="object"&&"equals"in e}o(yr,"isEquatable");function Or(e){return(e.title?.length??0)+(e.description?.length??0)+(e.fields?.reduce((t,n)=>t+n.name.length+n.value.length,0)??0)+(e.footer?.text.length??0)+(e.author?.name.length??0)}o(Or,"embedLength");export{b as ActionRowBuilder,X as ButtonBuilder,te as ComponentAssertions,h as ComponentBuilder,Ae as ContextMenuCommandAssertions,xe as ContextMenuCommandBuilder,Ht as EmbedAssertions,Xt as EmbedBuilder,Oe as Faces,ae as ModalAssertions,se as ModalBuilder,tt as SelectMenuBuilder,pe as SelectMenuOptionBuilder,le as SlashCommandAssertions,ut as SlashCommandAttachmentOption,pt as SlashCommandBooleanOption,ht as SlashCommandBuilder,w as SlashCommandChannelOption,N as SlashCommandIntegerOption,lt as SlashCommandMentionableOption,E as SlashCommandNumberOption,dt as SlashCommandRoleOption,V as SlashCommandStringOption,y as SlashCommandSubcommandBuilder,M as SlashCommandSubcommandGroupBuilder,ct as SlashCommandUserOption,ne as TextInputAssertions,Y as TextInputBuilder,Ro as TimestampStyles,et as UnsafeButtonBuilder,Z as UnsafeEmbedBuilder,ot as UnsafeModalBuilder,it as UnsafeSelectMenuBuilder,C as UnsafeSelectMenuOptionBuilder,B as UnsafeTextInputBuilder,Ao as blockQuote,ho as bold,Po as channelMention,lo as codeBlock,H as createComponentBuilder,Or as embedLength,Mo as formatEmoji,xo as hideLinkEmbed,yo as hyperlink,uo as inlineCode,yr as isEquatable,Ar as isJSONEncodable,co as italic,So as memberNicknameMention,fo as quote,Io as roleMention,go as spoiler,bo as strikethrough,To as time,Co as underscore,Oo as userMention};
|
|
3
|
+
${t}\`\`\``}o(lo,"codeBlock");function uo(e){return`\`${e}\``}o(uo,"inlineCode");function co(e){return`_${e}_`}o(co,"italic");function ho(e){return`**${e}**`}o(ho,"bold");function Co(e){return`__${e}__`}o(Co,"underscore");function bo(e){return`~~${e}~~`}o(bo,"strikethrough");function fo(e){return`> ${e}`}o(fo,"quote");function Ao(e){return`>>> ${e}`}o(Ao,"blockQuote");function xo(e){return`<${e}>`}o(xo,"hideLinkEmbed");function yo(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(yo,"hyperlink");function go(e){return`||${e}||`}o(go,"spoiler");function Oo(e){return`<@${e}>`}o(Oo,"userMention");function So(e){return`<@!${e}>`}o(So,"memberNicknameMention");function Po(e){return`<#${e}>`}o(Po,"channelMention");function Io(e){return`<@&${e}>`}o(Io,"roleMention");function Mo(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Mo,"formatEmoji");function To(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(To,"time");var Ro={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Oe=(r=>(r.Shrug="\xAF\\_(\u30C4)\\_/\xAF",r.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",r.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",r))(Oe||{});var te={};R(te,{buttonLabelValidator:()=>Pt,buttonStyleValidator:()=>It,customIdValidator:()=>c,defaultValidator:()=>Rt,disabledValidator:()=>_,emojiValidator:()=>D,labelValueValidator:()=>J,minMaxValidator:()=>K,optionsValidator:()=>Yt,placeholderValidator:()=>Mt,urlValidator:()=>wt,validateRequiredButtonParameters:()=>vt,validateRequiredSelectMenuOptionParameters:()=>Bt,validateRequiredSelectMenuParameters:()=>Tt});import{ButtonStyle as St}from"discord-api-types/v10";import{z as d}from"zod";var c=d.string().min(1).max(100),D=d.object({id:d.string(),name:d.string(),animated:d.boolean()}).partial().strict(),_=d.boolean(),Pt=d.string().nonempty().max(80),It=d.number().int().min(St.Primary).max(St.Link),Mt=d.string().max(150),K=d.number().int().min(0).max(25),Yt=d.object({}).array().nonempty();function Tt(e,t){c.parse(t),Yt.parse(e)}o(Tt,"validateRequiredSelectMenuParameters");var J=d.string().min(1).max(100),Rt=d.boolean();function Bt(e,t){J.parse(e),J.parse(t)}o(Bt,"validateRequiredSelectMenuOptionParameters");var wt=d.string().url();function vt(e,t,n,r,p){if(p&&r)throw new RangeError("URL and custom id are mutually exclusive");if(!t&&!n)throw new RangeError("Buttons must have a label and/or an emoji");if(e===St.Link){if(!p)throw new RangeError("Link buttons must have a url")}else if(p)throw new RangeError("Non-link buttons cannot have a url")}o(vt,"validateRequiredButtonParameters");import{ComponentType as Se}from"discord-api-types/v10";var h=class{constructor(t){i(this,"data");this.data=t}};o(h,"ComponentBuilder");import{ComponentType as Q}from"discord-api-types/v10";function H(e){if(e instanceof h)return e;switch(e.type){case Q.ActionRow:return new b(e);case Q.Button:return new X(e);case Q.SelectMenu:return new tt(e);case Q.TextInput:return new Y(e);default:throw new Error(`Cannot properly serialize component type: ${e.type}`)}}o(H,"createComponentBuilder");var b=class extends h{constructor({components:t,...n}={}){super({type:Se.ActionRow,...n});i(this,"components");this.components=t?.map(r=>H(r))??[]}addComponents(...t){return this.components.push(...t),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(b,"ActionRowBuilder");import{ComponentType as Pe}from"discord-api-types/v10";var et=class extends h{constructor(t){super({type:Pe.Button,...t})}setStyle(t){return this.data.style=t,this}setURL(t){return this.data.url=t,this}setCustomId(t){return this.data.custom_id=t,this}setEmoji(t){return this.data.emoji=t,this}setDisabled(t=!0){return this.data.disabled=t,this}setLabel(t){return this.data.label=t,this}toJSON(){return{...this.data}}};o(et,"UnsafeButtonBuilder");var X=class extends et{setStyle(t){return super.setStyle(It.parse(t))}setURL(t){return super.setURL(wt.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setEmoji(t){return super.setEmoji(D.parse(t))}setDisabled(t=!0){return super.setDisabled(_.parse(t))}setLabel(t){return super.setLabel(Pt.parse(t))}toJSON(){return vt(this.data.style,this.data.label,this.data.emoji,this.data.custom_id,this.data.url),super.toJSON()}};o(X,"ButtonBuilder");var ne={};R(ne,{labelValidator:()=>oe,maxLengthValidator:()=>Et,minLengthValidator:()=>Nt,placeholderValidator:()=>Lt,requiredValidator:()=>Vt,textInputStyleValidator:()=>ee,validateRequiredParameters:()=>Dt,valueValidator:()=>$t});import{TextInputStyle as Ie}from"discord-api-types/v10";import{z as I}from"zod";var ee=I.nativeEnum(Ie),Nt=I.number().int().min(0).max(4e3),Et=I.number().int().min(1).max(4e3),Vt=I.boolean(),$t=I.string().max(4e3),Lt=I.string().max(100),oe=I.string().min(1).max(45);function Dt(e,t,n){c.parse(e),ee.parse(t),oe.parse(n)}o(Dt,"validateRequiredParameters");import{ComponentType as Me}from"discord-api-types/v10";import ie from"fast-deep-equal";var B=class extends h{constructor(t){super({type:Me.TextInput,...t})}setCustomId(t){return this.data.custom_id=t,this}setLabel(t){return this.data.label=t,this}setStyle(t){return this.data.style=t,this}setMinLength(t){return this.data.min_length=t,this}setMaxLength(t){return this.data.max_length=t,this}setPlaceholder(t){return this.data.placeholder=t,this}setValue(t){return this.data.value=t,this}setRequired(t=!0){return this.data.required=t,this}toJSON(){return{...this.data}}equals(t){return t instanceof B?ie(t.data,this.data):ie(t,this.data)}};o(B,"UnsafeTextInputBuilder");var Y=class extends B{setMinLength(t){return super.setMinLength(Nt.parse(t))}setMaxLength(t){return super.setMaxLength(Et.parse(t))}setRequired(t=!0){return super.setRequired(Vt.parse(t))}setValue(t){return super.setValue($t.parse(t))}setPlaceholder(t){return super.setPlaceholder(Lt.parse(t))}toJSON(){return Dt(this.data.custom_id,this.data.style,this.data.label),super.toJSON()}};o(Y,"TextInputBuilder");var ot=class{constructor({components:t,...n}={}){i(this,"data");i(this,"components",[]);this.data={...n},this.components=t?.map(r=>H(r))??[]}setTitle(t){return this.data.title=t,this}setCustomId(t){return this.data.custom_id=t,this}addComponents(...t){return this.components.push(...t.map(n=>n instanceof b?n:new b(n))),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(ot,"UnsafeModalBuilder");var ae={};R(ae,{componentsValidator:()=>re,titleValidator:()=>nt,validateRequiredParameters:()=>Jt});import{z as _t}from"zod";var nt=_t.string().min(1).max(45),re=_t.array(_t.instanceof(b)).min(1);function Jt(e,t,n){c.parse(e),nt.parse(t),re.parse(n)}o(Jt,"validateRequiredParameters");var se=class extends ot{setCustomId(t){return super.setCustomId(c.parse(t))}setTitle(t){return super.setTitle(nt.parse(t))}toJSON(){return Jt(this.data.custom_id,this.data.title,this.components),super.toJSON()}};o(se,"ModalBuilder");import{ComponentType as Te}from"discord-api-types/v10";var C=class{constructor(t={}){this.data=t}setLabel(t){return this.data.label=t,this}setValue(t){return this.data.value=t,this}setDescription(t){return this.data.description=t,this}setDefault(t=!0){return this.data.default=t,this}setEmoji(t){return this.data.emoji=t,this}toJSON(){return{...this.data}}};o(C,"UnsafeSelectMenuOptionBuilder");var it=class extends h{constructor(t){let{options:n,...r}=t??{};super({type:Te.SelectMenu,...r});i(this,"options");this.options=n?.map(p=>new C(p))??[]}setPlaceholder(t){return this.data.placeholder=t,this}setMinValues(t){return this.data.min_values=t,this}setMaxValues(t){return this.data.max_values=t,this}setCustomId(t){return this.data.custom_id=t,this}setDisabled(t=!0){return this.data.disabled=t,this}addOptions(...t){return this.options.push(...t.map(n=>n instanceof C?n:new C(n))),this}setOptions(...t){return this.options.splice(0,this.options.length,...t.map(n=>n instanceof C?n:new C(n))),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}};o(it,"UnsafeSelectMenuBuilder");var tt=class extends it{setPlaceholder(t){return super.setPlaceholder(Mt.parse(t))}setMinValues(t){return super.setMinValues(K.parse(t))}setMaxValues(t){return super.setMaxValues(K.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setDisabled(t=!0){return super.setDisabled(_.parse(t))}toJSON(){return Tt(this.options,this.data.custom_id),super.toJSON()}};o(tt,"SelectMenuBuilder");var pe=class extends C{setDescription(t){return super.setDescription(J.parse(t))}setDefault(t=!0){return super.setDefault(Rt.parse(t))}setEmoji(t){return super.setEmoji(D.parse(t))}toJSON(){return Bt(this.data.label,this.data.value),super.toJSON()}};o(pe,"SelectMenuOptionBuilder");var le={};R(le,{assertReturnOfBuilder:()=>S,validateChoicesLength:()=>qt,validateDefaultPermission:()=>Ut,validateDescription:()=>at,validateMaxOptionsLength:()=>f,validateName:()=>rt,validateRequired:()=>st,validateRequiredParameters:()=>O});import kt from"@sindresorhus/is";import{z as k}from"zod";var Re=k.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function rt(e){Re.parse(e)}o(rt,"validateName");var Be=k.string().min(1).max(100);function at(e){Be.parse(e)}o(at,"validateDescription");var we=k.unknown().array().max(25);function f(e){we.parse(e)}o(f,"validateMaxOptionsLength");function O(e,t,n){rt(e),at(t),f(n)}o(O,"validateRequiredParameters");var me=k.boolean();function Ut(e){me.parse(e)}o(Ut,"validateDefaultPermission");function st(e){me.parse(e)}o(st,"validateRequired");var ve=k.number().lte(25);function qt(e,t){ve.parse((t?.length??0)+e)}o(qt,"validateChoicesLength");function S(e,t){let n=t.name;if(kt.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(kt.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,p=kt.function_(e)?e.name:r.constructor.name,T=Reflect.get(r,Symbol.toStringTag),L=T?`${p} [${T}]`:p;throw new TypeError(`Expected to receive a ${n} builder, got ${L} instead.`)}}o(S,"assertReturnOfBuilder");import{mix as He}from"ts-mixer";import{ApplicationCommandOptionType as Ne}from"discord-api-types/v10";var A=class{constructor(){i(this,"name");i(this,"description")}setName(t){return rt(t),Reflect.set(this,"name",t),this}setDescription(t){return at(t),Reflect.set(this,"description",t),this}};o(A,"SharedNameAndDescription");var m=class extends A{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return st(t),Reflect.set(this,"required",t),this}runRequiredValidations(){O(this.name,this.description,[]),st(this.required)}};o(m,"ApplicationCommandOptionBase");var pt=class extends m{constructor(){super(...arguments);i(this,"type",Ne.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(pt,"SlashCommandBooleanOption");import{ApplicationCommandOptionType as $e}from"discord-api-types/v10";import{mix as Le}from"ts-mixer";import{ChannelType as x}from"discord-api-types/v10";import{z as jt}from"zod";var Ee=[x.GuildText,x.GuildVoice,x.GuildCategory,x.GuildNews,x.GuildStore,x.GuildNewsThread,x.GuildPublicThread,x.GuildPrivateThread,x.GuildStageVoice],Ve=jt.array(jt.union(Ee.map(e=>jt.literal(e)))),mt=class{constructor(){i(this,"channel_types")}addChannelTypes(...t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Ve.parse(t),this.channel_types.push(...t),this}};o(mt,"ApplicationCommandOptionChannelTypesMixin");var w=class extends m{constructor(){super(...arguments);i(this,"type",$e.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(w,"SlashCommandChannelOption"),w=u([Le(mt)],w);import{ApplicationCommandOptionType as Je}from"discord-api-types/v10";import{mix as ke}from"ts-mixer";import{z as Ue}from"zod";var v=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(v,"ApplicationCommandNumericOptionMinMaxValueMixin");import{ApplicationCommandOptionType as De}from"discord-api-types/v10";import{z as U}from"zod";var Ft=U.string().min(1).max(100),de=U.number().gt(-1/0).lt(1/0),ue=U.object({name:Ft,value:U.union([Ft,de])}).array(),_e=U.boolean(),P=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");ue.parse(t),this.choices===void 0&&Reflect.set(this,"choices",[]),qt(t.length,this.choices);for(let{name:n,value:r}of t)this.type===De.String?Ft.parse(r):de.parse(r),this.choices.push({name:n,value:r});return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return ue.parse(t),Reflect.set(this,"choices",[]),this.addChoices(...t),this}setAutocomplete(t){if(_e.parse(t),t&&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",t),this}};o(P,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var ce=Ue.number().int(),N=class extends m{constructor(){super(...arguments);i(this,"type",Je.Integer)}setMaxValue(t){return ce.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return ce.parse(t),Reflect.set(this,"min_value",t),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}}};o(N,"SlashCommandIntegerOption"),N=u([ke(v,P)],N);import{ApplicationCommandOptionType as qe}from"discord-api-types/v10";var lt=class extends m{constructor(){super(...arguments);i(this,"type",qe.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(lt,"SlashCommandMentionableOption");import{ApplicationCommandOptionType as je}from"discord-api-types/v10";import{mix as Fe}from"ts-mixer";import{z as Ge}from"zod";var he=Ge.number(),E=class extends m{constructor(){super(...arguments);i(this,"type",je.Number)}setMaxValue(t){return he.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return he.parse(t),Reflect.set(this,"min_value",t),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}}};o(E,"SlashCommandNumberOption"),E=u([Fe(v,P)],E);import{ApplicationCommandOptionType as We}from"discord-api-types/v10";var dt=class extends m{constructor(){super(...arguments);i(this,"type",We.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(dt,"SlashCommandRoleOption");import{ApplicationCommandOptionType as ze}from"discord-api-types/v10";var ut=class extends m{constructor(){super(...arguments);i(this,"type",ze.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ut,"SlashCommandAttachmentOption");import{ApplicationCommandOptionType as Ze}from"discord-api-types/v10";import{mix as Ke}from"ts-mixer";var V=class extends m{constructor(){super(...arguments);i(this,"type",Ze.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}}};o(V,"SlashCommandStringOption"),V=u([Ke(P)],V);import{ApplicationCommandOptionType as Qe}from"discord-api-types/v10";var ct=class extends m{constructor(){super(...arguments);i(this,"type",Qe.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ct,"SlashCommandUserOption");var $=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,pt)}addUserOption(t){return this._sharedAddOptionMethod(t,ct)}addChannelOption(t){return this._sharedAddOptionMethod(t,w)}addRoleOption(t){return this._sharedAddOptionMethod(t,dt)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,ut)}addMentionableOption(t){return this._sharedAddOptionMethod(t,lt)}addStringOption(t){return this._sharedAddOptionMethod(t,V)}addIntegerOption(t){return this._sharedAddOptionMethod(t,N)}addNumberOption(t){return this._sharedAddOptionMethod(t,E)}_sharedAddOptionMethod(t,n){let{options:r}=this;f(r);let p=typeof t=="function"?t(new n):t;return S(p,n),r.push(p),this}};o($,"SharedSlashCommandOptions");import{ApplicationCommandOptionType as Ce}from"discord-api-types/v10";import{mix as be}from"ts-mixer";var M=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new y):t;return S(r,y),n.push(r),this}toJSON(){return O(this.name,this.description,this.options),{type:Ce.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(M,"SlashCommandSubcommandGroupBuilder"),M=u([be(A)],M);var y=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return O(this.name,this.description,this.options),{type:Ce.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(y,"SlashCommandSubcommandBuilder"),y=u([be(A,$)],y);var ht=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return O(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(t=>t.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(t){return Ut(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new M):t;return S(r,M),n.push(r),this}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new y):t;return S(r,y),n.push(r),this}};o(ht,"SlashCommandBuilder"),ht=u([He($,A)],ht);var Ae={};R(Ae,{validateDefaultPermission:()=>Gt,validateName:()=>Ct,validateRequiredParameters:()=>Wt,validateType:()=>bt});import{z as q}from"zod";import{ApplicationCommandType as fe}from"discord-api-types/v10";var Xe=q.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),Ye=q.union([q.literal(fe.User),q.literal(fe.Message)]),to=q.boolean();function Gt(e){to.parse(e)}o(Gt,"validateDefaultPermission");function Ct(e){Xe.parse(e)}o(Ct,"validateName");function bt(e){Ye.parse(e)}o(bt,"validateType");function Wt(e,t){Ct(e),bt(t)}o(Wt,"validateRequiredParameters");var xe=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return Ct(t),Reflect.set(this,"name",t),this}setType(t){return bt(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Gt(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Wt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(xe,"ContextMenuCommandBuilder");function Ar(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(Ar,"isJSONEncodable");function yr(e){return e!==null&&typeof e=="object"&&"equals"in e}o(yr,"isEquatable");function Or(e){return(e.title?.length??0)+(e.description?.length??0)+(e.fields?.reduce((t,n)=>t+n.name.length+n.value.length,0)??0)+(e.footer?.text.length??0)+(e.author?.name.length??0)}o(Or,"embedLength");export{b as ActionRowBuilder,X as ButtonBuilder,te as ComponentAssertions,h as ComponentBuilder,Ae as ContextMenuCommandAssertions,xe as ContextMenuCommandBuilder,Ht as EmbedAssertions,Xt as EmbedBuilder,Oe as Faces,ae as ModalAssertions,se as ModalBuilder,tt as SelectMenuBuilder,pe as SelectMenuOptionBuilder,le as SlashCommandAssertions,ut as SlashCommandAttachmentOption,pt as SlashCommandBooleanOption,ht as SlashCommandBuilder,w as SlashCommandChannelOption,N as SlashCommandIntegerOption,lt as SlashCommandMentionableOption,E as SlashCommandNumberOption,dt as SlashCommandRoleOption,V as SlashCommandStringOption,y as SlashCommandSubcommandBuilder,M as SlashCommandSubcommandGroupBuilder,ct as SlashCommandUserOption,ne as TextInputAssertions,Y as TextInputBuilder,Ro as TimestampStyles,et as UnsafeButtonBuilder,Z as UnsafeEmbedBuilder,ot as UnsafeModalBuilder,it as UnsafeSelectMenuBuilder,C as UnsafeSelectMenuOptionBuilder,B as UnsafeTextInputBuilder,Ao as blockQuote,ho as bold,Po as channelMention,lo as codeBlock,H as createComponentBuilder,Or as embedLength,Mo as formatEmoji,xo as hideLinkEmbed,yo as hyperlink,uo as inlineCode,yr as isEquatable,Ar as isJSONEncodable,co as italic,So as memberNicknameMention,fo as quote,Io as roleMention,go as spoiler,bo as strikethrough,To as time,Co as underscore,Oo as userMention};
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|