@discordjs/builders 0.13.0-dev.1648123730.b520c3d → 0.13.0-dev.1648515278-ac4bc3a

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.js CHANGED
@@ -1,4 +1,1535 @@
1
- var We=Object.create;var M=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Qe=(e,t,n)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var se=e=>M(e,"__esModule",{value:!0}),o=(e,t)=>M(e,"name",{value:t,configurable:!0});var T=(e,t)=>{for(var n in t)M(e,n,{get:t[n],enumerable:!0})},pe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ze(t))!Ke.call(e,s)&&(n||s!=="default")&&M(e,s,{get:()=>t[s],enumerable:!(r=ae(t,s))||r.enumerable});return e},me=(e,t)=>pe(se(M(e!=null?We(Ze(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),He=(e=>(t,n)=>e&&e.get(t)||(n=pe(se({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0),d=(e,t,n,r)=>{for(var s=r>1?void 0:r?ae(t,n):t,E=e.length-1,J;E>=0;E--)(J=e[E])&&(s=(r?J(t,n,s):J(s))||s);return r&&s&&M(t,n,s),s};var i=(e,t,n)=>(Qe(e,typeof t!="symbol"?t+"":t,n),n);var wo={};T(wo,{ActionRowBuilder:()=>C,ButtonBuilder:()=>W,ComponentAssertions:()=>Lt,ComponentBuilder:()=>u,ContextMenuCommandAssertions:()=>ie,ContextMenuCommandBuilder:()=>re,EmbedAssertions:()=>Mt,EmbedBuilder:()=>Tt,Faces:()=>he,ModalAssertions:()=>Wt,ModalBuilder:()=>zt,SelectMenuBuilder:()=>Z,SelectMenuOptionBuilder:()=>Zt,SlashCommandAssertions:()=>Ht,SlashCommandAttachmentOption:()=>et,SlashCommandBooleanOption:()=>X,SlashCommandBuilder:()=>nt,SlashCommandChannelOption:()=>B,SlashCommandIntegerOption:()=>w,SlashCommandMentionableOption:()=>Y,SlashCommandNumberOption:()=>v,SlashCommandRoleOption:()=>tt,SlashCommandStringOption:()=>N,SlashCommandSubcommandBuilder:()=>f,SlashCommandSubcommandGroupBuilder:()=>I,SlashCommandUserOption:()=>ot,TextInputAssertions:()=>jt,TextInputBuilder:()=>z,TimestampStyles:()=>bo,UnsafeButtonBuilder:()=>K,UnsafeEmbedBuilder:()=>k,UnsafeModalBuilder:()=>Q,UnsafeSelectMenuBuilder:()=>H,UnsafeSelectMenuOptionBuilder:()=>h,UnsafeTextInputBuilder:()=>R,blockQuote:()=>ro,bold:()=>eo,channelMention:()=>uo,codeBlock:()=>Xe,createComponentBuilder:()=>G,embedLength:()=>Bo,formatEmoji:()=>ho,hideLinkEmbed:()=>ao,hyperlink:()=>so,inlineCode:()=>Ye,isEquatable:()=>Ro,isJSONEncodable:()=>To,italic:()=>to,memberNicknameMention:()=>lo,quote:()=>io,roleMention:()=>co,spoiler:()=>po,strikethrough:()=>no,time:()=>Co,underscore:()=>oo,userMention:()=>mo});var Mt={};T(Mt,{RGBPredicate:()=>st,authorNamePredicate:()=>yt,colorPredicate:()=>gt,descriptionPredicate:()=>Ot,embedFieldPredicate:()=>ue,embedFieldsArrayPredicate:()=>rt,fieldInlinePredicate:()=>de,fieldLengthPredicate:()=>ce,fieldNamePredicate:()=>it,fieldValuePredicate:()=>le,footerTextPredicate:()=>St,timestampPredicate:()=>Pt,titlePredicate:()=>It,urlPredicate:()=>y,validateFieldLength:()=>at});var m=require("zod"),it=m.z.string().min(1).max(256),le=m.z.string().min(1).max(1024),de=m.z.boolean().optional(),ue=m.z.object({name:it,value:le,inline:de}),rt=ue.array(),ce=m.z.number().lte(25);function at(e,t){ce.parse((t?.length??0)+e)}o(at,"validateFieldLength");var yt=it.nullable(),y=m.z.string().url().nullish(),st=m.z.number().int().gte(0).lte(255),gt=m.z.number().int().gte(0).lte(16777215).nullable().or(m.z.tuple([st,st,st])),Ot=m.z.string().min(1).max(4096).nullable(),St=m.z.string().min(1).max(2048).nullable(),Pt=m.z.union([m.z.number(),m.z.date()]).nullable(),It=it.nullable();var k=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,s]=t;return this.data.color=(n<<16)+(r<<8)+s,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(k,"UnsafeEmbedBuilder");var Tt=class extends k{addFields(...t){return at(t.length,this.data.fields),super.addFields(...rt.parse(t))}spliceFields(t,n,...r){return at(r.length-n,this.data.fields),super.spliceFields(t,n,...rt.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(yt.parse(t.name),y.parse(t.iconURL),y.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(gt.parse(t))}setDescription(t){return super.setDescription(Ot.parse(t))}setFooter(t){return t===null?super.setFooter(null):(St.parse(t.text),y.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(y.parse(t))}setThumbnail(t){return super.setThumbnail(y.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(Pt.parse(t))}setTitle(t){return super.setTitle(It.parse(t))}setURL(t){return super.setURL(y.parse(t))}};o(Tt,"EmbedBuilder");function Xe(e,t){return typeof t=="undefined"?`\`\`\`
2
- ${e}\`\`\``:`\`\`\`${e}
3
- ${t}\`\`\``}o(Xe,"codeBlock");function Ye(e){return`\`${e}\``}o(Ye,"inlineCode");function to(e){return`_${e}_`}o(to,"italic");function eo(e){return`**${e}**`}o(eo,"bold");function oo(e){return`__${e}__`}o(oo,"underscore");function no(e){return`~~${e}~~`}o(no,"strikethrough");function io(e){return`> ${e}`}o(io,"quote");function ro(e){return`>>> ${e}`}o(ro,"blockQuote");function ao(e){return`<${e}>`}o(ao,"hideLinkEmbed");function so(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(so,"hyperlink");function po(e){return`||${e}||`}o(po,"spoiler");function mo(e){return`<@${e}>`}o(mo,"userMention");function lo(e){return`<@!${e}>`}o(lo,"memberNicknameMention");function uo(e){return`<#${e}>`}o(uo,"channelMention");function co(e){return`<@&${e}>`}o(co,"roleMention");function ho(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(ho,"formatEmoji");function Co(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(Co,"time");var bo={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},he=(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))(he||{});var Lt={};T(Lt,{buttonLabelValidator:()=>Rt,buttonStyleValidator:()=>Bt,customIdValidator:()=>c,defaultValidator:()=>Nt,disabledValidator:()=>q,emojiValidator:()=>U,labelValueValidator:()=>j,minMaxValidator:()=>mt,optionsValidator:()=>Ce,placeholderValidator:()=>wt,urlValidator:()=>Vt,validateRequiredButtonParameters:()=>$t,validateRequiredSelectMenuOptionParameters:()=>Et,validateRequiredSelectMenuParameters:()=>vt});var pt=require("discord-api-types/v10"),l=require("zod"),c=l.z.string().min(1).max(100),U=l.z.object({id:l.z.string(),name:l.z.string(),animated:l.z.boolean()}).partial().strict(),q=l.z.boolean(),Rt=l.z.string().nonempty().max(80),Bt=l.z.number().int().min(pt.ButtonStyle.Primary).max(pt.ButtonStyle.Link),wt=l.z.string().max(150),mt=l.z.number().int().min(0).max(25),Ce=l.z.object({}).array().nonempty();function vt(e,t){c.parse(t),Ce.parse(e)}o(vt,"validateRequiredSelectMenuParameters");var j=l.z.string().min(1).max(100),Nt=l.z.boolean();function Et(e,t){j.parse(e),j.parse(t)}o(Et,"validateRequiredSelectMenuOptionParameters");var Vt=l.z.string().url();function $t(e,t,n,r,s){if(s&&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===pt.ButtonStyle.Link){if(!s)throw new RangeError("Link buttons must have a url")}else if(s)throw new RangeError("Non-link buttons cannot have a url")}o($t,"validateRequiredButtonParameters");var be=require("discord-api-types/v10");var u=class{constructor(t){i(this,"data");this.data=t}};o(u,"ComponentBuilder");var F=require("discord-api-types/v10");function G(e){if(e instanceof u)return e;switch(e.type){case F.ComponentType.ActionRow:return new C(e);case F.ComponentType.Button:return new W(e);case F.ComponentType.SelectMenu:return new Z(e);case F.ComponentType.TextInput:return new z(e);default:throw new Error(`Cannot properly serialize component type: ${e.type}`)}}o(G,"createComponentBuilder");var C=class extends u{constructor({components:t,...n}={}){super({type:be.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>G(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(C,"ActionRowBuilder");var fe=require("discord-api-types/v10");var K=class extends u{constructor(t){super({type:fe.ComponentType.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(K,"UnsafeButtonBuilder");var W=class extends K{setStyle(t){return super.setStyle(Bt.parse(t))}setURL(t){return super.setURL(Vt.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setEmoji(t){return super.setEmoji(U.parse(t))}setDisabled(t=!0){return super.setDisabled(q.parse(t))}setLabel(t){return super.setLabel(Rt.parse(t))}toJSON(){return $t(this.data.style,this.data.label,this.data.emoji,this.data.custom_id,this.data.url),super.toJSON()}};o(W,"ButtonBuilder");var jt={};T(jt,{labelValidator:()=>ye,maxLengthValidator:()=>_t,minLengthValidator:()=>Dt,placeholderValidator:()=>Ut,requiredValidator:()=>Jt,textInputStyleValidator:()=>xe,validateRequiredParameters:()=>qt,valueValidator:()=>kt});var Ae=require("discord-api-types/v10"),g=require("zod");var xe=g.z.nativeEnum(Ae.TextInputStyle),Dt=g.z.number().int().min(0).max(4e3),_t=g.z.number().int().min(1).max(4e3),Jt=g.z.boolean(),kt=g.z.string().max(4e3),Ut=g.z.string().max(100),ye=g.z.string().min(1).max(45);function qt(e,t,n){c.parse(e),xe.parse(t),ye.parse(n)}o(qt,"validateRequiredParameters");var ge=require("discord-api-types/v10");var Ft=me(require("fast-deep-equal")),R=class extends u{constructor(t){super({type:ge.ComponentType.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 R?(0,Ft.default)(t.data,this.data):(0,Ft.default)(t,this.data)}};o(R,"UnsafeTextInputBuilder");var z=class extends R{setMinLength(t){return super.setMinLength(Dt.parse(t))}setMaxLength(t){return super.setMaxLength(_t.parse(t))}setRequired(t=!0){return super.setRequired(Jt.parse(t))}setValue(t){return super.setValue(kt.parse(t))}setPlaceholder(t){return super.setPlaceholder(Ut.parse(t))}toJSON(){return qt(this.data.custom_id,this.data.style,this.data.label),super.toJSON()}};o(z,"TextInputBuilder");var Q=class{constructor({components:t,...n}={}){i(this,"data");i(this,"components",[]);this.data={...n},this.components=t?.map(r=>G(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 C?n:new C(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(Q,"UnsafeModalBuilder");var Wt={};T(Wt,{componentsValidator:()=>Oe,titleValidator:()=>dt,validateRequiredParameters:()=>Gt});var lt=require("zod");var dt=lt.z.string().min(1).max(45),Oe=lt.z.array(lt.z.instanceof(C)).min(1);function Gt(e,t,n){c.parse(e),dt.parse(t),Oe.parse(n)}o(Gt,"validateRequiredParameters");var zt=class extends Q{setCustomId(t){return super.setCustomId(c.parse(t))}setTitle(t){return super.setTitle(dt.parse(t))}toJSON(){return Gt(this.data.custom_id,this.data.title,this.components),super.toJSON()}};o(zt,"ModalBuilder");var Se=require("discord-api-types/v10");var h=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(h,"UnsafeSelectMenuOptionBuilder");var H=class extends u{constructor(t){let{options:n,...r}=t??{};super({type:Se.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new h(s))??[]}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 h?n:new h(n))),this}setOptions(...t){return this.options.splice(0,this.options.length,...t.map(n=>n instanceof h?n:new h(n))),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}};o(H,"UnsafeSelectMenuBuilder");var Z=class extends H{setPlaceholder(t){return super.setPlaceholder(wt.parse(t))}setMinValues(t){return super.setMinValues(mt.parse(t))}setMaxValues(t){return super.setMaxValues(mt.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setDisabled(t=!0){return super.setDisabled(q.parse(t))}toJSON(){return vt(this.options,this.data.custom_id),super.toJSON()}};o(Z,"SelectMenuBuilder");var Zt=class extends h{setDescription(t){return super.setDescription(j.parse(t))}setDefault(t=!0){return super.setDefault(Nt.parse(t))}setEmoji(t){return super.setEmoji(U.parse(t))}toJSON(){return Et(this.data.label,this.data.value),super.toJSON()}};o(Zt,"SelectMenuOptionBuilder");var Ht={};T(Ht,{assertReturnOfBuilder:()=>S,validateChoicesLength:()=>Qt,validateDefaultPermission:()=>Kt,validateDescription:()=>ht,validateMaxOptionsLength:()=>A,validateName:()=>ct,validateRequired:()=>Ct,validateRequiredParameters:()=>O});var ut=me(require("@sindresorhus/is")),V=require("zod"),fo=V.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function ct(e){fo.parse(e)}o(ct,"validateName");var Ao=V.z.string().min(1).max(100);function ht(e){Ao.parse(e)}o(ht,"validateDescription");var xo=V.z.unknown().array().max(25);function A(e){xo.parse(e)}o(A,"validateMaxOptionsLength");function O(e,t,n){ct(e),ht(t),A(n)}o(O,"validateRequiredParameters");var Pe=V.z.boolean();function Kt(e){Pe.parse(e)}o(Kt,"validateDefaultPermission");function Ct(e){Pe.parse(e)}o(Ct,"validateRequired");var yo=V.z.number().lte(25);function Qt(e,t){yo.parse((t?.length??0)+e)}o(Qt,"validateChoicesLength");function S(e,t){let n=t.name;if(ut.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(ut.default.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,s=ut.default.function_(e)?e.name:r.constructor.name,E=Reflect.get(r,Symbol.toStringTag),J=E?`${s} [${E}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${J} instead.`)}}o(S,"assertReturnOfBuilder");var Ge=require("ts-mixer");var Ie=require("discord-api-types/v10");var x=class{constructor(){i(this,"name");i(this,"description")}setName(t){return ct(t),Reflect.set(this,"name",t),this}setDescription(t){return ht(t),Reflect.set(this,"description",t),this}};o(x,"SharedNameAndDescription");var p=class extends x{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return Ct(t),Reflect.set(this,"required",t),this}runRequiredValidations(){O(this.name,this.description,[]),Ct(this.required)}};o(p,"ApplicationCommandOptionBase");var X=class extends p{constructor(){super(...arguments);i(this,"type",Ie.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(X,"SlashCommandBooleanOption");var Me=require("discord-api-types/v10"),Te=require("ts-mixer");var b=require("discord-api-types/v10"),bt=require("zod"),go=[b.ChannelType.GuildText,b.ChannelType.GuildVoice,b.ChannelType.GuildCategory,b.ChannelType.GuildNews,b.ChannelType.GuildStore,b.ChannelType.GuildNewsThread,b.ChannelType.GuildPublicThread,b.ChannelType.GuildPrivateThread,b.ChannelType.GuildStageVoice],Oo=bt.z.array(bt.z.union(go.map(e=>bt.z.literal(e)))),ft=class{constructor(){i(this,"channel_types")}addChannelTypes(...t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Oo.parse(t),this.channel_types.push(...t),this}};o(ft,"ApplicationCommandOptionChannelTypesMixin");var B=class extends p{constructor(){super(...arguments);i(this,"type",Me.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(B,"SlashCommandChannelOption"),B=d([(0,Te.mix)(ft)],B);var ve=require("discord-api-types/v10"),Ne=require("ts-mixer"),Ee=require("zod");var $=class{constructor(){i(this,"max_value");i(this,"min_value")}};o($,"ApplicationCommandNumericOptionMinMaxValueMixin");var Re=require("discord-api-types/v10"),L=require("zod");var Xt=L.z.string().min(1).max(100),Be=L.z.number().gt(-1/0).lt(1/0),we=L.z.object({name:Xt,value:L.z.union([Xt,Be])}).array(),So=L.z.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.");we.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===Re.ApplicationCommandOptionType.String?Xt.parse(r):Be.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 we.parse(t),Reflect.set(this,"choices",[]),this.addChoices(...t),this}setAutocomplete(t){if(So.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 Ve=Ee.z.number().int(),w=class extends p{constructor(){super(...arguments);i(this,"type",ve.ApplicationCommandOptionType.Integer)}setMaxValue(t){return Ve.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return Ve.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(w,"SlashCommandIntegerOption"),w=d([(0,Ne.mix)($,P)],w);var $e=require("discord-api-types/v10");var Y=class extends p{constructor(){super(...arguments);i(this,"type",$e.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Y,"SlashCommandMentionableOption");var Le=require("discord-api-types/v10"),De=require("ts-mixer"),_e=require("zod");var Je=_e.z.number(),v=class extends p{constructor(){super(...arguments);i(this,"type",Le.ApplicationCommandOptionType.Number)}setMaxValue(t){return Je.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return Je.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(v,"SlashCommandNumberOption"),v=d([(0,De.mix)($,P)],v);var ke=require("discord-api-types/v10");var tt=class extends p{constructor(){super(...arguments);i(this,"type",ke.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(tt,"SlashCommandRoleOption");var Ue=require("discord-api-types/v10");var et=class extends p{constructor(){super(...arguments);i(this,"type",Ue.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(et,"SlashCommandAttachmentOption");var qe=require("discord-api-types/v10"),je=require("ts-mixer");var N=class extends p{constructor(){super(...arguments);i(this,"type",qe.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}}};o(N,"SlashCommandStringOption"),N=d([(0,je.mix)(P)],N);var Fe=require("discord-api-types/v10");var ot=class extends p{constructor(){super(...arguments);i(this,"type",Fe.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ot,"SlashCommandUserOption");var D=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,X)}addUserOption(t){return this._sharedAddOptionMethod(t,ot)}addChannelOption(t){return this._sharedAddOptionMethod(t,B)}addRoleOption(t){return this._sharedAddOptionMethod(t,tt)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,et)}addMentionableOption(t){return this._sharedAddOptionMethod(t,Y)}addStringOption(t){return this._sharedAddOptionMethod(t,N)}addIntegerOption(t){return this._sharedAddOptionMethod(t,w)}addNumberOption(t){return this._sharedAddOptionMethod(t,v)}_sharedAddOptionMethod(t,n){let{options:r}=this;A(r);let s=typeof t=="function"?t(new n):t;return S(s,n),r.push(s),this}};o(D,"SharedSlashCommandOptions");var Yt=require("discord-api-types/v10"),te=require("ts-mixer");var I=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;A(n);let r=typeof t=="function"?t(new f):t;return S(r,f),n.push(r),this}toJSON(){return O(this.name,this.description,this.options),{type:Yt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(I,"SlashCommandSubcommandGroupBuilder"),I=d([(0,te.mix)(x)],I);var f=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return O(this.name,this.description,this.options),{type:Yt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(f,"SlashCommandSubcommandBuilder"),f=d([(0,te.mix)(x,D)],f);var nt=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 Kt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;A(n);let r=typeof t=="function"?t(new I):t;return S(r,I),n.push(r),this}addSubcommand(t){let{options:n}=this;A(n);let r=typeof t=="function"?t(new f):t;return S(r,f),n.push(r),this}};o(nt,"SlashCommandBuilder"),nt=d([(0,Ge.mix)(D,x)],nt);var ie={};T(ie,{validateDefaultPermission:()=>oe,validateName:()=>At,validateRequiredParameters:()=>ne,validateType:()=>xt});var _=require("zod"),ee=require("discord-api-types/v10"),Po=_.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),Io=_.z.union([_.z.literal(ee.ApplicationCommandType.User),_.z.literal(ee.ApplicationCommandType.Message)]),Mo=_.z.boolean();function oe(e){Mo.parse(e)}o(oe,"validateDefaultPermission");function At(e){Po.parse(e)}o(At,"validateName");function xt(e){Io.parse(e)}o(xt,"validateType");function ne(e,t){At(e),xt(t)}o(ne,"validateRequiredParameters");var re=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return At(t),Reflect.set(this,"name",t),this}setType(t){return xt(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return oe(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return ne(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(re,"ContextMenuCommandBuilder");function To(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(To,"isJSONEncodable");function Ro(e){return e!==null&&typeof e=="object"&&"equals"in e}o(Ro,"isEquatable");function Bo(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(Bo,"embedLength");module.exports=He(wo);0&&(module.exports={ActionRowBuilder,ButtonBuilder,ComponentAssertions,ComponentBuilder,ContextMenuCommandAssertions,ContextMenuCommandBuilder,EmbedAssertions,EmbedBuilder,Faces,ModalAssertions,ModalBuilder,SelectMenuBuilder,SelectMenuOptionBuilder,SlashCommandAssertions,SlashCommandAttachmentOption,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TextInputAssertions,TextInputBuilder,TimestampStyles,UnsafeButtonBuilder,UnsafeEmbedBuilder,UnsafeModalBuilder,UnsafeSelectMenuBuilder,UnsafeSelectMenuOptionBuilder,UnsafeTextInputBuilder,blockQuote,bold,channelMention,codeBlock,createComponentBuilder,embedLength,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,isEquatable,isJSONEncodable,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
10
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __reExport = (target, module2, copyDefault, desc) => {
16
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
17
+ for (let key of __getOwnPropNames(module2))
18
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
19
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
20
+ }
21
+ return target;
22
+ };
23
+ var __toESM = (module2, isNodeMode) => {
24
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
25
+ };
26
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
27
+ return (module2, temp) => {
28
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
29
+ };
30
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
31
+ var __decorateClass = (decorators, target, key, kind) => {
32
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
33
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
34
+ if (decorator = decorators[i])
35
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
36
+ if (kind && result)
37
+ __defProp(target, key, result);
38
+ return result;
39
+ };
40
+ var __publicField = (obj, key, value) => {
41
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
42
+ return value;
43
+ };
44
+
45
+ // src/index.ts
46
+ var src_exports = {};
47
+ __export(src_exports, {
48
+ ActionRowBuilder: () => ActionRowBuilder,
49
+ ButtonBuilder: () => ButtonBuilder,
50
+ ComponentAssertions: () => Assertions_exports2,
51
+ ComponentBuilder: () => ComponentBuilder,
52
+ ContextMenuCommandAssertions: () => Assertions_exports6,
53
+ ContextMenuCommandBuilder: () => ContextMenuCommandBuilder,
54
+ EmbedAssertions: () => Assertions_exports,
55
+ EmbedBuilder: () => EmbedBuilder,
56
+ Faces: () => Faces,
57
+ ModalAssertions: () => Assertions_exports4,
58
+ ModalBuilder: () => ModalBuilder,
59
+ SelectMenuBuilder: () => SelectMenuBuilder,
60
+ SelectMenuOptionBuilder: () => SelectMenuOptionBuilder,
61
+ SlashCommandAssertions: () => Assertions_exports5,
62
+ SlashCommandAttachmentOption: () => SlashCommandAttachmentOption,
63
+ SlashCommandBooleanOption: () => SlashCommandBooleanOption,
64
+ SlashCommandBuilder: () => SlashCommandBuilder,
65
+ SlashCommandChannelOption: () => SlashCommandChannelOption,
66
+ SlashCommandIntegerOption: () => SlashCommandIntegerOption,
67
+ SlashCommandMentionableOption: () => SlashCommandMentionableOption,
68
+ SlashCommandNumberOption: () => SlashCommandNumberOption,
69
+ SlashCommandRoleOption: () => SlashCommandRoleOption,
70
+ SlashCommandStringOption: () => SlashCommandStringOption,
71
+ SlashCommandSubcommandBuilder: () => SlashCommandSubcommandBuilder,
72
+ SlashCommandSubcommandGroupBuilder: () => SlashCommandSubcommandGroupBuilder,
73
+ SlashCommandUserOption: () => SlashCommandUserOption,
74
+ TextInputAssertions: () => Assertions_exports3,
75
+ TextInputBuilder: () => TextInputBuilder,
76
+ TimestampStyles: () => TimestampStyles,
77
+ UnsafeButtonBuilder: () => UnsafeButtonBuilder,
78
+ UnsafeEmbedBuilder: () => UnsafeEmbedBuilder,
79
+ UnsafeModalBuilder: () => UnsafeModalBuilder,
80
+ UnsafeSelectMenuBuilder: () => UnsafeSelectMenuBuilder,
81
+ UnsafeSelectMenuOptionBuilder: () => UnsafeSelectMenuOptionBuilder,
82
+ UnsafeTextInputBuilder: () => UnsafeTextInputBuilder,
83
+ blockQuote: () => blockQuote,
84
+ bold: () => bold,
85
+ channelMention: () => channelMention,
86
+ codeBlock: () => codeBlock,
87
+ createComponentBuilder: () => createComponentBuilder,
88
+ embedLength: () => embedLength,
89
+ formatEmoji: () => formatEmoji,
90
+ hideLinkEmbed: () => hideLinkEmbed,
91
+ hyperlink: () => hyperlink,
92
+ inlineCode: () => inlineCode,
93
+ isEquatable: () => isEquatable,
94
+ isJSONEncodable: () => isJSONEncodable,
95
+ italic: () => italic,
96
+ memberNicknameMention: () => memberNicknameMention,
97
+ quote: () => quote,
98
+ roleMention: () => roleMention,
99
+ spoiler: () => spoiler,
100
+ strikethrough: () => strikethrough,
101
+ time: () => time,
102
+ underscore: () => underscore,
103
+ userMention: () => userMention
104
+ });
105
+
106
+ // src/messages/embed/Assertions.ts
107
+ var Assertions_exports = {};
108
+ __export(Assertions_exports, {
109
+ RGBPredicate: () => RGBPredicate,
110
+ authorNamePredicate: () => authorNamePredicate,
111
+ colorPredicate: () => colorPredicate,
112
+ descriptionPredicate: () => descriptionPredicate,
113
+ embedFieldPredicate: () => embedFieldPredicate,
114
+ embedFieldsArrayPredicate: () => embedFieldsArrayPredicate,
115
+ fieldInlinePredicate: () => fieldInlinePredicate,
116
+ fieldLengthPredicate: () => fieldLengthPredicate,
117
+ fieldNamePredicate: () => fieldNamePredicate,
118
+ fieldValuePredicate: () => fieldValuePredicate,
119
+ footerTextPredicate: () => footerTextPredicate,
120
+ timestampPredicate: () => timestampPredicate,
121
+ titlePredicate: () => titlePredicate,
122
+ urlPredicate: () => urlPredicate,
123
+ validateFieldLength: () => validateFieldLength
124
+ });
125
+ var import_zod = require("zod");
126
+ var fieldNamePredicate = import_zod.z.string().min(1).max(256);
127
+ var fieldValuePredicate = import_zod.z.string().min(1).max(1024);
128
+ var fieldInlinePredicate = import_zod.z.boolean().optional();
129
+ var embedFieldPredicate = import_zod.z.object({
130
+ name: fieldNamePredicate,
131
+ value: fieldValuePredicate,
132
+ inline: fieldInlinePredicate
133
+ });
134
+ var embedFieldsArrayPredicate = embedFieldPredicate.array();
135
+ var fieldLengthPredicate = import_zod.z.number().lte(25);
136
+ function validateFieldLength(amountAdding, fields) {
137
+ fieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);
138
+ }
139
+ __name(validateFieldLength, "validateFieldLength");
140
+ var authorNamePredicate = fieldNamePredicate.nullable();
141
+ var urlPredicate = import_zod.z.string().url().nullish();
142
+ var RGBPredicate = import_zod.z.number().int().gte(0).lte(255);
143
+ var colorPredicate = import_zod.z.number().int().gte(0).lte(16777215).nullable().or(import_zod.z.tuple([RGBPredicate, RGBPredicate, RGBPredicate]));
144
+ var descriptionPredicate = import_zod.z.string().min(1).max(4096).nullable();
145
+ var footerTextPredicate = import_zod.z.string().min(1).max(2048).nullable();
146
+ var timestampPredicate = import_zod.z.union([import_zod.z.number(), import_zod.z.date()]).nullable();
147
+ var titlePredicate = fieldNamePredicate.nullable();
148
+
149
+ // src/messages/embed/UnsafeEmbed.ts
150
+ var UnsafeEmbedBuilder = class {
151
+ constructor(data = {}) {
152
+ __publicField(this, "data");
153
+ this.data = { ...data };
154
+ if (data.timestamp)
155
+ this.data.timestamp = new Date(data.timestamp).toISOString();
156
+ }
157
+ addFields(...fields) {
158
+ if (this.data.fields)
159
+ this.data.fields.push(...fields);
160
+ else
161
+ this.data.fields = fields;
162
+ return this;
163
+ }
164
+ spliceFields(index, deleteCount, ...fields) {
165
+ if (this.data.fields)
166
+ this.data.fields.splice(index, deleteCount, ...fields);
167
+ else
168
+ this.data.fields = fields;
169
+ return this;
170
+ }
171
+ setFields(...fields) {
172
+ this.spliceFields(0, this.data.fields?.length ?? 0, ...fields);
173
+ return this;
174
+ }
175
+ setAuthor(options) {
176
+ if (options === null) {
177
+ this.data.author = void 0;
178
+ return this;
179
+ }
180
+ this.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };
181
+ return this;
182
+ }
183
+ setColor(color) {
184
+ if (Array.isArray(color)) {
185
+ const [red, green, blue] = color;
186
+ this.data.color = (red << 16) + (green << 8) + blue;
187
+ return this;
188
+ }
189
+ this.data.color = color ?? void 0;
190
+ return this;
191
+ }
192
+ setDescription(description) {
193
+ this.data.description = description ?? void 0;
194
+ return this;
195
+ }
196
+ setFooter(options) {
197
+ if (options === null) {
198
+ this.data.footer = void 0;
199
+ return this;
200
+ }
201
+ this.data.footer = { text: options.text, icon_url: options.iconURL };
202
+ return this;
203
+ }
204
+ setImage(url) {
205
+ this.data.image = url ? { url } : void 0;
206
+ return this;
207
+ }
208
+ setThumbnail(url) {
209
+ this.data.thumbnail = url ? { url } : void 0;
210
+ return this;
211
+ }
212
+ setTimestamp(timestamp = Date.now()) {
213
+ this.data.timestamp = timestamp ? new Date(timestamp).toISOString() : void 0;
214
+ return this;
215
+ }
216
+ setTitle(title) {
217
+ this.data.title = title ?? void 0;
218
+ return this;
219
+ }
220
+ setURL(url) {
221
+ this.data.url = url ?? void 0;
222
+ return this;
223
+ }
224
+ toJSON() {
225
+ return { ...this.data };
226
+ }
227
+ };
228
+ __name(UnsafeEmbedBuilder, "UnsafeEmbedBuilder");
229
+
230
+ // src/messages/embed/Embed.ts
231
+ var EmbedBuilder = class extends UnsafeEmbedBuilder {
232
+ addFields(...fields) {
233
+ validateFieldLength(fields.length, this.data.fields);
234
+ return super.addFields(...embedFieldsArrayPredicate.parse(fields));
235
+ }
236
+ spliceFields(index, deleteCount, ...fields) {
237
+ validateFieldLength(fields.length - deleteCount, this.data.fields);
238
+ return super.spliceFields(index, deleteCount, ...embedFieldsArrayPredicate.parse(fields));
239
+ }
240
+ setAuthor(options) {
241
+ if (options === null) {
242
+ return super.setAuthor(null);
243
+ }
244
+ authorNamePredicate.parse(options.name);
245
+ urlPredicate.parse(options.iconURL);
246
+ urlPredicate.parse(options.url);
247
+ return super.setAuthor(options);
248
+ }
249
+ setColor(color) {
250
+ return super.setColor(colorPredicate.parse(color));
251
+ }
252
+ setDescription(description) {
253
+ return super.setDescription(descriptionPredicate.parse(description));
254
+ }
255
+ setFooter(options) {
256
+ if (options === null) {
257
+ return super.setFooter(null);
258
+ }
259
+ footerTextPredicate.parse(options.text);
260
+ urlPredicate.parse(options.iconURL);
261
+ return super.setFooter(options);
262
+ }
263
+ setImage(url) {
264
+ return super.setImage(urlPredicate.parse(url));
265
+ }
266
+ setThumbnail(url) {
267
+ return super.setThumbnail(urlPredicate.parse(url));
268
+ }
269
+ setTimestamp(timestamp = Date.now()) {
270
+ return super.setTimestamp(timestampPredicate.parse(timestamp));
271
+ }
272
+ setTitle(title) {
273
+ return super.setTitle(titlePredicate.parse(title));
274
+ }
275
+ setURL(url) {
276
+ return super.setURL(urlPredicate.parse(url));
277
+ }
278
+ };
279
+ __name(EmbedBuilder, "EmbedBuilder");
280
+
281
+ // src/messages/formatters.ts
282
+ function codeBlock(language, content) {
283
+ return typeof content === "undefined" ? `\`\`\`
284
+ ${language}\`\`\`` : `\`\`\`${language}
285
+ ${content}\`\`\``;
286
+ }
287
+ __name(codeBlock, "codeBlock");
288
+ function inlineCode(content) {
289
+ return `\`${content}\``;
290
+ }
291
+ __name(inlineCode, "inlineCode");
292
+ function italic(content) {
293
+ return `_${content}_`;
294
+ }
295
+ __name(italic, "italic");
296
+ function bold(content) {
297
+ return `**${content}**`;
298
+ }
299
+ __name(bold, "bold");
300
+ function underscore(content) {
301
+ return `__${content}__`;
302
+ }
303
+ __name(underscore, "underscore");
304
+ function strikethrough(content) {
305
+ return `~~${content}~~`;
306
+ }
307
+ __name(strikethrough, "strikethrough");
308
+ function quote(content) {
309
+ return `> ${content}`;
310
+ }
311
+ __name(quote, "quote");
312
+ function blockQuote(content) {
313
+ return `>>> ${content}`;
314
+ }
315
+ __name(blockQuote, "blockQuote");
316
+ function hideLinkEmbed(url) {
317
+ return `<${url}>`;
318
+ }
319
+ __name(hideLinkEmbed, "hideLinkEmbed");
320
+ function hyperlink(content, url, title) {
321
+ return title ? `[${content}](${url} "${title}")` : `[${content}](${url})`;
322
+ }
323
+ __name(hyperlink, "hyperlink");
324
+ function spoiler(content) {
325
+ return `||${content}||`;
326
+ }
327
+ __name(spoiler, "spoiler");
328
+ function userMention(userId) {
329
+ return `<@${userId}>`;
330
+ }
331
+ __name(userMention, "userMention");
332
+ function memberNicknameMention(memberId) {
333
+ return `<@!${memberId}>`;
334
+ }
335
+ __name(memberNicknameMention, "memberNicknameMention");
336
+ function channelMention(channelId) {
337
+ return `<#${channelId}>`;
338
+ }
339
+ __name(channelMention, "channelMention");
340
+ function roleMention(roleId) {
341
+ return `<@&${roleId}>`;
342
+ }
343
+ __name(roleMention, "roleMention");
344
+ function formatEmoji(emojiId, animated = false) {
345
+ return `<${animated ? "a" : ""}:_:${emojiId}>`;
346
+ }
347
+ __name(formatEmoji, "formatEmoji");
348
+ function time(timeOrSeconds, style) {
349
+ if (typeof timeOrSeconds !== "number") {
350
+ timeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1e3);
351
+ }
352
+ return typeof style === "string" ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;
353
+ }
354
+ __name(time, "time");
355
+ var TimestampStyles = {
356
+ ShortTime: "t",
357
+ LongTime: "T",
358
+ ShortDate: "d",
359
+ LongDate: "D",
360
+ ShortDateTime: "f",
361
+ LongDateTime: "F",
362
+ RelativeTime: "R"
363
+ };
364
+ var Faces = /* @__PURE__ */ ((Faces2) => {
365
+ Faces2["Shrug"] = "\xAF\\_(\u30C4)\\_/\xAF";
366
+ Faces2["Tableflip"] = "(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B";
367
+ Faces2["Unflip"] = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)";
368
+ return Faces2;
369
+ })(Faces || {});
370
+
371
+ // src/components/Assertions.ts
372
+ var Assertions_exports2 = {};
373
+ __export(Assertions_exports2, {
374
+ buttonLabelValidator: () => buttonLabelValidator,
375
+ buttonStyleValidator: () => buttonStyleValidator,
376
+ customIdValidator: () => customIdValidator,
377
+ defaultValidator: () => defaultValidator,
378
+ disabledValidator: () => disabledValidator,
379
+ emojiValidator: () => emojiValidator,
380
+ labelValueDescriptionValidator: () => labelValueDescriptionValidator,
381
+ labelValueValidator: () => labelValueValidator,
382
+ minMaxValidator: () => minMaxValidator,
383
+ optionValidator: () => optionValidator,
384
+ optionsLengthValidator: () => optionsLengthValidator,
385
+ optionsValidator: () => optionsValidator,
386
+ placeholderValidator: () => placeholderValidator,
387
+ urlValidator: () => urlValidator,
388
+ validateRequiredButtonParameters: () => validateRequiredButtonParameters,
389
+ validateRequiredSelectMenuOptionParameters: () => validateRequiredSelectMenuOptionParameters,
390
+ validateRequiredSelectMenuParameters: () => validateRequiredSelectMenuParameters
391
+ });
392
+ var import_v10 = require("discord-api-types/v10");
393
+ var import_zod2 = require("zod");
394
+
395
+ // src/components/selectMenu/UnsafeSelectMenuOption.ts
396
+ var UnsafeSelectMenuOptionBuilder = class {
397
+ constructor(data = {}) {
398
+ this.data = data;
399
+ }
400
+ setLabel(label) {
401
+ this.data.label = label;
402
+ return this;
403
+ }
404
+ setValue(value) {
405
+ this.data.value = value;
406
+ return this;
407
+ }
408
+ setDescription(description) {
409
+ this.data.description = description;
410
+ return this;
411
+ }
412
+ setDefault(isDefault = true) {
413
+ this.data.default = isDefault;
414
+ return this;
415
+ }
416
+ setEmoji(emoji) {
417
+ this.data.emoji = emoji;
418
+ return this;
419
+ }
420
+ toJSON() {
421
+ return {
422
+ ...this.data
423
+ };
424
+ }
425
+ };
426
+ __name(UnsafeSelectMenuOptionBuilder, "UnsafeSelectMenuOptionBuilder");
427
+
428
+ // src/components/Assertions.ts
429
+ var customIdValidator = import_zod2.z.string().min(1).max(100);
430
+ var emojiValidator = import_zod2.z.object({
431
+ id: import_zod2.z.string(),
432
+ name: import_zod2.z.string(),
433
+ animated: import_zod2.z.boolean()
434
+ }).partial().strict();
435
+ var disabledValidator = import_zod2.z.boolean();
436
+ var buttonLabelValidator = import_zod2.z.string().nonempty().max(80);
437
+ var buttonStyleValidator = import_zod2.z.number().int().min(import_v10.ButtonStyle.Primary).max(import_v10.ButtonStyle.Link);
438
+ var placeholderValidator = import_zod2.z.string().max(150);
439
+ var minMaxValidator = import_zod2.z.number().int().min(0).max(25);
440
+ var labelValueDescriptionValidator = import_zod2.z.string().min(1).max(100);
441
+ var optionValidator = import_zod2.z.union([
442
+ import_zod2.z.object({
443
+ label: labelValueDescriptionValidator,
444
+ value: labelValueDescriptionValidator,
445
+ description: labelValueDescriptionValidator.optional(),
446
+ emoji: emojiValidator.optional(),
447
+ default: import_zod2.z.boolean().optional()
448
+ }),
449
+ import_zod2.z.instanceof(UnsafeSelectMenuOptionBuilder)
450
+ ]);
451
+ var optionsValidator = optionValidator.array().nonempty();
452
+ var optionsLengthValidator = import_zod2.z.number().int().min(0).max(25);
453
+ function validateRequiredSelectMenuParameters(options, customId) {
454
+ customIdValidator.parse(customId);
455
+ optionsValidator.parse(options);
456
+ }
457
+ __name(validateRequiredSelectMenuParameters, "validateRequiredSelectMenuParameters");
458
+ var labelValueValidator = import_zod2.z.string().min(1).max(100);
459
+ var defaultValidator = import_zod2.z.boolean();
460
+ function validateRequiredSelectMenuOptionParameters(label, value) {
461
+ labelValueValidator.parse(label);
462
+ labelValueValidator.parse(value);
463
+ }
464
+ __name(validateRequiredSelectMenuOptionParameters, "validateRequiredSelectMenuOptionParameters");
465
+ var urlValidator = import_zod2.z.string().url();
466
+ function validateRequiredButtonParameters(style, label, emoji, customId, url) {
467
+ if (url && customId) {
468
+ throw new RangeError("URL and custom id are mutually exclusive");
469
+ }
470
+ if (!label && !emoji) {
471
+ throw new RangeError("Buttons must have a label and/or an emoji");
472
+ }
473
+ if (style === import_v10.ButtonStyle.Link) {
474
+ if (!url) {
475
+ throw new RangeError("Link buttons must have a url");
476
+ }
477
+ } else if (url) {
478
+ throw new RangeError("Non-link buttons cannot have a url");
479
+ }
480
+ }
481
+ __name(validateRequiredButtonParameters, "validateRequiredButtonParameters");
482
+
483
+ // src/components/ActionRow.ts
484
+ var import_v103 = require("discord-api-types/v10");
485
+
486
+ // src/components/Component.ts
487
+ var ComponentBuilder = class {
488
+ constructor(data) {
489
+ __publicField(this, "data");
490
+ this.data = data;
491
+ }
492
+ };
493
+ __name(ComponentBuilder, "ComponentBuilder");
494
+
495
+ // src/components/Components.ts
496
+ var import_v102 = require("discord-api-types/v10");
497
+ function createComponentBuilder(data) {
498
+ if (data instanceof ComponentBuilder) {
499
+ return data;
500
+ }
501
+ switch (data.type) {
502
+ case import_v102.ComponentType.ActionRow:
503
+ return new ActionRowBuilder(data);
504
+ case import_v102.ComponentType.Button:
505
+ return new ButtonBuilder(data);
506
+ case import_v102.ComponentType.SelectMenu:
507
+ return new SelectMenuBuilder(data);
508
+ case import_v102.ComponentType.TextInput:
509
+ return new TextInputBuilder(data);
510
+ default:
511
+ throw new Error(`Cannot properly serialize component type: ${data.type}`);
512
+ }
513
+ }
514
+ __name(createComponentBuilder, "createComponentBuilder");
515
+
516
+ // src/components/ActionRow.ts
517
+ var ActionRowBuilder = class extends ComponentBuilder {
518
+ constructor({
519
+ components,
520
+ ...data
521
+ } = {}) {
522
+ super({ type: import_v103.ComponentType.ActionRow, ...data });
523
+ __publicField(this, "components");
524
+ this.components = components?.map((c) => createComponentBuilder(c)) ?? [];
525
+ }
526
+ addComponents(...components) {
527
+ this.components.push(...components);
528
+ return this;
529
+ }
530
+ setComponents(...components) {
531
+ this.components.splice(0, this.components.length, ...components);
532
+ return this;
533
+ }
534
+ toJSON() {
535
+ return {
536
+ ...this.data,
537
+ components: this.components.map((component) => component.toJSON())
538
+ };
539
+ }
540
+ };
541
+ __name(ActionRowBuilder, "ActionRowBuilder");
542
+
543
+ // src/components/button/UnsafeButton.ts
544
+ var import_v104 = require("discord-api-types/v10");
545
+ var UnsafeButtonBuilder = class extends ComponentBuilder {
546
+ constructor(data) {
547
+ super({ type: import_v104.ComponentType.Button, ...data });
548
+ }
549
+ setStyle(style) {
550
+ this.data.style = style;
551
+ return this;
552
+ }
553
+ setURL(url) {
554
+ this.data.url = url;
555
+ return this;
556
+ }
557
+ setCustomId(customId) {
558
+ this.data.custom_id = customId;
559
+ return this;
560
+ }
561
+ setEmoji(emoji) {
562
+ this.data.emoji = emoji;
563
+ return this;
564
+ }
565
+ setDisabled(disabled = true) {
566
+ this.data.disabled = disabled;
567
+ return this;
568
+ }
569
+ setLabel(label) {
570
+ this.data.label = label;
571
+ return this;
572
+ }
573
+ toJSON() {
574
+ return {
575
+ ...this.data
576
+ };
577
+ }
578
+ };
579
+ __name(UnsafeButtonBuilder, "UnsafeButtonBuilder");
580
+
581
+ // src/components/button/Button.ts
582
+ var ButtonBuilder = class extends UnsafeButtonBuilder {
583
+ setStyle(style) {
584
+ return super.setStyle(buttonStyleValidator.parse(style));
585
+ }
586
+ setURL(url) {
587
+ return super.setURL(urlValidator.parse(url));
588
+ }
589
+ setCustomId(customId) {
590
+ return super.setCustomId(customIdValidator.parse(customId));
591
+ }
592
+ setEmoji(emoji) {
593
+ return super.setEmoji(emojiValidator.parse(emoji));
594
+ }
595
+ setDisabled(disabled = true) {
596
+ return super.setDisabled(disabledValidator.parse(disabled));
597
+ }
598
+ setLabel(label) {
599
+ return super.setLabel(buttonLabelValidator.parse(label));
600
+ }
601
+ toJSON() {
602
+ validateRequiredButtonParameters(this.data.style, this.data.label, this.data.emoji, this.data.custom_id, this.data.url);
603
+ return super.toJSON();
604
+ }
605
+ };
606
+ __name(ButtonBuilder, "ButtonBuilder");
607
+
608
+ // src/components/textInput/Assertions.ts
609
+ var Assertions_exports3 = {};
610
+ __export(Assertions_exports3, {
611
+ labelValidator: () => labelValidator,
612
+ maxLengthValidator: () => maxLengthValidator,
613
+ minLengthValidator: () => minLengthValidator,
614
+ placeholderValidator: () => placeholderValidator2,
615
+ requiredValidator: () => requiredValidator,
616
+ textInputStyleValidator: () => textInputStyleValidator,
617
+ validateRequiredParameters: () => validateRequiredParameters,
618
+ valueValidator: () => valueValidator
619
+ });
620
+ var import_v105 = require("discord-api-types/v10");
621
+ var import_zod3 = require("zod");
622
+ var textInputStyleValidator = import_zod3.z.nativeEnum(import_v105.TextInputStyle);
623
+ var minLengthValidator = import_zod3.z.number().int().min(0).max(4e3);
624
+ var maxLengthValidator = import_zod3.z.number().int().min(1).max(4e3);
625
+ var requiredValidator = import_zod3.z.boolean();
626
+ var valueValidator = import_zod3.z.string().max(4e3);
627
+ var placeholderValidator2 = import_zod3.z.string().max(100);
628
+ var labelValidator = import_zod3.z.string().min(1).max(45);
629
+ function validateRequiredParameters(customId, style, label) {
630
+ customIdValidator.parse(customId);
631
+ textInputStyleValidator.parse(style);
632
+ labelValidator.parse(label);
633
+ }
634
+ __name(validateRequiredParameters, "validateRequiredParameters");
635
+
636
+ // src/components/textInput/UnsafeTextInput.ts
637
+ var import_v106 = require("discord-api-types/v10");
638
+ var import_fast_deep_equal = __toESM(require("fast-deep-equal"));
639
+ var UnsafeTextInputBuilder = class extends ComponentBuilder {
640
+ constructor(data) {
641
+ super({ type: import_v106.ComponentType.TextInput, ...data });
642
+ }
643
+ setCustomId(customId) {
644
+ this.data.custom_id = customId;
645
+ return this;
646
+ }
647
+ setLabel(label) {
648
+ this.data.label = label;
649
+ return this;
650
+ }
651
+ setStyle(style) {
652
+ this.data.style = style;
653
+ return this;
654
+ }
655
+ setMinLength(minLength) {
656
+ this.data.min_length = minLength;
657
+ return this;
658
+ }
659
+ setMaxLength(maxLength) {
660
+ this.data.max_length = maxLength;
661
+ return this;
662
+ }
663
+ setPlaceholder(placeholder) {
664
+ this.data.placeholder = placeholder;
665
+ return this;
666
+ }
667
+ setValue(value) {
668
+ this.data.value = value;
669
+ return this;
670
+ }
671
+ setRequired(required = true) {
672
+ this.data.required = required;
673
+ return this;
674
+ }
675
+ toJSON() {
676
+ return {
677
+ ...this.data
678
+ };
679
+ }
680
+ equals(other) {
681
+ if (other instanceof UnsafeTextInputBuilder) {
682
+ return (0, import_fast_deep_equal.default)(other.data, this.data);
683
+ }
684
+ return (0, import_fast_deep_equal.default)(other, this.data);
685
+ }
686
+ };
687
+ __name(UnsafeTextInputBuilder, "UnsafeTextInputBuilder");
688
+
689
+ // src/components/textInput/TextInput.ts
690
+ var TextInputBuilder = class extends UnsafeTextInputBuilder {
691
+ setMinLength(minLength) {
692
+ return super.setMinLength(minLengthValidator.parse(minLength));
693
+ }
694
+ setMaxLength(maxLength) {
695
+ return super.setMaxLength(maxLengthValidator.parse(maxLength));
696
+ }
697
+ setRequired(required = true) {
698
+ return super.setRequired(requiredValidator.parse(required));
699
+ }
700
+ setValue(value) {
701
+ return super.setValue(valueValidator.parse(value));
702
+ }
703
+ setPlaceholder(placeholder) {
704
+ return super.setPlaceholder(placeholderValidator2.parse(placeholder));
705
+ }
706
+ toJSON() {
707
+ validateRequiredParameters(this.data.custom_id, this.data.style, this.data.label);
708
+ return super.toJSON();
709
+ }
710
+ };
711
+ __name(TextInputBuilder, "TextInputBuilder");
712
+
713
+ // src/interactions/modals/UnsafeModal.ts
714
+ var UnsafeModalBuilder = class {
715
+ constructor({ components, ...data } = {}) {
716
+ __publicField(this, "data");
717
+ __publicField(this, "components", []);
718
+ this.data = { ...data };
719
+ this.components = components?.map((c) => createComponentBuilder(c)) ?? [];
720
+ }
721
+ setTitle(title) {
722
+ this.data.title = title;
723
+ return this;
724
+ }
725
+ setCustomId(customId) {
726
+ this.data.custom_id = customId;
727
+ return this;
728
+ }
729
+ addComponents(...components) {
730
+ this.components.push(...components.map((component) => component instanceof ActionRowBuilder ? component : new ActionRowBuilder(component)));
731
+ return this;
732
+ }
733
+ setComponents(...components) {
734
+ this.components.splice(0, this.components.length, ...components);
735
+ return this;
736
+ }
737
+ toJSON() {
738
+ return {
739
+ ...this.data,
740
+ components: this.components.map((component) => component.toJSON())
741
+ };
742
+ }
743
+ };
744
+ __name(UnsafeModalBuilder, "UnsafeModalBuilder");
745
+
746
+ // src/interactions/modals/Assertions.ts
747
+ var Assertions_exports4 = {};
748
+ __export(Assertions_exports4, {
749
+ componentsValidator: () => componentsValidator,
750
+ titleValidator: () => titleValidator,
751
+ validateRequiredParameters: () => validateRequiredParameters2
752
+ });
753
+ var import_zod4 = require("zod");
754
+ var titleValidator = import_zod4.z.string().min(1).max(45);
755
+ var componentsValidator = import_zod4.z.array(import_zod4.z.instanceof(ActionRowBuilder)).min(1);
756
+ function validateRequiredParameters2(customId, title, components) {
757
+ customIdValidator.parse(customId);
758
+ titleValidator.parse(title);
759
+ componentsValidator.parse(components);
760
+ }
761
+ __name(validateRequiredParameters2, "validateRequiredParameters");
762
+
763
+ // src/interactions/modals/Modal.ts
764
+ var ModalBuilder = class extends UnsafeModalBuilder {
765
+ setCustomId(customId) {
766
+ return super.setCustomId(customIdValidator.parse(customId));
767
+ }
768
+ setTitle(title) {
769
+ return super.setTitle(titleValidator.parse(title));
770
+ }
771
+ toJSON() {
772
+ validateRequiredParameters2(this.data.custom_id, this.data.title, this.components);
773
+ return super.toJSON();
774
+ }
775
+ };
776
+ __name(ModalBuilder, "ModalBuilder");
777
+
778
+ // src/components/selectMenu/UnsafeSelectMenu.ts
779
+ var import_v107 = require("discord-api-types/v10");
780
+ var UnsafeSelectMenuBuilder = class extends ComponentBuilder {
781
+ constructor(data) {
782
+ const { options, ...initData } = data ?? {};
783
+ super({ type: import_v107.ComponentType.SelectMenu, ...initData });
784
+ __publicField(this, "options");
785
+ this.options = options?.map((o) => new UnsafeSelectMenuOptionBuilder(o)) ?? [];
786
+ }
787
+ setPlaceholder(placeholder) {
788
+ this.data.placeholder = placeholder;
789
+ return this;
790
+ }
791
+ setMinValues(minValues) {
792
+ this.data.min_values = minValues;
793
+ return this;
794
+ }
795
+ setMaxValues(maxValues) {
796
+ this.data.max_values = maxValues;
797
+ return this;
798
+ }
799
+ setCustomId(customId) {
800
+ this.data.custom_id = customId;
801
+ return this;
802
+ }
803
+ setDisabled(disabled = true) {
804
+ this.data.disabled = disabled;
805
+ return this;
806
+ }
807
+ addOptions(...options) {
808
+ this.options.push(...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(option)));
809
+ return this;
810
+ }
811
+ setOptions(...options) {
812
+ this.options.splice(0, this.options.length, ...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(option)));
813
+ return this;
814
+ }
815
+ toJSON() {
816
+ return {
817
+ ...this.data,
818
+ options: this.options.map((o) => o.toJSON())
819
+ };
820
+ }
821
+ };
822
+ __name(UnsafeSelectMenuBuilder, "UnsafeSelectMenuBuilder");
823
+
824
+ // src/components/selectMenu/SelectMenu.ts
825
+ var SelectMenuBuilder = class extends UnsafeSelectMenuBuilder {
826
+ setPlaceholder(placeholder) {
827
+ return super.setPlaceholder(placeholderValidator.parse(placeholder));
828
+ }
829
+ setMinValues(minValues) {
830
+ return super.setMinValues(minMaxValidator.parse(minValues));
831
+ }
832
+ setMaxValues(maxValues) {
833
+ return super.setMaxValues(minMaxValidator.parse(maxValues));
834
+ }
835
+ setCustomId(customId) {
836
+ return super.setCustomId(customIdValidator.parse(customId));
837
+ }
838
+ setDisabled(disabled = true) {
839
+ return super.setDisabled(disabledValidator.parse(disabled));
840
+ }
841
+ addOptions(...options) {
842
+ optionsLengthValidator.parse(this.options.length + options.length);
843
+ this.options.push(...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(optionValidator.parse(option))));
844
+ return this;
845
+ }
846
+ setOptions(...options) {
847
+ optionsLengthValidator.parse(options.length);
848
+ this.options.splice(0, this.options.length, ...options.map((option) => option instanceof UnsafeSelectMenuOptionBuilder ? option : new UnsafeSelectMenuOptionBuilder(optionValidator.parse(option))));
849
+ return this;
850
+ }
851
+ toJSON() {
852
+ validateRequiredSelectMenuParameters(this.options, this.data.custom_id);
853
+ return super.toJSON();
854
+ }
855
+ };
856
+ __name(SelectMenuBuilder, "SelectMenuBuilder");
857
+
858
+ // src/components/selectMenu/SelectMenuOption.ts
859
+ var SelectMenuOptionBuilder = class extends UnsafeSelectMenuOptionBuilder {
860
+ setDescription(description) {
861
+ return super.setDescription(labelValueValidator.parse(description));
862
+ }
863
+ setDefault(isDefault = true) {
864
+ return super.setDefault(defaultValidator.parse(isDefault));
865
+ }
866
+ setEmoji(emoji) {
867
+ return super.setEmoji(emojiValidator.parse(emoji));
868
+ }
869
+ toJSON() {
870
+ validateRequiredSelectMenuOptionParameters(this.data.label, this.data.value);
871
+ return super.toJSON();
872
+ }
873
+ };
874
+ __name(SelectMenuOptionBuilder, "SelectMenuOptionBuilder");
875
+
876
+ // src/interactions/slashCommands/Assertions.ts
877
+ var Assertions_exports5 = {};
878
+ __export(Assertions_exports5, {
879
+ assertReturnOfBuilder: () => assertReturnOfBuilder,
880
+ validateChoicesLength: () => validateChoicesLength,
881
+ validateDefaultPermission: () => validateDefaultPermission,
882
+ validateDescription: () => validateDescription,
883
+ validateMaxOptionsLength: () => validateMaxOptionsLength,
884
+ validateName: () => validateName,
885
+ validateRequired: () => validateRequired,
886
+ validateRequiredParameters: () => validateRequiredParameters3
887
+ });
888
+ var import_is = __toESM(require("@sindresorhus/is"));
889
+ var import_zod5 = require("zod");
890
+ var namePredicate = import_zod5.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);
891
+ function validateName(name) {
892
+ namePredicate.parse(name);
893
+ }
894
+ __name(validateName, "validateName");
895
+ var descriptionPredicate2 = import_zod5.z.string().min(1).max(100);
896
+ function validateDescription(description) {
897
+ descriptionPredicate2.parse(description);
898
+ }
899
+ __name(validateDescription, "validateDescription");
900
+ var maxArrayLengthPredicate = import_zod5.z.unknown().array().max(25);
901
+ function validateMaxOptionsLength(options) {
902
+ maxArrayLengthPredicate.parse(options);
903
+ }
904
+ __name(validateMaxOptionsLength, "validateMaxOptionsLength");
905
+ function validateRequiredParameters3(name, description, options) {
906
+ validateName(name);
907
+ validateDescription(description);
908
+ validateMaxOptionsLength(options);
909
+ }
910
+ __name(validateRequiredParameters3, "validateRequiredParameters");
911
+ var booleanPredicate = import_zod5.z.boolean();
912
+ function validateDefaultPermission(value) {
913
+ booleanPredicate.parse(value);
914
+ }
915
+ __name(validateDefaultPermission, "validateDefaultPermission");
916
+ function validateRequired(required) {
917
+ booleanPredicate.parse(required);
918
+ }
919
+ __name(validateRequired, "validateRequired");
920
+ var choicesLengthPredicate = import_zod5.z.number().lte(25);
921
+ function validateChoicesLength(amountAdding, choices) {
922
+ choicesLengthPredicate.parse((choices?.length ?? 0) + amountAdding);
923
+ }
924
+ __name(validateChoicesLength, "validateChoicesLength");
925
+ function assertReturnOfBuilder(input, ExpectedInstanceOf) {
926
+ const instanceName = ExpectedInstanceOf.name;
927
+ if (import_is.default.nullOrUndefined(input)) {
928
+ throw new TypeError(`Expected to receive a ${instanceName} builder, got ${input === null ? "null" : "undefined"} instead.`);
929
+ }
930
+ if (import_is.default.primitive(input)) {
931
+ throw new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);
932
+ }
933
+ if (!(input instanceof ExpectedInstanceOf)) {
934
+ const casted = input;
935
+ const constructorName = import_is.default.function_(input) ? input.name : casted.constructor.name;
936
+ const stringTag = Reflect.get(casted, Symbol.toStringTag);
937
+ const fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;
938
+ throw new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);
939
+ }
940
+ }
941
+ __name(assertReturnOfBuilder, "assertReturnOfBuilder");
942
+
943
+ // src/interactions/slashCommands/SlashCommandBuilder.ts
944
+ var import_ts_mixer6 = require("ts-mixer");
945
+
946
+ // src/interactions/slashCommands/options/boolean.ts
947
+ var import_v108 = require("discord-api-types/v10");
948
+
949
+ // src/interactions/slashCommands/mixins/NameAndDescription.ts
950
+ var SharedNameAndDescription = class {
951
+ constructor() {
952
+ __publicField(this, "name");
953
+ __publicField(this, "description");
954
+ }
955
+ setName(name) {
956
+ validateName(name);
957
+ Reflect.set(this, "name", name);
958
+ return this;
959
+ }
960
+ setDescription(description) {
961
+ validateDescription(description);
962
+ Reflect.set(this, "description", description);
963
+ return this;
964
+ }
965
+ };
966
+ __name(SharedNameAndDescription, "SharedNameAndDescription");
967
+
968
+ // src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts
969
+ var ApplicationCommandOptionBase = class extends SharedNameAndDescription {
970
+ constructor() {
971
+ super(...arguments);
972
+ __publicField(this, "required", false);
973
+ }
974
+ setRequired(required) {
975
+ validateRequired(required);
976
+ Reflect.set(this, "required", required);
977
+ return this;
978
+ }
979
+ runRequiredValidations() {
980
+ validateRequiredParameters3(this.name, this.description, []);
981
+ validateRequired(this.required);
982
+ }
983
+ };
984
+ __name(ApplicationCommandOptionBase, "ApplicationCommandOptionBase");
985
+
986
+ // src/interactions/slashCommands/options/boolean.ts
987
+ var SlashCommandBooleanOption = class extends ApplicationCommandOptionBase {
988
+ constructor() {
989
+ super(...arguments);
990
+ __publicField(this, "type", import_v108.ApplicationCommandOptionType.Boolean);
991
+ }
992
+ toJSON() {
993
+ this.runRequiredValidations();
994
+ return { ...this };
995
+ }
996
+ };
997
+ __name(SlashCommandBooleanOption, "SlashCommandBooleanOption");
998
+
999
+ // src/interactions/slashCommands/options/channel.ts
1000
+ var import_v1010 = require("discord-api-types/v10");
1001
+ var import_ts_mixer = require("ts-mixer");
1002
+
1003
+ // src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts
1004
+ var import_v109 = require("discord-api-types/v10");
1005
+ var import_zod6 = require("zod");
1006
+ var allowedChannelTypes = [
1007
+ import_v109.ChannelType.GuildText,
1008
+ import_v109.ChannelType.GuildVoice,
1009
+ import_v109.ChannelType.GuildCategory,
1010
+ import_v109.ChannelType.GuildNews,
1011
+ import_v109.ChannelType.GuildStore,
1012
+ import_v109.ChannelType.GuildNewsThread,
1013
+ import_v109.ChannelType.GuildPublicThread,
1014
+ import_v109.ChannelType.GuildPrivateThread,
1015
+ import_v109.ChannelType.GuildStageVoice
1016
+ ];
1017
+ var channelTypesPredicate = import_zod6.z.array(import_zod6.z.union(allowedChannelTypes.map((type) => import_zod6.z.literal(type))));
1018
+ var ApplicationCommandOptionChannelTypesMixin = class {
1019
+ constructor() {
1020
+ __publicField(this, "channel_types");
1021
+ }
1022
+ addChannelTypes(...channelTypes) {
1023
+ if (this.channel_types === void 0) {
1024
+ Reflect.set(this, "channel_types", []);
1025
+ }
1026
+ channelTypesPredicate.parse(channelTypes);
1027
+ this.channel_types.push(...channelTypes);
1028
+ return this;
1029
+ }
1030
+ };
1031
+ __name(ApplicationCommandOptionChannelTypesMixin, "ApplicationCommandOptionChannelTypesMixin");
1032
+
1033
+ // src/interactions/slashCommands/options/channel.ts
1034
+ var SlashCommandChannelOption = class extends ApplicationCommandOptionBase {
1035
+ constructor() {
1036
+ super(...arguments);
1037
+ __publicField(this, "type", import_v1010.ApplicationCommandOptionType.Channel);
1038
+ }
1039
+ toJSON() {
1040
+ this.runRequiredValidations();
1041
+ return { ...this };
1042
+ }
1043
+ };
1044
+ __name(SlashCommandChannelOption, "SlashCommandChannelOption");
1045
+ SlashCommandChannelOption = __decorateClass([
1046
+ (0, import_ts_mixer.mix)(ApplicationCommandOptionChannelTypesMixin)
1047
+ ], SlashCommandChannelOption);
1048
+
1049
+ // src/interactions/slashCommands/options/integer.ts
1050
+ var import_v1012 = require("discord-api-types/v10");
1051
+ var import_ts_mixer2 = require("ts-mixer");
1052
+ var import_zod8 = require("zod");
1053
+
1054
+ // src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts
1055
+ var ApplicationCommandNumericOptionMinMaxValueMixin = class {
1056
+ constructor() {
1057
+ __publicField(this, "max_value");
1058
+ __publicField(this, "min_value");
1059
+ }
1060
+ };
1061
+ __name(ApplicationCommandNumericOptionMinMaxValueMixin, "ApplicationCommandNumericOptionMinMaxValueMixin");
1062
+
1063
+ // src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts
1064
+ var import_v1011 = require("discord-api-types/v10");
1065
+ var import_zod7 = require("zod");
1066
+ var stringPredicate = import_zod7.z.string().min(1).max(100);
1067
+ var numberPredicate = import_zod7.z.number().gt(-Infinity).lt(Infinity);
1068
+ var choicesPredicate = import_zod7.z.object({ name: stringPredicate, value: import_zod7.z.union([stringPredicate, numberPredicate]) }).array();
1069
+ var booleanPredicate2 = import_zod7.z.boolean();
1070
+ var ApplicationCommandOptionWithChoicesAndAutocompleteMixin = class {
1071
+ constructor() {
1072
+ __publicField(this, "choices");
1073
+ __publicField(this, "autocomplete");
1074
+ __publicField(this, "type");
1075
+ }
1076
+ addChoices(...choices) {
1077
+ if (choices.length > 0 && this.autocomplete) {
1078
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
1079
+ }
1080
+ choicesPredicate.parse(choices);
1081
+ if (this.choices === void 0) {
1082
+ Reflect.set(this, "choices", []);
1083
+ }
1084
+ validateChoicesLength(choices.length, this.choices);
1085
+ for (const { name, value } of choices) {
1086
+ if (this.type === import_v1011.ApplicationCommandOptionType.String) {
1087
+ stringPredicate.parse(value);
1088
+ } else {
1089
+ numberPredicate.parse(value);
1090
+ }
1091
+ this.choices.push({ name, value });
1092
+ }
1093
+ return this;
1094
+ }
1095
+ setChoices(...choices) {
1096
+ if (choices.length > 0 && this.autocomplete) {
1097
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
1098
+ }
1099
+ choicesPredicate.parse(choices);
1100
+ Reflect.set(this, "choices", []);
1101
+ this.addChoices(...choices);
1102
+ return this;
1103
+ }
1104
+ setAutocomplete(autocomplete) {
1105
+ booleanPredicate2.parse(autocomplete);
1106
+ if (autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
1107
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
1108
+ }
1109
+ Reflect.set(this, "autocomplete", autocomplete);
1110
+ return this;
1111
+ }
1112
+ };
1113
+ __name(ApplicationCommandOptionWithChoicesAndAutocompleteMixin, "ApplicationCommandOptionWithChoicesAndAutocompleteMixin");
1114
+
1115
+ // src/interactions/slashCommands/options/integer.ts
1116
+ var numberValidator = import_zod8.z.number().int();
1117
+ var SlashCommandIntegerOption = class extends ApplicationCommandOptionBase {
1118
+ constructor() {
1119
+ super(...arguments);
1120
+ __publicField(this, "type", import_v1012.ApplicationCommandOptionType.Integer);
1121
+ }
1122
+ setMaxValue(max) {
1123
+ numberValidator.parse(max);
1124
+ Reflect.set(this, "max_value", max);
1125
+ return this;
1126
+ }
1127
+ setMinValue(min) {
1128
+ numberValidator.parse(min);
1129
+ Reflect.set(this, "min_value", min);
1130
+ return this;
1131
+ }
1132
+ toJSON() {
1133
+ this.runRequiredValidations();
1134
+ if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
1135
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
1136
+ }
1137
+ return { ...this };
1138
+ }
1139
+ };
1140
+ __name(SlashCommandIntegerOption, "SlashCommandIntegerOption");
1141
+ SlashCommandIntegerOption = __decorateClass([
1142
+ (0, import_ts_mixer2.mix)(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
1143
+ ], SlashCommandIntegerOption);
1144
+
1145
+ // src/interactions/slashCommands/options/mentionable.ts
1146
+ var import_v1013 = require("discord-api-types/v10");
1147
+ var SlashCommandMentionableOption = class extends ApplicationCommandOptionBase {
1148
+ constructor() {
1149
+ super(...arguments);
1150
+ __publicField(this, "type", import_v1013.ApplicationCommandOptionType.Mentionable);
1151
+ }
1152
+ toJSON() {
1153
+ this.runRequiredValidations();
1154
+ return { ...this };
1155
+ }
1156
+ };
1157
+ __name(SlashCommandMentionableOption, "SlashCommandMentionableOption");
1158
+
1159
+ // src/interactions/slashCommands/options/number.ts
1160
+ var import_v1014 = require("discord-api-types/v10");
1161
+ var import_ts_mixer3 = require("ts-mixer");
1162
+ var import_zod9 = require("zod");
1163
+ var numberValidator2 = import_zod9.z.number();
1164
+ var SlashCommandNumberOption = class extends ApplicationCommandOptionBase {
1165
+ constructor() {
1166
+ super(...arguments);
1167
+ __publicField(this, "type", import_v1014.ApplicationCommandOptionType.Number);
1168
+ }
1169
+ setMaxValue(max) {
1170
+ numberValidator2.parse(max);
1171
+ Reflect.set(this, "max_value", max);
1172
+ return this;
1173
+ }
1174
+ setMinValue(min) {
1175
+ numberValidator2.parse(min);
1176
+ Reflect.set(this, "min_value", min);
1177
+ return this;
1178
+ }
1179
+ toJSON() {
1180
+ this.runRequiredValidations();
1181
+ if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
1182
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
1183
+ }
1184
+ return { ...this };
1185
+ }
1186
+ };
1187
+ __name(SlashCommandNumberOption, "SlashCommandNumberOption");
1188
+ SlashCommandNumberOption = __decorateClass([
1189
+ (0, import_ts_mixer3.mix)(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
1190
+ ], SlashCommandNumberOption);
1191
+
1192
+ // src/interactions/slashCommands/options/role.ts
1193
+ var import_v1015 = require("discord-api-types/v10");
1194
+ var SlashCommandRoleOption = class extends ApplicationCommandOptionBase {
1195
+ constructor() {
1196
+ super(...arguments);
1197
+ __publicField(this, "type", import_v1015.ApplicationCommandOptionType.Role);
1198
+ }
1199
+ toJSON() {
1200
+ this.runRequiredValidations();
1201
+ return { ...this };
1202
+ }
1203
+ };
1204
+ __name(SlashCommandRoleOption, "SlashCommandRoleOption");
1205
+
1206
+ // src/interactions/slashCommands/options/attachment.ts
1207
+ var import_v1016 = require("discord-api-types/v10");
1208
+ var SlashCommandAttachmentOption = class extends ApplicationCommandOptionBase {
1209
+ constructor() {
1210
+ super(...arguments);
1211
+ __publicField(this, "type", import_v1016.ApplicationCommandOptionType.Attachment);
1212
+ }
1213
+ toJSON() {
1214
+ this.runRequiredValidations();
1215
+ return { ...this };
1216
+ }
1217
+ };
1218
+ __name(SlashCommandAttachmentOption, "SlashCommandAttachmentOption");
1219
+
1220
+ // src/interactions/slashCommands/options/string.ts
1221
+ var import_v1017 = require("discord-api-types/v10");
1222
+ var import_ts_mixer4 = require("ts-mixer");
1223
+ var SlashCommandStringOption = class extends ApplicationCommandOptionBase {
1224
+ constructor() {
1225
+ super(...arguments);
1226
+ __publicField(this, "type", import_v1017.ApplicationCommandOptionType.String);
1227
+ }
1228
+ toJSON() {
1229
+ this.runRequiredValidations();
1230
+ if (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {
1231
+ throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");
1232
+ }
1233
+ return { ...this };
1234
+ }
1235
+ };
1236
+ __name(SlashCommandStringOption, "SlashCommandStringOption");
1237
+ SlashCommandStringOption = __decorateClass([
1238
+ (0, import_ts_mixer4.mix)(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)
1239
+ ], SlashCommandStringOption);
1240
+
1241
+ // src/interactions/slashCommands/options/user.ts
1242
+ var import_v1018 = require("discord-api-types/v10");
1243
+ var SlashCommandUserOption = class extends ApplicationCommandOptionBase {
1244
+ constructor() {
1245
+ super(...arguments);
1246
+ __publicField(this, "type", import_v1018.ApplicationCommandOptionType.User);
1247
+ }
1248
+ toJSON() {
1249
+ this.runRequiredValidations();
1250
+ return { ...this };
1251
+ }
1252
+ };
1253
+ __name(SlashCommandUserOption, "SlashCommandUserOption");
1254
+
1255
+ // src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts
1256
+ var SharedSlashCommandOptions = class {
1257
+ constructor() {
1258
+ __publicField(this, "options");
1259
+ }
1260
+ addBooleanOption(input) {
1261
+ return this._sharedAddOptionMethod(input, SlashCommandBooleanOption);
1262
+ }
1263
+ addUserOption(input) {
1264
+ return this._sharedAddOptionMethod(input, SlashCommandUserOption);
1265
+ }
1266
+ addChannelOption(input) {
1267
+ return this._sharedAddOptionMethod(input, SlashCommandChannelOption);
1268
+ }
1269
+ addRoleOption(input) {
1270
+ return this._sharedAddOptionMethod(input, SlashCommandRoleOption);
1271
+ }
1272
+ addAttachmentOption(input) {
1273
+ return this._sharedAddOptionMethod(input, SlashCommandAttachmentOption);
1274
+ }
1275
+ addMentionableOption(input) {
1276
+ return this._sharedAddOptionMethod(input, SlashCommandMentionableOption);
1277
+ }
1278
+ addStringOption(input) {
1279
+ return this._sharedAddOptionMethod(input, SlashCommandStringOption);
1280
+ }
1281
+ addIntegerOption(input) {
1282
+ return this._sharedAddOptionMethod(input, SlashCommandIntegerOption);
1283
+ }
1284
+ addNumberOption(input) {
1285
+ return this._sharedAddOptionMethod(input, SlashCommandNumberOption);
1286
+ }
1287
+ _sharedAddOptionMethod(input, Instance) {
1288
+ const { options } = this;
1289
+ validateMaxOptionsLength(options);
1290
+ const result = typeof input === "function" ? input(new Instance()) : input;
1291
+ assertReturnOfBuilder(result, Instance);
1292
+ options.push(result);
1293
+ return this;
1294
+ }
1295
+ };
1296
+ __name(SharedSlashCommandOptions, "SharedSlashCommandOptions");
1297
+
1298
+ // src/interactions/slashCommands/SlashCommandSubcommands.ts
1299
+ var import_v1019 = require("discord-api-types/v10");
1300
+ var import_ts_mixer5 = require("ts-mixer");
1301
+ var SlashCommandSubcommandGroupBuilder = class {
1302
+ constructor() {
1303
+ __publicField(this, "name");
1304
+ __publicField(this, "description");
1305
+ __publicField(this, "options", []);
1306
+ }
1307
+ addSubcommand(input) {
1308
+ const { options } = this;
1309
+ validateMaxOptionsLength(options);
1310
+ const result = typeof input === "function" ? input(new SlashCommandSubcommandBuilder()) : input;
1311
+ assertReturnOfBuilder(result, SlashCommandSubcommandBuilder);
1312
+ options.push(result);
1313
+ return this;
1314
+ }
1315
+ toJSON() {
1316
+ validateRequiredParameters3(this.name, this.description, this.options);
1317
+ return {
1318
+ type: import_v1019.ApplicationCommandOptionType.SubcommandGroup,
1319
+ name: this.name,
1320
+ description: this.description,
1321
+ options: this.options.map((option) => option.toJSON())
1322
+ };
1323
+ }
1324
+ };
1325
+ __name(SlashCommandSubcommandGroupBuilder, "SlashCommandSubcommandGroupBuilder");
1326
+ SlashCommandSubcommandGroupBuilder = __decorateClass([
1327
+ (0, import_ts_mixer5.mix)(SharedNameAndDescription)
1328
+ ], SlashCommandSubcommandGroupBuilder);
1329
+ var SlashCommandSubcommandBuilder = class {
1330
+ constructor() {
1331
+ __publicField(this, "name");
1332
+ __publicField(this, "description");
1333
+ __publicField(this, "options", []);
1334
+ }
1335
+ toJSON() {
1336
+ validateRequiredParameters3(this.name, this.description, this.options);
1337
+ return {
1338
+ type: import_v1019.ApplicationCommandOptionType.Subcommand,
1339
+ name: this.name,
1340
+ description: this.description,
1341
+ options: this.options.map((option) => option.toJSON())
1342
+ };
1343
+ }
1344
+ };
1345
+ __name(SlashCommandSubcommandBuilder, "SlashCommandSubcommandBuilder");
1346
+ SlashCommandSubcommandBuilder = __decorateClass([
1347
+ (0, import_ts_mixer5.mix)(SharedNameAndDescription, SharedSlashCommandOptions)
1348
+ ], SlashCommandSubcommandBuilder);
1349
+
1350
+ // src/interactions/slashCommands/SlashCommandBuilder.ts
1351
+ var SlashCommandBuilder = class {
1352
+ constructor() {
1353
+ __publicField(this, "name");
1354
+ __publicField(this, "description");
1355
+ __publicField(this, "options", []);
1356
+ __publicField(this, "defaultPermission");
1357
+ }
1358
+ toJSON() {
1359
+ validateRequiredParameters3(this.name, this.description, this.options);
1360
+ return {
1361
+ name: this.name,
1362
+ description: this.description,
1363
+ options: this.options.map((option) => option.toJSON()),
1364
+ default_permission: this.defaultPermission
1365
+ };
1366
+ }
1367
+ setDefaultPermission(value) {
1368
+ validateDefaultPermission(value);
1369
+ Reflect.set(this, "defaultPermission", value);
1370
+ return this;
1371
+ }
1372
+ addSubcommandGroup(input) {
1373
+ const { options } = this;
1374
+ validateMaxOptionsLength(options);
1375
+ const result = typeof input === "function" ? input(new SlashCommandSubcommandGroupBuilder()) : input;
1376
+ assertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);
1377
+ options.push(result);
1378
+ return this;
1379
+ }
1380
+ addSubcommand(input) {
1381
+ const { options } = this;
1382
+ validateMaxOptionsLength(options);
1383
+ const result = typeof input === "function" ? input(new SlashCommandSubcommandBuilder()) : input;
1384
+ assertReturnOfBuilder(result, SlashCommandSubcommandBuilder);
1385
+ options.push(result);
1386
+ return this;
1387
+ }
1388
+ };
1389
+ __name(SlashCommandBuilder, "SlashCommandBuilder");
1390
+ SlashCommandBuilder = __decorateClass([
1391
+ (0, import_ts_mixer6.mix)(SharedSlashCommandOptions, SharedNameAndDescription)
1392
+ ], SlashCommandBuilder);
1393
+
1394
+ // src/interactions/contextMenuCommands/Assertions.ts
1395
+ var Assertions_exports6 = {};
1396
+ __export(Assertions_exports6, {
1397
+ validateDefaultPermission: () => validateDefaultPermission2,
1398
+ validateName: () => validateName2,
1399
+ validateRequiredParameters: () => validateRequiredParameters4,
1400
+ validateType: () => validateType
1401
+ });
1402
+ var import_zod10 = require("zod");
1403
+ var import_v1020 = require("discord-api-types/v10");
1404
+ var namePredicate2 = import_zod10.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u);
1405
+ var typePredicate = import_zod10.z.union([import_zod10.z.literal(import_v1020.ApplicationCommandType.User), import_zod10.z.literal(import_v1020.ApplicationCommandType.Message)]);
1406
+ var booleanPredicate3 = import_zod10.z.boolean();
1407
+ function validateDefaultPermission2(value) {
1408
+ booleanPredicate3.parse(value);
1409
+ }
1410
+ __name(validateDefaultPermission2, "validateDefaultPermission");
1411
+ function validateName2(name) {
1412
+ namePredicate2.parse(name);
1413
+ }
1414
+ __name(validateName2, "validateName");
1415
+ function validateType(type) {
1416
+ typePredicate.parse(type);
1417
+ }
1418
+ __name(validateType, "validateType");
1419
+ function validateRequiredParameters4(name, type) {
1420
+ validateName2(name);
1421
+ validateType(type);
1422
+ }
1423
+ __name(validateRequiredParameters4, "validateRequiredParameters");
1424
+
1425
+ // src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts
1426
+ var ContextMenuCommandBuilder = class {
1427
+ constructor() {
1428
+ __publicField(this, "name");
1429
+ __publicField(this, "type");
1430
+ __publicField(this, "defaultPermission");
1431
+ }
1432
+ setName(name) {
1433
+ validateName2(name);
1434
+ Reflect.set(this, "name", name);
1435
+ return this;
1436
+ }
1437
+ setType(type) {
1438
+ validateType(type);
1439
+ Reflect.set(this, "type", type);
1440
+ return this;
1441
+ }
1442
+ setDefaultPermission(value) {
1443
+ validateDefaultPermission2(value);
1444
+ Reflect.set(this, "defaultPermission", value);
1445
+ return this;
1446
+ }
1447
+ toJSON() {
1448
+ validateRequiredParameters4(this.name, this.type);
1449
+ return {
1450
+ name: this.name,
1451
+ type: this.type,
1452
+ default_permission: this.defaultPermission
1453
+ };
1454
+ }
1455
+ };
1456
+ __name(ContextMenuCommandBuilder, "ContextMenuCommandBuilder");
1457
+
1458
+ // src/util/jsonEncodable.ts
1459
+ function isJSONEncodable(maybeEncodable) {
1460
+ return maybeEncodable !== null && typeof maybeEncodable === "object" && "toJSON" in maybeEncodable;
1461
+ }
1462
+ __name(isJSONEncodable, "isJSONEncodable");
1463
+
1464
+ // src/util/equatable.ts
1465
+ function isEquatable(maybeEquatable) {
1466
+ return maybeEquatable !== null && typeof maybeEquatable === "object" && "equals" in maybeEquatable;
1467
+ }
1468
+ __name(isEquatable, "isEquatable");
1469
+
1470
+ // src/util/componentUtil.ts
1471
+ function embedLength(data) {
1472
+ return (data.title?.length ?? 0) + (data.description?.length ?? 0) + (data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) + (data.footer?.text.length ?? 0) + (data.author?.name.length ?? 0);
1473
+ }
1474
+ __name(embedLength, "embedLength");
1475
+ module.exports = __toCommonJS(src_exports);
1476
+ // Annotate the CommonJS export names for ESM import in node:
1477
+ 0 && (module.exports = {
1478
+ ActionRowBuilder,
1479
+ ButtonBuilder,
1480
+ ComponentAssertions,
1481
+ ComponentBuilder,
1482
+ ContextMenuCommandAssertions,
1483
+ ContextMenuCommandBuilder,
1484
+ EmbedAssertions,
1485
+ EmbedBuilder,
1486
+ Faces,
1487
+ ModalAssertions,
1488
+ ModalBuilder,
1489
+ SelectMenuBuilder,
1490
+ SelectMenuOptionBuilder,
1491
+ SlashCommandAssertions,
1492
+ SlashCommandAttachmentOption,
1493
+ SlashCommandBooleanOption,
1494
+ SlashCommandBuilder,
1495
+ SlashCommandChannelOption,
1496
+ SlashCommandIntegerOption,
1497
+ SlashCommandMentionableOption,
1498
+ SlashCommandNumberOption,
1499
+ SlashCommandRoleOption,
1500
+ SlashCommandStringOption,
1501
+ SlashCommandSubcommandBuilder,
1502
+ SlashCommandSubcommandGroupBuilder,
1503
+ SlashCommandUserOption,
1504
+ TextInputAssertions,
1505
+ TextInputBuilder,
1506
+ TimestampStyles,
1507
+ UnsafeButtonBuilder,
1508
+ UnsafeEmbedBuilder,
1509
+ UnsafeModalBuilder,
1510
+ UnsafeSelectMenuBuilder,
1511
+ UnsafeSelectMenuOptionBuilder,
1512
+ UnsafeTextInputBuilder,
1513
+ blockQuote,
1514
+ bold,
1515
+ channelMention,
1516
+ codeBlock,
1517
+ createComponentBuilder,
1518
+ embedLength,
1519
+ formatEmoji,
1520
+ hideLinkEmbed,
1521
+ hyperlink,
1522
+ inlineCode,
1523
+ isEquatable,
1524
+ isJSONEncodable,
1525
+ italic,
1526
+ memberNicknameMention,
1527
+ quote,
1528
+ roleMention,
1529
+ spoiler,
1530
+ strikethrough,
1531
+ time,
1532
+ underscore,
1533
+ userMention
1534
+ });
4
1535
  //# sourceMappingURL=index.js.map