@discordjs/builders 0.13.0-dev.1645877056.a8321d8 → 0.13.0-dev.1646222605.53defb8

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 CHANGED
@@ -169,12 +169,6 @@ declare class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> {
169
169
  * The hex color of the current color of the embed
170
170
  */
171
171
  get hexColor(): string | undefined;
172
- /**
173
- * Adds a field to the embed (max 25)
174
- *
175
- * @param field The field to add.
176
- */
177
- addField(field: APIEmbedField): this;
178
172
  /**
179
173
  * Adds fields to the embed (max 25)
180
174
  *
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Ee=Object.create;var I=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var De=(e,t,n)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=e=>I(e,"__esModule",{value:!0}),o=(e,t)=>I(e,"name",{value:t,configurable:!0});var U=(e,t)=>{for(var n in t)I(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Be(t))!$e.call(e,s)&&(n||s!=="default")&&I(e,s,{get:()=>t[s],enumerable:!(r=zt(t,s))||r.enumerable});return e},J=(e,t)=>Kt(Zt(I(e!=null?Ee(Ne(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Le=(e=>(t,n)=>e&&e.get(t)||(n=Kt(Zt({}),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?zt(t,n):t,A=e.length-1,P;A>=0;A--)(P=e[A])&&(s=(r?P(t,n,s):P(s))||s);return r&&s&&I(t,n,s),s};var i=(e,t,n)=>(De(e,typeof t!="symbol"?t+"":t,n),n);var lo={};U(lo,{ActionRow:()=>M,ButtonComponent:()=>F,Component:()=>u,ComponentAssertions:()=>Bt,ContextMenuCommandAssertions:()=>Gt,ContextMenuCommandBuilder:()=>Wt,Embed:()=>St,EmbedAssertions:()=>Ot,Faces:()=>ee,SelectMenuComponent:()=>G,SelectMenuOption:()=>Dt,SlashCommandAssertions:()=>Vt,SlashCommandAttachmentOption:()=>Q,SlashCommandBooleanOption:()=>z,SlashCommandBuilder:()=>X,SlashCommandChannelOption:()=>w,SlashCommandIntegerOption:()=>E,SlashCommandMentionableOption:()=>Z,SlashCommandNumberOption:()=>B,SlashCommandRoleOption:()=>K,SlashCommandStringOption:()=>N,SlashCommandSubcommandBuilder:()=>b,SlashCommandSubcommandGroupBuilder:()=>S,SlashCommandUserOption:()=>H,TimestampStyles:()=>to,UnsafeButtonComponent:()=>R,UnsafeEmbed:()=>T,UnsafeSelectMenuComponent:()=>v,UnsafeSelectMenuOption:()=>c,blockQuote:()=>Fe,bold:()=>Je,channelMention:()=>Qe,codeBlock:()=>_e,createComponent:()=>Nt,formatEmoji:()=>Xe,hideLinkEmbed:()=>Ge,hyperlink:()=>We,inlineCode:()=>Ve,isJSONEncodable:()=>mo,italic:()=>Ue,memberNicknameMention:()=>Ke,quote:()=>je,roleMention:()=>He,spoiler:()=>ze,strikethrough:()=>ke,time:()=>Ye,underscore:()=>qe,userMention:()=>Ze});var Ot={};U(Ot,{RGBPredicate:()=>ot,authorNamePredicate:()=>ft,colorPredicate:()=>Ct,descriptionPredicate:()=>At,embedFieldPredicate:()=>Xt,embedFieldsArrayPredicate:()=>tt,fieldInlinePredicate:()=>Ht,fieldLengthPredicate:()=>Yt,fieldNamePredicate:()=>Y,fieldValuePredicate:()=>Qt,footerTextPredicate:()=>xt,timestampPredicate:()=>yt,titlePredicate:()=>gt,urlPredicate:()=>x,validateFieldLength:()=>et});var m=require("zod"),Y=m.z.string().min(1).max(256),Qt=m.z.string().min(1).max(1024),Ht=m.z.boolean().optional(),Xt=m.z.object({name:Y,value:Qt,inline:Ht}),tt=Xt.array(),Yt=m.z.number().lte(25);function et(e,t){Yt.parse((t?.length??0)+e)}o(et,"validateFieldLength");var ft=Y.nullable(),x=m.z.string().url().nullish(),ot=m.z.number().int().gte(0).lte(255),Ct=m.z.number().int().gte(0).lte(16777215).nullable().or(m.z.tuple([ot,ot,ot])),At=m.z.string().min(1).max(4096).nullable(),xt=m.z.string().min(1).max(2048).nullable(),yt=m.z.union([m.z.number(),m.z.date()]).nullable(),gt=Y.nullable();var te=J(require("fast-deep-equal")),T=class{constructor(t={}){i(this,"data");this.data={...t},t.timestamp&&(this.data.timestamp=new Date(t.timestamp).toISOString())}get fields(){return this.data.fields}get title(){return this.data.title}get description(){return this.data.description}get url(){return this.data.url}get color(){return this.data.color}get timestamp(){return this.data.timestamp}get thumbnail(){if(!!this.data.thumbnail)return{url:this.data.thumbnail.url,proxyURL:this.data.thumbnail.proxy_url,height:this.data.thumbnail.height,width:this.data.thumbnail.width}}get image(){if(!!this.data.image)return{url:this.data.image.url,proxyURL:this.data.image.proxy_url,height:this.data.image.height,width:this.data.image.width}}get video(){return this.data.video}get author(){if(!!this.data.author)return{name:this.data.author.name,url:this.data.author.url,iconURL:this.data.author.icon_url,proxyIconURL:this.data.author.proxy_icon_url}}get provider(){return this.data.provider}get footer(){if(!!this.data.footer)return{text:this.data.footer.text,iconURL:this.data.footer.icon_url,proxyIconURL:this.data.footer.proxy_icon_url}}get length(){return(this.data.title?.length??0)+(this.data.description?.length??0)+(this.data.fields?.reduce((t,n)=>t+n.name.length+n.value.length,0)??0)+(this.data.footer?.text.length??0)+(this.data.author?.name.length??0)}get hexColor(){return typeof this.data.color=="number"?`#${this.data.color.toString(16).padStart(6,"0")}`:this.data.color}addField(t){return this.addFields(t)}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.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}}equals(t){let{image:n,thumbnail:r,...s}=this.data,A=t instanceof T?t.data:t,{image:P,thumbnail:ve,...we}=A;return(0,te.default)(we,s)&&P?.url===n?.url&&ve?.url===r?.url}};o(T,"UnsafeEmbed");var St=class extends T{addFields(...t){return et(t.length,this.fields),super.addFields(...tt.parse(t))}spliceFields(t,n,...r){return et(r.length-n,this.fields),super.spliceFields(t,n,...tt.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(ft.parse(t.name),x.parse(t.iconURL),x.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(Ct.parse(t))}setDescription(t){return super.setDescription(At.parse(t))}setFooter(t){return t===null?super.setFooter(null):(xt.parse(t.text),x.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(x.parse(t))}setThumbnail(t){return super.setThumbnail(x.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(yt.parse(t))}setTitle(t){return super.setTitle(gt.parse(t))}setURL(t){return super.setURL(x.parse(t))}};o(St,"Embed");function _e(e,t){return typeof t=="undefined"?`\`\`\`
1
+ var Ee=Object.create;var I=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var De=(e,t,n)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=e=>I(e,"__esModule",{value:!0}),o=(e,t)=>I(e,"name",{value:t,configurable:!0});var U=(e,t)=>{for(var n in t)I(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Be(t))!$e.call(e,s)&&(n||s!=="default")&&I(e,s,{get:()=>t[s],enumerable:!(r=zt(t,s))||r.enumerable});return e},J=(e,t)=>Kt(Zt(I(e!=null?Ee(Ne(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Le=(e=>(t,n)=>e&&e.get(t)||(n=Kt(Zt({}),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?zt(t,n):t,A=e.length-1,P;A>=0;A--)(P=e[A])&&(s=(r?P(t,n,s):P(s))||s);return r&&s&&I(t,n,s),s};var i=(e,t,n)=>(De(e,typeof t!="symbol"?t+"":t,n),n);var lo={};U(lo,{ActionRow:()=>M,ButtonComponent:()=>F,Component:()=>u,ComponentAssertions:()=>Bt,ContextMenuCommandAssertions:()=>Gt,ContextMenuCommandBuilder:()=>Wt,Embed:()=>St,EmbedAssertions:()=>Ot,Faces:()=>ee,SelectMenuComponent:()=>G,SelectMenuOption:()=>Dt,SlashCommandAssertions:()=>Vt,SlashCommandAttachmentOption:()=>Q,SlashCommandBooleanOption:()=>z,SlashCommandBuilder:()=>X,SlashCommandChannelOption:()=>w,SlashCommandIntegerOption:()=>E,SlashCommandMentionableOption:()=>Z,SlashCommandNumberOption:()=>B,SlashCommandRoleOption:()=>K,SlashCommandStringOption:()=>N,SlashCommandSubcommandBuilder:()=>b,SlashCommandSubcommandGroupBuilder:()=>S,SlashCommandUserOption:()=>H,TimestampStyles:()=>to,UnsafeButtonComponent:()=>R,UnsafeEmbed:()=>T,UnsafeSelectMenuComponent:()=>v,UnsafeSelectMenuOption:()=>c,blockQuote:()=>Fe,bold:()=>Je,channelMention:()=>Qe,codeBlock:()=>_e,createComponent:()=>Nt,formatEmoji:()=>Xe,hideLinkEmbed:()=>Ge,hyperlink:()=>We,inlineCode:()=>Ve,isJSONEncodable:()=>mo,italic:()=>Ue,memberNicknameMention:()=>Ke,quote:()=>je,roleMention:()=>He,spoiler:()=>ze,strikethrough:()=>ke,time:()=>Ye,underscore:()=>qe,userMention:()=>Ze});var Ot={};U(Ot,{RGBPredicate:()=>ot,authorNamePredicate:()=>ft,colorPredicate:()=>Ct,descriptionPredicate:()=>At,embedFieldPredicate:()=>Xt,embedFieldsArrayPredicate:()=>tt,fieldInlinePredicate:()=>Ht,fieldLengthPredicate:()=>Yt,fieldNamePredicate:()=>Y,fieldValuePredicate:()=>Qt,footerTextPredicate:()=>xt,timestampPredicate:()=>yt,titlePredicate:()=>gt,urlPredicate:()=>x,validateFieldLength:()=>et});var m=require("zod"),Y=m.z.string().min(1).max(256),Qt=m.z.string().min(1).max(1024),Ht=m.z.boolean().optional(),Xt=m.z.object({name:Y,value:Qt,inline:Ht}),tt=Xt.array(),Yt=m.z.number().lte(25);function et(e,t){Yt.parse((t?.length??0)+e)}o(et,"validateFieldLength");var ft=Y.nullable(),x=m.z.string().url().nullish(),ot=m.z.number().int().gte(0).lte(255),Ct=m.z.number().int().gte(0).lte(16777215).nullable().or(m.z.tuple([ot,ot,ot])),At=m.z.string().min(1).max(4096).nullable(),xt=m.z.string().min(1).max(2048).nullable(),yt=m.z.union([m.z.number(),m.z.date()]).nullable(),gt=Y.nullable();var te=J(require("fast-deep-equal")),T=class{constructor(t={}){i(this,"data");this.data={...t},t.timestamp&&(this.data.timestamp=new Date(t.timestamp).toISOString())}get fields(){return this.data.fields}get title(){return this.data.title}get description(){return this.data.description}get url(){return this.data.url}get color(){return this.data.color}get timestamp(){return this.data.timestamp}get thumbnail(){if(!!this.data.thumbnail)return{url:this.data.thumbnail.url,proxyURL:this.data.thumbnail.proxy_url,height:this.data.thumbnail.height,width:this.data.thumbnail.width}}get image(){if(!!this.data.image)return{url:this.data.image.url,proxyURL:this.data.image.proxy_url,height:this.data.image.height,width:this.data.image.width}}get video(){return this.data.video}get author(){if(!!this.data.author)return{name:this.data.author.name,url:this.data.author.url,iconURL:this.data.author.icon_url,proxyIconURL:this.data.author.proxy_icon_url}}get provider(){return this.data.provider}get footer(){if(!!this.data.footer)return{text:this.data.footer.text,iconURL:this.data.footer.icon_url,proxyIconURL:this.data.footer.proxy_icon_url}}get length(){return(this.data.title?.length??0)+(this.data.description?.length??0)+(this.data.fields?.reduce((t,n)=>t+n.name.length+n.value.length,0)??0)+(this.data.footer?.text.length??0)+(this.data.author?.name.length??0)}get hexColor(){return typeof this.data.color=="number"?`#${this.data.color.toString(16).padStart(6,"0")}`:this.data.color}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.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}}equals(t){let{image:n,thumbnail:r,...s}=this.data,A=t instanceof T?t.data:t,{image:P,thumbnail:ve,...we}=A;return(0,te.default)(we,s)&&P?.url===n?.url&&ve?.url===r?.url}};o(T,"UnsafeEmbed");var St=class extends T{addFields(...t){return et(t.length,this.fields),super.addFields(...tt.parse(t))}spliceFields(t,n,...r){return et(r.length-n,this.fields),super.spliceFields(t,n,...tt.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(ft.parse(t.name),x.parse(t.iconURL),x.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(Ct.parse(t))}setDescription(t){return super.setDescription(At.parse(t))}setFooter(t){return t===null?super.setFooter(null):(xt.parse(t.text),x.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(x.parse(t))}setThumbnail(t){return super.setThumbnail(x.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(yt.parse(t))}setTitle(t){return super.setTitle(gt.parse(t))}setURL(t){return super.setURL(x.parse(t))}};o(St,"Embed");function _e(e,t){return typeof t=="undefined"?`\`\`\`
2
2
  ${e}\`\`\``:`\`\`\`${e}
3
3
  ${t}\`\`\``}o(_e,"codeBlock");function Ve(e){return`\`${e}\``}o(Ve,"inlineCode");function Ue(e){return`_${e}_`}o(Ue,"italic");function Je(e){return`**${e}**`}o(Je,"bold");function qe(e){return`__${e}__`}o(qe,"underscore");function ke(e){return`~~${e}~~`}o(ke,"strikethrough");function je(e){return`> ${e}`}o(je,"quote");function Fe(e){return`>>> ${e}`}o(Fe,"blockQuote");function Ge(e){return`<${e}>`}o(Ge,"hideLinkEmbed");function We(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(We,"hyperlink");function ze(e){return`||${e}||`}o(ze,"spoiler");function Ze(e){return`<@${e}>`}o(Ze,"userMention");function Ke(e){return`<@!${e}>`}o(Ke,"memberNicknameMention");function Qe(e){return`<#${e}>`}o(Qe,"channelMention");function He(e){return`<@&${e}>`}o(He,"roleMention");function Xe(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Xe,"formatEmoji");function Ye(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(Ye,"time");var to={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},ee=(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))(ee||{});var Bt={};U(Bt,{buttonLabelValidator:()=>Pt,buttonStyleValidator:()=>It,customIdValidator:()=>$,defaultValidator:()=>Rt,disabledValidator:()=>k,emojiValidator:()=>q,labelValueValidator:()=>j,minMaxValidator:()=>it,optionsValidator:()=>oe,placeholderValidator:()=>Tt,urlValidator:()=>wt,validateRequiredButtonParameters:()=>Et,validateRequiredSelectMenuOptionParameters:()=>vt,validateRequiredSelectMenuParameters:()=>Mt});var nt=require("discord-api-types/v9"),l=require("zod"),$=l.z.string().min(1).max(100),q=l.z.object({id:l.z.string(),name:l.z.string(),animated:l.z.boolean()}).partial().strict(),k=l.z.boolean(),Pt=l.z.string().nonempty().max(80),It=l.z.number().int().min(nt.ButtonStyle.Primary).max(nt.ButtonStyle.Link),Tt=l.z.string().max(100),it=l.z.number().int().min(0).max(25),oe=l.z.object({}).array().nonempty();function Mt(e,t){$.parse(t),oe.parse(e)}o(Mt,"validateRequiredSelectMenuParameters");var j=l.z.string().min(1).max(100),Rt=l.z.boolean();function vt(e,t){j.parse(e),j.parse(t)}o(vt,"validateRequiredSelectMenuOptionParameters");var wt=l.z.string().url();function Et(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===nt.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(Et,"validateRequiredButtonParameters");var ne=require("discord-api-types/v9");var u=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(u,"Component");var rt=require("discord-api-types/v9");function Nt(e){if(e instanceof u)return e;switch(e.type){case rt.ComponentType.ActionRow:return new M(e);case rt.ComponentType.Button:return new F(e);case rt.ComponentType.SelectMenu:return new G(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Nt,"createComponent");var at=J(require("fast-deep-equal")),M=class extends u{constructor({components:t,...n}={}){super({type:ne.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Nt(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())}}equals(t){return t instanceof M?(0,at.default)(t.data,this.data)&&(0,at.default)(t.components,this.components):(0,at.default)(t,{...this.data,components:this.components.map(n=>n.toJSON())})}};o(M,"ActionRow");var ie=require("discord-api-types/v9");var $t=J(require("fast-deep-equal")),R=class extends u{constructor(t){super({type:ie.ComponentType.Button,...t})}get style(){return this.data.style}get label(){return this.data.label}get emoji(){return this.data.emoji}get disabled(){return this.data.disabled}get customId(){return this.data.custom_id}get url(){return this.data.url}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}}equals(t){return t instanceof R?(0,$t.default)(t.data,this.data):(0,$t.default)(t,this.data)}};o(R,"UnsafeButtonComponent");var F=class extends R{setStyle(t){return super.setStyle(It.parse(t))}setURL(t){return super.setURL(wt.parse(t))}setCustomId(t){return super.setCustomId($.parse(t))}setEmoji(t){return super.setEmoji(q.parse(t))}setDisabled(t=!0){return super.setDisabled(k.parse(t))}setLabel(t){return super.setLabel(Pt.parse(t))}toJSON(){return Et(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(F,"ButtonComponent");var re=require("discord-api-types/v9");var c=class{constructor(t={}){this.data=t}get label(){return this.data.label}get value(){return this.data.value}get description(){return this.data.description}get emoji(){return this.data.emoji}get default(){return this.data.default}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,"UnsafeSelectMenuOption");var st=J(require("fast-deep-equal")),v=class extends u{constructor(t){let{options:n,...r}=t??{};super({type:re.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new c(s))??[]}get placeholder(){return this.data.placeholder}get maxValues(){return this.data.max_values}get minValues(){return this.data.min_values}get customId(){return this.data.custom_id}get disabled(){return this.data.disabled}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())}}equals(t){return t instanceof v?(0,st.default)(t.data,this.data)&&(0,st.default)(t.options,this.options):(0,st.default)(t,{...this.data,options:this.options.map(n=>n.toJSON())})}};o(v,"UnsafeSelectMenuComponent");var G=class extends v{setPlaceholder(t){return super.setPlaceholder(Tt.parse(t))}setMinValues(t){return super.setMinValues(it.parse(t))}setMaxValues(t){return super.setMaxValues(it.parse(t))}setCustomId(t){return super.setCustomId($.parse(t))}setDisabled(t=!0){return super.setDisabled(k.parse(t))}toJSON(){return Mt(this.options,this.customId),super.toJSON()}};o(G,"SelectMenuComponent");var Dt=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(q.parse(t))}toJSON(){return vt(this.label,this.value),super.toJSON()}};o(Dt,"SelectMenuOption");var Vt={};U(Vt,{assertReturnOfBuilder:()=>g,validateDefaultPermission:()=>Lt,validateDescription:()=>lt,validateMaxChoicesLength:()=>_t,validateMaxOptionsLength:()=>f,validateName:()=>mt,validateRequired:()=>dt,validateRequiredParameters:()=>y});var pt=J(require("@sindresorhus/is")),W=require("zod"),eo=W.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function mt(e){eo.parse(e)}o(mt,"validateName");var oo=W.z.string().min(1).max(100);function lt(e){oo.parse(e)}o(lt,"validateDescription");var ae=W.z.unknown().array().max(25);function f(e){ae.parse(e)}o(f,"validateMaxOptionsLength");function y(e,t,n){mt(e),lt(t),f(n)}o(y,"validateRequiredParameters");var se=W.z.boolean();function Lt(e){se.parse(e)}o(Lt,"validateDefaultPermission");function dt(e){se.parse(e)}o(dt,"validateRequired");function _t(e){ae.parse(e)}o(_t,"validateMaxChoicesLength");function g(e,t){let n=t.name;if(pt.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(pt.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=pt.default.function_(e)?e.name:r.constructor.name,A=Reflect.get(r,Symbol.toStringTag),P=A?`${s} [${A}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${P} instead.`)}}o(g,"assertReturnOfBuilder");var Re=require("ts-mixer");var pe=require("discord-api-types/v9");var C=class{constructor(){i(this,"name");i(this,"description")}setName(t){return mt(t),Reflect.set(this,"name",t),this}setDescription(t){return lt(t),Reflect.set(this,"description",t),this}};o(C,"SharedNameAndDescription");var p=class extends C{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return dt(t),Reflect.set(this,"required",t),this}runRequiredValidations(){y(this.name,this.description,[]),dt(this.required)}};o(p,"ApplicationCommandOptionBase");var z=class extends p{constructor(){super(...arguments);i(this,"type",pe.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(z,"SlashCommandBooleanOption");var me=require("discord-api-types/v9"),le=require("ts-mixer");var h=require("discord-api-types/v9"),Ut=require("zod"),no=[h.ChannelType.GuildText,h.ChannelType.GuildVoice,h.ChannelType.GuildCategory,h.ChannelType.GuildNews,h.ChannelType.GuildStore,h.ChannelType.GuildNewsThread,h.ChannelType.GuildPublicThread,h.ChannelType.GuildPrivateThread,h.ChannelType.GuildStageVoice],io=Ut.z.union(no.map(e=>Ut.z.literal(e))),ut=class{constructor(){i(this,"channel_types")}addChannelType(t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),io.parse(t),this.channel_types.push(t),this}addChannelTypes(t){return t.forEach(n=>this.addChannelType(n)),this}};o(ut,"ApplicationCommandOptionChannelTypesMixin");var w=class extends p{constructor(){super(...arguments);i(this,"type",me.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(w,"SlashCommandChannelOption"),w=d([(0,le.mix)(ut)],w);var he=require("discord-api-types/v9"),be=require("ts-mixer"),fe=require("zod");var D=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(D,"ApplicationCommandNumericOptionMinMaxValueMixin");var de=require("discord-api-types/v9"),L=require("zod");var ct=L.z.string().min(1).max(100),ue=L.z.number().gt(-1/0).lt(1/0),ce=L.z.object({name:ct,value:L.z.union([ct,ue])}).array(),ro=L.z.boolean(),O=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoice(t){let{name:n,value:r}=t;if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),_t(this.choices),ct.parse(n),this.type===de.ApplicationCommandOptionType.String?ct.parse(r):ue.parse(r),this.choices.push({name:n,value:r}),this}addChoices(...t){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");ce.parse(t);for(let n of t)this.addChoice(n);return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");ce.parse(t),Reflect.set(this,"choices",[]);for(let n of t)this.addChoice(n);return this}setAutocomplete(t){if(ro.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(O,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var Ce=fe.z.number().int(),E=class extends p{constructor(){super(...arguments);i(this,"type",he.ApplicationCommandOptionType.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(E,"SlashCommandIntegerOption"),E=d([(0,be.mix)(D,O)],E);var Ae=require("discord-api-types/v9");var Z=class extends p{constructor(){super(...arguments);i(this,"type",Ae.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Z,"SlashCommandMentionableOption");var xe=require("discord-api-types/v9"),ye=require("ts-mixer"),ge=require("zod");var Oe=ge.z.number(),B=class extends p{constructor(){super(...arguments);i(this,"type",xe.ApplicationCommandOptionType.Number)}setMaxValue(t){return Oe.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return Oe.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(B,"SlashCommandNumberOption"),B=d([(0,ye.mix)(D,O)],B);var Se=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",Se.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandRoleOption");var Pe=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",Pe.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandAttachmentOption");var Ie=require("discord-api-types/v9"),Te=require("ts-mixer");var N=class extends p{constructor(){super(...arguments);i(this,"type",Ie.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,Te.mix)(O)],N);var Me=require("discord-api-types/v9");var H=class extends p{constructor(){super(...arguments);i(this,"type",Me.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(H,"SlashCommandUserOption");var _=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,z)}addUserOption(t){return this._sharedAddOptionMethod(t,H)}addChannelOption(t){return this._sharedAddOptionMethod(t,w)}addRoleOption(t){return this._sharedAddOptionMethod(t,K)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,Q)}addMentionableOption(t){return this._sharedAddOptionMethod(t,Z)}addStringOption(t){return this._sharedAddOptionMethod(t,N)}addIntegerOption(t){return this._sharedAddOptionMethod(t,E)}addNumberOption(t){return this._sharedAddOptionMethod(t,B)}_sharedAddOptionMethod(t,n){let{options:r}=this;f(r);let s=typeof t=="function"?t(new n):t;return g(s,n),r.push(s),this}};o(_,"SharedSlashCommandOptions");var Jt=require("discord-api-types/v9"),qt=require("ts-mixer");var S=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 b):t;return g(r,b),n.push(r),this}toJSON(){return y(this.name,this.description,this.options),{type:Jt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(S,"SlashCommandSubcommandGroupBuilder"),S=d([(0,qt.mix)(C)],S);var b=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return y(this.name,this.description,this.options),{type:Jt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(b,"SlashCommandSubcommandBuilder"),b=d([(0,qt.mix)(C,_)],b);var X=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return y(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 Lt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new S):t;return g(r,S),n.push(r),this}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new b):t;return g(r,b),n.push(r),this}};o(X,"SlashCommandBuilder"),X=d([(0,Re.mix)(_,C)],X);var Gt={};U(Gt,{validateDefaultPermission:()=>jt,validateName:()=>ht,validateRequiredParameters:()=>Ft,validateType:()=>bt});var V=require("zod"),kt=require("discord-api-types/v9"),ao=V.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),so=V.z.union([V.z.literal(kt.ApplicationCommandType.User),V.z.literal(kt.ApplicationCommandType.Message)]),po=V.z.boolean();function jt(e){po.parse(e)}o(jt,"validateDefaultPermission");function ht(e){ao.parse(e)}o(ht,"validateName");function bt(e){so.parse(e)}o(bt,"validateType");function Ft(e,t){ht(e),bt(t)}o(Ft,"validateRequiredParameters");var Wt=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return ht(t),Reflect.set(this,"name",t),this}setType(t){return bt(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return jt(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Ft(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(Wt,"ContextMenuCommandBuilder");function mo(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(mo,"isJSONEncodable");module.exports=Le(lo);0&&(module.exports={ActionRow,ButtonComponent,Component,ComponentAssertions,ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SelectMenuComponent,SelectMenuOption,SlashCommandAssertions,SlashCommandAttachmentOption,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,UnsafeButtonComponent,UnsafeEmbed,UnsafeSelectMenuComponent,UnsafeSelectMenuOption,blockQuote,bold,channelMention,codeBlock,createComponent,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,isJSONEncodable,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/messages/embed/Assertions.ts","../src/messages/embed/UnsafeEmbed.ts","../src/messages/embed/Embed.ts","../src/messages/formatters.ts","../src/components/Assertions.ts","../src/components/ActionRow.ts","../src/components/Component.ts","../src/components/Components.ts","../src/components/button/UnsafeButton.ts","../src/components/button/Button.ts","../src/components/selectMenu/UnsafeSelectMenu.ts","../src/components/selectMenu/UnsafeSelectMenuOption.ts","../src/components/selectMenu/SelectMenu.ts","../src/components/selectMenu/SelectMenuOption.ts","../src/interactions/slashCommands/Assertions.ts","../src/interactions/slashCommands/SlashCommandBuilder.ts","../src/interactions/slashCommands/options/boolean.ts","../src/interactions/slashCommands/mixins/NameAndDescription.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts","../src/interactions/slashCommands/options/channel.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts","../src/interactions/slashCommands/options/integer.ts","../src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts","../src/interactions/slashCommands/options/mentionable.ts","../src/interactions/slashCommands/options/number.ts","../src/interactions/slashCommands/options/role.ts","../src/interactions/slashCommands/options/attachment.ts","../src/interactions/slashCommands/options/string.ts","../src/interactions/slashCommands/options/user.ts","../src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts","../src/interactions/slashCommands/SlashCommandSubcommands.ts","../src/interactions/contextMenuCommands/Assertions.ts","../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts","../src/util/jsonEncodable.ts"],"sourcesContent":["export * as EmbedAssertions from './messages/embed/Assertions';\nexport * from './messages/embed/Embed';\nexport * from './messages/formatters';\nexport * from './messages/embed/UnsafeEmbed';\n\nexport * as ComponentAssertions from './components/Assertions';\nexport * from './components/ActionRow';\nexport * from './components/button/Button';\nexport * from './components/Component';\nexport * from './components/Components';\nexport * from './components/selectMenu/SelectMenu';\nexport * from './components/selectMenu/SelectMenuOption';\nexport * from './components/button/UnsafeButton';\nexport * from './components/selectMenu/UnsafeSelectMenu';\nexport * from './components/selectMenu/UnsafeSelectMenuOption';\n\nexport * as SlashCommandAssertions from './interactions/slashCommands/Assertions';\nexport * from './interactions/slashCommands/SlashCommandBuilder';\nexport * from './interactions/slashCommands/SlashCommandSubcommands';\nexport * from './interactions/slashCommands/options/boolean';\nexport * from './interactions/slashCommands/options/channel';\nexport * from './interactions/slashCommands/options/integer';\nexport * from './interactions/slashCommands/options/mentionable';\nexport * from './interactions/slashCommands/options/number';\nexport * from './interactions/slashCommands/options/role';\nexport * from './interactions/slashCommands/options/attachment';\nexport * from './interactions/slashCommands/options/string';\nexport * from './interactions/slashCommands/options/user';\n\nexport * as ContextMenuCommandAssertions from './interactions/contextMenuCommands/Assertions';\nexport * from './interactions/contextMenuCommands/ContextMenuCommandBuilder';\n\nexport * from './util/jsonEncodable';\n","import type { APIEmbedField } from 'discord-api-types/v9';\nimport { z } from 'zod';\n\nexport const fieldNamePredicate = z.string().min(1).max(256);\n\nexport const fieldValuePredicate = z.string().min(1).max(1024);\n\nexport const fieldInlinePredicate = z.boolean().optional();\n\nexport const embedFieldPredicate = z.object({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array();\n\nexport const fieldLengthPredicate = z.number().lte(25);\n\nexport function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void {\n\tfieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable();\n\nexport const urlPredicate = z.string().url().nullish();\n\nexport const RGBPredicate = z.number().int().gte(0).lte(255);\nexport const colorPredicate = z\n\t.number()\n\t.int()\n\t.gte(0)\n\t.lte(0xffffff)\n\t.nullable()\n\t.or(z.tuple([RGBPredicate, RGBPredicate, RGBPredicate]));\n\nexport const descriptionPredicate = z.string().min(1).max(4096).nullable();\n\nexport const footerTextPredicate = z.string().min(1).max(2048).nullable();\n\nexport const timestampPredicate = z.union([z.number(), z.date()]).nullable();\n\nexport const titlePredicate = fieldNamePredicate.nullable();\n","import type {\n\tAPIEmbed,\n\tAPIEmbedAuthor,\n\tAPIEmbedField,\n\tAPIEmbedFooter,\n\tAPIEmbedImage,\n\tAPIEmbedVideo,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../../util/equatable';\nimport isEqual from 'fast-deep-equal';\n\nexport type RGBTuple = [red: number, green: number, blue: number];\n\nexport interface IconData {\n\t/**\n\t * The URL of the icon\n\t */\n\ticonURL?: string;\n\t/**\n\t * The proxy URL of the icon\n\t */\n\tproxyIconURL?: string;\n}\n\nexport type EmbedAuthorData = Omit<APIEmbedAuthor, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedAuthorOptions = Omit<EmbedAuthorData, 'proxyIconURL'>;\n\nexport type EmbedFooterData = Omit<APIEmbedFooter, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedFooterOptions = Omit<EmbedFooterData, 'proxyIconURL'>;\n\nexport interface EmbedImageData extends Omit<APIEmbedImage, 'proxy_url'> {\n\t/**\n\t * The proxy URL for the image\n\t */\n\tproxyURL?: string;\n}\n\n/**\n * Represents a non-validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> {\n\tpublic readonly data: APIEmbed;\n\n\tpublic constructor(data: APIEmbed = {}) {\n\t\tthis.data = { ...data };\n\t\tif (data.timestamp) this.data.timestamp = new Date(data.timestamp).toISOString();\n\t}\n\n\t/**\n\t * An array of fields of this embed\n\t */\n\tpublic get fields() {\n\t\treturn this.data.fields;\n\t}\n\n\t/**\n\t * The embed title\n\t */\n\tpublic get title() {\n\t\treturn this.data.title;\n\t}\n\n\t/**\n\t * The embed description\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The embed URL\n\t */\n\tpublic get url() {\n\t\treturn this.data.url;\n\t}\n\n\t/**\n\t * The embed color\n\t */\n\tpublic get color() {\n\t\treturn this.data.color;\n\t}\n\n\t/**\n\t * The timestamp of the embed in an ISO 8601 format\n\t */\n\tpublic get timestamp() {\n\t\treturn this.data.timestamp;\n\t}\n\n\t/**\n\t * The embed thumbnail data\n\t */\n\tpublic get thumbnail(): EmbedImageData | undefined {\n\t\tif (!this.data.thumbnail) return undefined;\n\t\treturn {\n\t\t\turl: this.data.thumbnail.url,\n\t\t\tproxyURL: this.data.thumbnail.proxy_url,\n\t\t\theight: this.data.thumbnail.height,\n\t\t\twidth: this.data.thumbnail.width,\n\t\t};\n\t}\n\n\t/**\n\t * The embed image data\n\t */\n\tpublic get image(): EmbedImageData | undefined {\n\t\tif (!this.data.image) return undefined;\n\t\treturn {\n\t\t\turl: this.data.image.url,\n\t\t\tproxyURL: this.data.image.proxy_url,\n\t\t\theight: this.data.image.height,\n\t\t\twidth: this.data.image.width,\n\t\t};\n\t}\n\n\t/**\n\t * Received video data\n\t */\n\tpublic get video(): APIEmbedVideo | undefined {\n\t\treturn this.data.video;\n\t}\n\n\t/**\n\t * The embed author data\n\t */\n\tpublic get author(): EmbedAuthorData | undefined {\n\t\tif (!this.data.author) return undefined;\n\t\treturn {\n\t\t\tname: this.data.author.name,\n\t\t\turl: this.data.author.url,\n\t\t\ticonURL: this.data.author.icon_url,\n\t\t\tproxyIconURL: this.data.author.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * Received data about the embed provider\n\t */\n\tpublic get provider() {\n\t\treturn this.data.provider;\n\t}\n\n\t/**\n\t * The embed footer data\n\t */\n\tpublic get footer(): EmbedFooterData | undefined {\n\t\tif (!this.data.footer) return undefined;\n\t\treturn {\n\t\t\ttext: this.data.footer.text,\n\t\t\ticonURL: this.data.footer.icon_url,\n\t\t\tproxyIconURL: this.data.footer.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * The accumulated length for the embed title, description, fields, footer text, and author name\n\t */\n\tpublic get length(): number {\n\t\treturn (\n\t\t\t(this.data.title?.length ?? 0) +\n\t\t\t(this.data.description?.length ?? 0) +\n\t\t\t(this.data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) +\n\t\t\t(this.data.footer?.text.length ?? 0) +\n\t\t\t(this.data.author?.name.length ?? 0)\n\t\t);\n\t}\n\n\t/**\n\t * The hex color of the current color of the embed\n\t */\n\tpublic get hexColor() {\n\t\treturn typeof this.data.color === 'number' ? `#${this.data.color.toString(16).padStart(6, '0')}` : this.data.color;\n\t}\n\n\t/**\n\t * Adds a field to the embed (max 25)\n\t *\n\t * @param field The field to add.\n\t */\n\tpublic addField(field: APIEmbedField): this {\n\t\treturn this.addFields(field);\n\t}\n\n\t/**\n\t * Adds fields to the embed (max 25)\n\t *\n\t * @param fields The fields to add\n\t */\n\tpublic addFields(...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.push(...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes, replaces, or inserts fields in the embed (max 25)\n\t *\n\t * @param index The index to start at\n\t * @param deleteCount The number of fields to remove\n\t * @param fields The replacing field objects\n\t */\n\tpublic spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.splice(index, deleteCount, ...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the embed's fields (max 25).\n\t * @param fields The fields to set\n\t */\n\tpublic setFields(...fields: APIEmbedField[]) {\n\t\tthis.spliceFields(0, this.fields?.length ?? 0, ...fields);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the author of this embed\n\t *\n\t * @param options The options for the author\n\t */\n\tpublic setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.author = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the color of this embed\n\t *\n\t * @param color The color of the embed\n\t */\n\tpublic setColor(color: number | RGBTuple | null): this {\n\t\tif (Array.isArray(color)) {\n\t\t\tconst [red, green, blue] = color;\n\t\t\tthis.data.color = (red << 16) + (green << 8) + blue;\n\t\t\treturn this;\n\t\t}\n\t\tthis.data.color = color ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this embed\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string | null): this {\n\t\tthis.data.description = description ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the footer of this embed\n\t *\n\t * @param options The options for the footer\n\t */\n\tpublic setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.footer = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.footer = { text: options.text, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the image of this embed\n\t *\n\t * @param url The URL of the image\n\t */\n\tpublic setImage(url: string | null): this {\n\t\tthis.data.image = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the thumbnail of this embed\n\t *\n\t * @param url The URL of the thumbnail\n\t */\n\tpublic setThumbnail(url: string | null): this {\n\t\tthis.data.thumbnail = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the timestamp of this embed\n\t *\n\t * @param timestamp The timestamp or date\n\t */\n\tpublic setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\tthis.data.timestamp = timestamp ? new Date(timestamp).toISOString() : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the title of this embed\n\t *\n\t * @param title The title\n\t */\n\tpublic setTitle(title: string | null): this {\n\t\tthis.data.title = title ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL of this embed\n\t *\n\t * @param url The URL\n\t */\n\tpublic setURL(url: string | null): this {\n\t\tthis.data.url = url ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Transforms the embed to a plain object\n\t */\n\tpublic toJSON(): APIEmbed {\n\t\treturn { ...this.data };\n\t}\n\n\tpublic equals(other: UnsafeEmbed | APIEmbed) {\n\t\tconst { image: thisImage, thumbnail: thisThumbnail, ...thisData } = this.data;\n\t\tconst data = other instanceof UnsafeEmbed ? other.data : other;\n\t\tconst { image, thumbnail, ...otherData } = data;\n\t\treturn isEqual(otherData, thisData) && image?.url === thisImage?.url && thumbnail?.url === thisThumbnail?.url;\n\t}\n}\n","import type { APIEmbedField } from 'discord-api-types/v9';\nimport {\n\tauthorNamePredicate,\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedFieldsArrayPredicate,\n\tfooterTextPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\nimport { EmbedAuthorOptions, EmbedFooterOptions, RGBTuple, UnsafeEmbed } from './UnsafeEmbed';\n\n/**\n * Represents a validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class Embed extends UnsafeEmbed {\n\tpublic override addFields(...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.addFields(...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length - deleteCount, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.spliceFields(index, deleteCount, ...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setAuthor(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tauthorNamePredicate.parse(options.name);\n\t\turlPredicate.parse(options.iconURL);\n\t\turlPredicate.parse(options.url);\n\n\t\treturn super.setAuthor(options);\n\t}\n\n\tpublic override setColor(color: number | RGBTuple | null): this {\n\t\t// Data assertions\n\t\treturn super.setColor(colorPredicate.parse(color));\n\t}\n\n\tpublic override setDescription(description: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setDescription(descriptionPredicate.parse(description));\n\t}\n\n\tpublic override setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setFooter(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tfooterTextPredicate.parse(options.text);\n\t\turlPredicate.parse(options.iconURL);\n\n\t\treturn super.setFooter(options);\n\t}\n\n\tpublic override setImage(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setImage(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setThumbnail(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setThumbnail(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\t// Data assertions\n\t\treturn super.setTimestamp(timestampPredicate.parse(timestamp));\n\t}\n\n\tpublic override setTitle(title: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setTitle(titlePredicate.parse(title));\n\t}\n\n\tpublic override setURL(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setURL(urlPredicate.parse(url)!);\n\t}\n}\n","import type { Snowflake } from 'discord-api-types/globals';\nimport type { URL } from 'url';\n\n/**\n * Wraps the content inside a codeblock with no language\n *\n * @param content The content to wrap\n */\nexport function codeBlock<C extends string>(content: C): `\\`\\`\\`\\n${C}\\`\\`\\``;\n\n/**\n * Wraps the content inside a codeblock with the specified language\n *\n * @param language The language for the codeblock\n * @param content The content to wrap\n */\nexport function codeBlock<L extends string, C extends string>(language: L, content: C): `\\`\\`\\`${L}\\n${C}\\`\\`\\``;\nexport function codeBlock(language: string, content?: string): string {\n\treturn typeof content === 'undefined' ? `\\`\\`\\`\\n${language}\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\`, which formats it as inline code\n *\n * @param content The content to wrap\n */\nexport function inlineCode<C extends string>(content: C): `\\`${C}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text\n *\n * @param content The content to wrap\n */\nexport function italic<C extends string>(content: C): `_${C}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text\n *\n * @param content The content to wrap\n */\nexport function bold<C extends string>(content: C): `**${C}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underscored text\n *\n * @param content The content to wrap\n */\nexport function underscore<C extends string>(content: C): `__${C}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text\n *\n * @param content The content to wrap\n */\nexport function strikethrough<C extends string>(content: C): `~~${C}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function quote<C extends string>(content: C): `> ${C}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function blockQuote<C extends string>(content: C): `>>> ${C}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed<C extends string>(url: C): `<${C}>`;\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\nexport function hideLinkEmbed(url: string | URL) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, T extends string>(\n\tcontent: C,\n\turl: URL,\n\ttitle: T,\n): `[${C}](${string} \"${T}\")`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, U extends string, T extends string>(\n\tcontent: C,\n\turl: U,\n\ttitle: T,\n): `[${C}](${U} \"${T}\")`;\nexport function hyperlink(content: string, url: string | URL, title?: string) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Wraps the content inside spoiler (hidden text)\n *\n * @param content The content to wrap\n */\nexport function spoiler<C extends string>(content: C): `||${C}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user ID into a user mention\n *\n * @param userId The user ID to format\n */\nexport function userMention<C extends Snowflake>(userId: C): `<@${C}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a user ID into a member-nickname mention\n *\n * @param memberId The user ID to format\n */\nexport function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C}>` {\n\treturn `<@!${memberId}>`;\n}\n\n/**\n * Formats a channel ID into a channel mention\n *\n * @param channelId The channel ID to format\n */\nexport function channelMention<C extends Snowflake>(channelId: C): `<#${C}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role ID into a role mention\n *\n * @param roleId The role ID to format\n */\nexport function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated = false): `<a:_:${C}>` | `<:_:${C}>` {\n\treturn `<${animated ? 'a' : ''}:_:${emojiId}>`;\n}\n\n/**\n * Formats a date into a short date-time string\n *\n * @param date The date to format, defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style\n *\n * @param date The date to format\n * @param style The style to use\n */\nexport function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n */\nexport function time<C extends number>(seconds: C): `<t:${C}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n * @param style The style to use\n */\nexport function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;\nexport function time(timeOrSeconds?: number | Date, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes, e.g. 16:20\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year, e.g. 20/04/2021\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year, e.g. 20 April 2021\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format, e.g. 2 months ago\n\t */\n\tRelativeTime: 'R',\n} as const;\n\n/**\n * The possible values, see {@link TimestampStyles} for more information\n */\nexport type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];\n\n/**\n * An enum with all the available faces from Discord's native slash commands\n */\nexport enum Faces {\n\t/**\n\t * ¯\\\\_(ツ)\\\\_/¯\n\t */\n\tShrug = '¯\\\\_(ツ)\\\\_/¯',\n\n\t/**\n\t * (╯°□°)╯︵ ┻━┻\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * ┬─┬ ノ( ゜-゜ノ)\n\t */\n\tUnflip = '┬─┬ ノ( ゜-゜ノ)',\n}\n","import { APIMessageComponentEmoji, ButtonStyle } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { SelectMenuOption } from './selectMenu/SelectMenuOption';\n\nexport const customIdValidator = z.string().min(1).max(100);\n\nexport const emojiValidator = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tanimated: z.boolean(),\n\t})\n\t.partial()\n\t.strict();\n\nexport const disabledValidator = z.boolean();\n\nexport const buttonLabelValidator = z.string().nonempty().max(80);\n\nexport const buttonStyleValidator = z.number().int().min(ButtonStyle.Primary).max(ButtonStyle.Link);\n\nexport const placeholderValidator = z.string().max(100);\nexport const minMaxValidator = z.number().int().min(0).max(25);\n\nexport const optionsValidator = z.object({}).array().nonempty();\n\nexport function validateRequiredSelectMenuParameters(options: SelectMenuOption[], customId?: string) {\n\tcustomIdValidator.parse(customId);\n\toptionsValidator.parse(options);\n}\n\nexport const labelValueValidator = z.string().min(1).max(100);\nexport const defaultValidator = z.boolean();\n\nexport function validateRequiredSelectMenuOptionParameters(label?: string, value?: string) {\n\tlabelValueValidator.parse(label);\n\tlabelValueValidator.parse(value);\n}\n\nexport const urlValidator = z.string().url();\n\nexport function validateRequiredButtonParameters(\n\tstyle?: ButtonStyle,\n\tlabel?: string,\n\temoji?: APIMessageComponentEmoji,\n\tcustomId?: string,\n\turl?: string,\n) {\n\tif (url && customId) {\n\t\tthrow new RangeError('URL and custom id are mutually exclusive');\n\t}\n\n\tif (!label && !emoji) {\n\t\tthrow new RangeError('Buttons must have a label and/or an emoji');\n\t}\n\n\tif (style === ButtonStyle.Link) {\n\t\tif (!url) {\n\t\t\tthrow new RangeError('Link buttons must have a url');\n\t\t}\n\t} else if (url) {\n\t\tthrow new RangeError('Non-link buttons cannot have a url');\n\t}\n}\n","import { type APIActionRowComponent, ComponentType, APIMessageComponent } from 'discord-api-types/v9';\nimport type { ButtonComponent, SelectMenuComponent } from '..';\nimport { Component } from './Component';\nimport { createComponent } from './Components';\nimport isEqual from 'fast-deep-equal';\n\nexport type MessageComponent = ActionRowComponent | ActionRow;\n\nexport type ActionRowComponent = ButtonComponent | SelectMenuComponent;\n\n// TODO: Add valid form component types\n/**\n * Represents an action row component\n */\nexport class ActionRow<T extends ActionRowComponent = ActionRowComponent> extends Component<\n\tOmit<Partial<APIActionRowComponent<APIMessageComponent>> & { type: ComponentType.ActionRow }, 'components'>\n> {\n\t/**\n\t * The components within this action row\n\t */\n\tpublic readonly components: T[];\n\n\tpublic constructor({ components, ...data }: Partial<APIActionRowComponent<APIMessageComponent>> = {}) {\n\t\tsuper({ type: ComponentType.ActionRow, ...data });\n\t\tthis.components = (components?.map((c) => createComponent(c)) ?? []) as T[];\n\t}\n\n\t/**\n\t * Adds components to this action row.\n\t * @param components The components to add to this action row.\n\t * @returns\n\t */\n\tpublic addComponents(...components: T[]) {\n\t\tthis.components.push(...components);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the components in this action row\n\t * @param components The components to set this row to\n\t */\n\tpublic setComponents(...components: T[]) {\n\t\tthis.components.splice(0, this.components.length, ...components);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIActionRowComponent<APIMessageComponent> {\n\t\treturn {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t};\n\t}\n\n\tpublic equals(other: APIActionRowComponent<APIMessageComponent> | ActionRow) {\n\t\tif (other instanceof ActionRow) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.components, this.components);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t});\n\t}\n}\n","import type { JSONEncodable } from '../util/jsonEncodable';\nimport type {\n\tAPIActionRowComponentTypes,\n\tAPIBaseComponent,\n\tAPIMessageComponent,\n\tComponentType,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../util/equatable';\n\n/**\n * Represents a discord component\n */\nexport abstract class Component<\n\tDataType extends Partial<APIBaseComponent<ComponentType>> & {\n\t\ttype: ComponentType;\n\t} = APIBaseComponent<ComponentType>,\n> implements JSONEncodable<APIMessageComponent>, Equatable<Component | APIActionRowComponentTypes>\n{\n\t/**\n\t * The API data associated with this component\n\t */\n\tpublic readonly data: DataType;\n\n\tpublic abstract toJSON(): APIMessageComponent;\n\n\tpublic abstract equals(other: Component | APIActionRowComponentTypes): boolean;\n\n\tpublic constructor(data: DataType) {\n\t\tthis.data = data;\n\t}\n\n\t/**\n\t * The type of this component\n\t */\n\tpublic get type(): DataType['type'] {\n\t\treturn this.data.type;\n\t}\n}\n","import { APIMessageComponent, ComponentType } from 'discord-api-types/v9';\nimport { ActionRow, ButtonComponent, Component, SelectMenuComponent } from '../index';\nimport type { MessageComponent } from './ActionRow';\n\nexport interface MappedComponentTypes {\n\t[ComponentType.ActionRow]: ActionRow;\n\t[ComponentType.Button]: ButtonComponent;\n\t[ComponentType.SelectMenu]: SelectMenuComponent;\n}\n\n/**\n * Factory for creating components from API data\n * @param data The api data to transform to a component class\n */\nexport function createComponent<T extends keyof MappedComponentTypes>(\n\tdata: APIMessageComponent & { type: T },\n): MappedComponentTypes[T];\nexport function createComponent<C extends MessageComponent>(data: C): C;\nexport function createComponent(data: APIMessageComponent | MessageComponent): Component {\n\tif (data instanceof Component) {\n\t\treturn data;\n\t}\n\n\tswitch (data.type) {\n\t\tcase ComponentType.ActionRow:\n\t\t\treturn new ActionRow(data);\n\t\tcase ComponentType.Button:\n\t\t\treturn new ButtonComponent(data);\n\t\tcase ComponentType.SelectMenu:\n\t\t\treturn new SelectMenuComponent(data);\n\t\tdefault:\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Cannot serialize component type: ${data.type as number}`);\n\t}\n}\n","import {\n\tComponentType,\n\tButtonStyle,\n\ttype APIMessageComponentEmoji,\n\ttype APIButtonComponent,\n\ttype APIButtonComponentWithURL,\n\ttype APIButtonComponentWithCustomId,\n} from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated button component\n */\nexport class UnsafeButtonComponent extends Component<Partial<APIButtonComponent> & { type: ComponentType.Button }> {\n\tpublic constructor(data?: Partial<APIButtonComponent>) {\n\t\tsuper({ type: ComponentType.Button, ...data });\n\t}\n\n\t/**\n\t * The style of this button\n\t */\n\tpublic get style() {\n\t\treturn this.data.style;\n\t}\n\n\t/**\n\t * The label of this button\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The emoji used in this button\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this button is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * The custom id of this button (only defined on non-link buttons)\n\t */\n\tpublic get customId(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithCustomId).custom_id;\n\t}\n\n\t/**\n\t * The URL of this button (only defined on link buttons)\n\t */\n\tpublic get url(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithURL).url;\n\t}\n\n\t/**\n\t * Sets the style of this button\n\t * @param style The style of the button\n\t */\n\tpublic setStyle(style: ButtonStyle) {\n\t\tthis.data.style = style;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL for this button\n\t * @param url The URL to open when this button is clicked\n\t */\n\tpublic setURL(url: string) {\n\t\t(this.data as APIButtonComponentWithURL).url = url;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this button\n\t * @param customId The custom id to use for this button\n\t */\n\tpublic setCustomId(customId: string) {\n\t\t(this.data as APIButtonComponentWithCustomId).custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this button is disable or not\n\t * @param disabled Whether or not to disable this button or not\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the label for this button\n\t * @param label The label to display on this button\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIButtonComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APIButtonComponent;\n\t}\n\n\tpublic equals(other: APIButtonComponent | UnsafeButtonComponent) {\n\t\tif (other instanceof UnsafeButtonComponent) {\n\t\t\treturn isEqual(other.data, this.data);\n\t\t}\n\t\treturn isEqual(other, this.data);\n\t}\n}\n","import type { ButtonStyle, APIMessageComponentEmoji, APIButtonComponent } from 'discord-api-types/v9';\nimport {\n\tbuttonLabelValidator,\n\tbuttonStyleValidator,\n\tcustomIdValidator,\n\tdisabledValidator,\n\temojiValidator,\n\turlValidator,\n\tvalidateRequiredButtonParameters,\n} from '../Assertions';\nimport { UnsafeButtonComponent } from './UnsafeButton';\n\n/**\n * Represents a validated button component\n */\nexport class ButtonComponent extends UnsafeButtonComponent {\n\tpublic override setStyle(style: ButtonStyle) {\n\t\treturn super.setStyle(buttonStyleValidator.parse(style));\n\t}\n\n\tpublic override setURL(url: string) {\n\t\treturn super.setURL(urlValidator.parse(url));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override setLabel(label: string) {\n\t\treturn super.setLabel(buttonLabelValidator.parse(label));\n\t}\n\n\tpublic override toJSON(): APIButtonComponent {\n\t\tvalidateRequiredButtonParameters(this.style, this.label, this.emoji, this.customId, this.url);\n\t\treturn super.toJSON();\n\t}\n}\n","import { APISelectMenuOption, ComponentType, type APISelectMenuComponent } from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated select menu component\n */\nexport class UnsafeSelectMenuComponent extends Component<\n\tPartial<Omit<APISelectMenuComponent, 'options'>> & { type: ComponentType.SelectMenu }\n> {\n\t/**\n\t * The options within this select menu\n\t */\n\tpublic readonly options: UnsafeSelectMenuOption[];\n\n\tpublic constructor(data?: Partial<APISelectMenuComponent>) {\n\t\tconst { options, ...initData } = data ?? {};\n\t\tsuper({ type: ComponentType.SelectMenu, ...initData });\n\t\tthis.options = options?.map((o) => new UnsafeSelectMenuOption(o)) ?? [];\n\t}\n\n\t/**\n\t * The placeholder for this select menu\n\t */\n\tpublic get placeholder() {\n\t\treturn this.data.placeholder;\n\t}\n\n\t/**\n\t * The maximum amount of options that can be selected\n\t */\n\tpublic get maxValues() {\n\t\treturn this.data.max_values;\n\t}\n\n\t/**\n\t * The minimum amount of options that must be selected\n\t */\n\tpublic get minValues() {\n\t\treturn this.data.min_values;\n\t}\n\n\t/**\n\t * The custom id of this select menu\n\t */\n\tpublic get customId() {\n\t\treturn this.data.custom_id;\n\t}\n\n\t/**\n\t * Whether this select menu is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * Sets the placeholder for this select menu\n\t * @param placeholder The placeholder to use for this select menu\n\t */\n\tpublic setPlaceholder(placeholder: string) {\n\t\tthis.data.placeholder = placeholder;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the minimum values that must be selected in the select menu\n\t * @param minValues The minimum values that must be selected\n\t */\n\tpublic setMinValues(minValues: number) {\n\t\tthis.data.min_values = minValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the maximum values that must be selected in the select menu\n\t * @param minValues The maximum values that must be selected\n\t */\n\tpublic setMaxValues(maxValues: number) {\n\t\tthis.data.max_values = maxValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this select menu\n\t * @param customId The custom id to use for this select menu\n\t */\n\tpublic setCustomId(customId: string) {\n\t\tthis.data.custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether or not this select menu is disabled\n\t * @param disabled Whether or not this select menu is disabled\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds options to this select menu\n\t * @param options The options to add to this select menu\n\t * @returns\n\t */\n\tpublic addOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.push(\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the options on this select menu\n\t * @param options The options to set on this select menu\n\t */\n\tpublic setOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.splice(\n\t\t\t0,\n\t\t\tthis.options.length,\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t} as APISelectMenuComponent;\n\t}\n\n\tpublic equals(other: APISelectMenuComponent | UnsafeSelectMenuComponent): boolean {\n\t\tif (other instanceof UnsafeSelectMenuComponent) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.options, this.options);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t});\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\n\n/**\n * Represents a non-validated option within a select menu component\n */\nexport class UnsafeSelectMenuOption {\n\tpublic constructor(protected data: Partial<APISelectMenuOption> = {}) {}\n\n\t/**\n\t * The label for this option\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The value for this option\n\t */\n\tpublic get value() {\n\t\treturn this.data.value;\n\t}\n\n\t/**\n\t * The description for this option\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The emoji for this option\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this option is selected by default\n\t */\n\tpublic get default() {\n\t\treturn this.data.default;\n\t}\n\n\t/**\n\t * Sets the label of this option\n\t * @param label The label to show on this option\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value of this option\n\t * @param value The value of this option\n\t */\n\tpublic setValue(value: string) {\n\t\tthis.data.value = value;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this option.\n\t * @param description The description of this option\n\t */\n\tpublic setDescription(description: string) {\n\t\tthis.data.description = description;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this option is selected by default\n\t * @param isDefault Whether this option is selected by default\n\t */\n\tpublic setDefault(isDefault = true) {\n\t\tthis.data.default = isDefault;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuOption {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APISelectMenuOption;\n\t}\n}\n","import type { APISelectMenuComponent } from 'discord-api-types/v9';\nimport {\n\tcustomIdValidator,\n\tdisabledValidator,\n\tminMaxValidator,\n\tplaceholderValidator,\n\tvalidateRequiredSelectMenuParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuComponent } from './UnsafeSelectMenu';\n\n/**\n * Represents a validated select menu component\n */\nexport class SelectMenuComponent extends UnsafeSelectMenuComponent {\n\tpublic override setPlaceholder(placeholder: string) {\n\t\treturn super.setPlaceholder(placeholderValidator.parse(placeholder));\n\t}\n\n\tpublic override setMinValues(minValues: number) {\n\t\treturn super.setMinValues(minMaxValidator.parse(minValues));\n\t}\n\n\tpublic override setMaxValues(maxValues: number) {\n\t\treturn super.setMaxValues(minMaxValidator.parse(maxValues));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override toJSON(): APISelectMenuComponent {\n\t\tvalidateRequiredSelectMenuParameters(this.options, this.customId);\n\t\treturn super.toJSON();\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\nimport {\n\tdefaultValidator,\n\temojiValidator,\n\tlabelValueValidator,\n\tvalidateRequiredSelectMenuOptionParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\n\n/**\n * Represents a validated option within a select menu component\n */\nexport class SelectMenuOption extends UnsafeSelectMenuOption {\n\tpublic override setDescription(description: string) {\n\t\treturn super.setDescription(labelValueValidator.parse(description));\n\t}\n\n\tpublic override setDefault(isDefault = true) {\n\t\treturn super.setDefault(defaultValidator.parse(isDefault));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override toJSON(): APISelectMenuOption {\n\t\tvalidateRequiredSelectMenuOptionParameters(this.label, this.value);\n\t\treturn super.toJSON();\n\t}\n}\n","import is from '@sindresorhus/is';\nimport type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\nimport type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^[\\P{Lu}\\p{N}_-]+$/u);\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nconst descriptionPredicate = z.string().min(1).max(100);\n\nexport function validateDescription(description: unknown): asserts description is string {\n\tdescriptionPredicate.parse(description);\n}\n\nconst maxArrayLengthPredicate = z.unknown().array().max(25);\n\nexport function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] {\n\tmaxArrayLengthPredicate.parse(options);\n}\n\nexport function validateRequiredParameters(\n\tname: string,\n\tdescription: string,\n\toptions: ToAPIApplicationCommandOptions[],\n) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert description conditions\n\tvalidateDescription(description);\n\n\t// Assert options conditions\n\tvalidateMaxOptionsLength(options);\n}\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateRequired(required: unknown): asserts required is boolean {\n\tbooleanPredicate.parse(required);\n}\n\nexport function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) {\n\tmaxArrayLengthPredicate.parse(choices);\n}\n\nexport function assertReturnOfBuilder<\n\tT extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder,\n>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T {\n\tconst instanceName = ExpectedInstanceOf.name;\n\n\tif (is.nullOrUndefined(input)) {\n\t\tthrow new TypeError(\n\t\t\t`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`,\n\t\t);\n\t}\n\n\tif (is.primitive(input)) {\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);\n\t}\n\n\tif (!(input instanceof ExpectedInstanceOf)) {\n\t\tconst casted = input as Record<PropertyKey, unknown>;\n\n\t\tconst constructorName = is.function_(input) ? input.name : casted.constructor.name;\n\t\tconst stringTag = Reflect.get(casted, Symbol.toStringTag) as string | undefined;\n\n\t\tconst fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;\n\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);\n\t}\n}\n","import type { APIApplicationCommandOption, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport {\n\tassertReturnOfBuilder,\n\tvalidateDefaultPermission,\n\tvalidateMaxOptionsLength,\n\tvalidateRequiredParameters,\n} from './Assertions';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\n@mix(SharedSlashCommandOptions, SharedNameAndDescription)\nexport class SlashCommandBuilder {\n\t/**\n\t * The name of this slash command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this slash command\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this slash command\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand group to this command\n\t *\n\t * @param input A function that returns a subcommand group builder, or an already built builder\n\t */\n\tpublic addSubcommandGroup(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandGroupBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandGroupBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand to this command\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n\nexport interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n\nexport interface SlashCommandSubcommandsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tPick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {}\n\nexport interface SlashCommandOptionsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tSharedSlashCommandOptions,\n\t\tPick<SlashCommandBuilder, 'toJSON'> {}\n\nexport interface ToAPIApplicationCommandOptions {\n\ttoJSON: () => APIApplicationCommandOption;\n}\n","import { APIApplicationCommandBooleanOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandBooleanOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic toJSON(): APIApplicationCommandBooleanOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string): this {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n","import type { APIApplicationCommandBasicOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { validateRequiredParameters, validateRequired } from '../Assertions';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {\n\tpublic abstract readonly type: ApplicationCommandOptionType;\n\n\tpublic readonly required: boolean = false;\n\n\t/**\n\t * Marks the option as required\n\t *\n\t * @param required If this option should be required\n\t */\n\tpublic setRequired(required: boolean) {\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(required);\n\n\t\tReflect.set(this, 'required', required);\n\n\t\treturn this;\n\t}\n\n\tpublic abstract toJSON(): APIApplicationCommandBasicOption;\n\n\tprotected runRequiredValidations() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(this.required);\n\t}\n}\n","import { APIApplicationCommandChannelOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionChannelTypesMixin } from '../mixins/ApplicationCommandOptionChannelTypesMixin';\n\n@mix(ApplicationCommandOptionChannelTypesMixin)\nexport class SlashCommandChannelOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic toJSON(): APIApplicationCommandChannelOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypesMixin {}\n","import { ChannelType } from 'discord-api-types/v9';\nimport { z, ZodLiteral } from 'zod';\n\n// Only allow valid channel types to be used. (This can't be dynamic because const enums are erased at runtime)\nconst allowedChannelTypes = [\n\tChannelType.GuildText,\n\tChannelType.GuildVoice,\n\tChannelType.GuildCategory,\n\tChannelType.GuildNews,\n\tChannelType.GuildStore,\n\tChannelType.GuildNewsThread,\n\tChannelType.GuildPublicThread,\n\tChannelType.GuildPrivateThread,\n\tChannelType.GuildStageVoice,\n] as const;\n\nexport type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];\n\nconst channelTypePredicate = z.union(\n\tallowedChannelTypes.map((type) => z.literal(type)) as [\n\t\tZodLiteral<ChannelType>,\n\t\tZodLiteral<ChannelType>,\n\t\t...ZodLiteral<ChannelType>[]\n\t],\n);\n\nexport class ApplicationCommandOptionChannelTypesMixin {\n\tpublic readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];\n\n\t/**\n\t * Adds a channel type to this option\n\t *\n\t * @param channelType The type of channel to allow\n\t */\n\tpublic addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes) {\n\t\tif (this.channel_types === undefined) {\n\t\t\tReflect.set(this, 'channel_types', []);\n\t\t}\n\n\t\tchannelTypePredicate.parse(channelType);\n\t\tthis.channel_types!.push(channelType);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds channel types to this option\n\t *\n\t * @param channelTypes The channel types to add\n\t */\n\tpublic addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]) {\n\t\tchannelTypes.forEach((channelType) => this.addChannelType(channelType));\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandIntegerOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number().int();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandIntegerOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandIntegerOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandIntegerOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","export abstract class ApplicationCommandNumericOptionMinMaxValueMixin {\n\tpublic readonly max_value?: number;\n\tpublic readonly min_value?: number;\n\n\t/**\n\t * Sets the maximum number value of this option\n\t * @param max The maximum value this option can be\n\t */\n\tpublic abstract setMaxValue(max: number): this;\n\n\t/**\n\t * Sets the minimum number value of this option\n\t * @param min The minimum value this option can be\n\t */\n\tpublic abstract setMinValue(min: number): this;\n}\n","import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport { validateMaxChoicesLength } from '../Assertions';\n\nconst stringPredicate = z.string().min(1).max(100);\nconst numberPredicate = z.number().gt(-Infinity).lt(Infinity);\nconst choicesPredicate = z\n\t.object({ name: stringPredicate, value: z.union([stringPredicate, numberPredicate]) })\n\t.array();\nconst booleanPredicate = z.boolean();\n\nexport class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends string | number> {\n\tpublic readonly choices?: APIApplicationCommandOptionChoice<T>[];\n\tpublic readonly autocomplete?: boolean;\n\n\t// Since this is present and this is a mixin, this is needed\n\tpublic readonly type!: ApplicationCommandOptionType;\n\n\t/**\n\t * Adds a choice for this option\n\t *\n\t * @param choice The choice to add\n\t */\n\tpublic addChoice(choice: APIApplicationCommandOptionChoice<T>): this {\n\t\tconst { name, value } = choice;\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tif (this.choices === undefined) {\n\t\t\tReflect.set(this, 'choices', []);\n\t\t}\n\n\t\tvalidateMaxChoicesLength(this.choices!);\n\n\t\t// Validate name\n\t\tstringPredicate.parse(name);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) {\n\t\t\tstringPredicate.parse(value);\n\t\t} else {\n\t\t\tnumberPredicate.parse(value);\n\t\t}\n\n\t\tthis.choices!.push({ name, value });\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds multiple choices for this option\n\t *\n\t * @param choices The choices to add\n\t */\n\tpublic addChoices(...choices: APIApplicationCommandOptionChoice<T>[]): this {\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tfor (const entry of choices) this.addChoice(entry);\n\t\treturn this;\n\t}\n\n\tpublic setChoices<Input extends APIApplicationCommandOptionChoice<T>[]>(...choices: Input): this {\n\t\tif (choices.length > 0 && this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tReflect.set(this, 'choices', []);\n\t\tfor (const entry of choices) this.addChoice(entry);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Marks the option as autocompletable\n\t * @param autocomplete If this option should be autocompletable\n\t */\n\tpublic setAutocomplete(autocomplete: boolean): this {\n\t\t// Assert that you actually passed a boolean\n\t\tbooleanPredicate.parse(autocomplete);\n\n\t\tif (autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tReflect.set(this, 'autocomplete', autocomplete);\n\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandMentionableOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandMentionableOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic toJSON(): APIApplicationCommandMentionableOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandNumberOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandNumberOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Number as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandNumberOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandNumberOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","import { APIApplicationCommandRoleOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandRoleOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic toJSON(): APIApplicationCommandRoleOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandAttachmentOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandAttachmentOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Attachment as const;\n\n\tpublic toJSON(): APIApplicationCommandAttachmentOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\n@mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandStringOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic toJSON(): APIApplicationCommandStringOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {}\n","import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandUserOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic toJSON(): APIApplicationCommandUserOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { ApplicationCommandOptionBase } from './ApplicationCommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandNumberOption } from '../options/number';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandAttachmentOption } from '../options/attachment';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds an attachment option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addAttachmentOption(\n\t\tinput: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandAttachmentOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput:\n\t\t\t| SlashCommandStringOption\n\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandStringOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandStringOption\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput:\n\t\t\t| SlashCommandIntegerOption\n\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandIntegerOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandIntegerOption\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\t/**\n\t * Adds a number option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addNumberOption(\n\t\tinput:\n\t\t\t| SlashCommandNumberOption\n\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandNumberOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandNumberOption\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandNumberOption);\n\t}\n\n\tprivate _sharedAddOptionMethod<T extends ApplicationCommandOptionBase>(\n\t\tinput:\n\t\t\t| T\n\t\t\t| Omit<T, 'setAutocomplete'>\n\t\t\t| Omit<T, 'addChoice' | 'addChoices'>\n\t\t\t| ((builder: T) => T | Omit<T, 'setAutocomplete'> | Omit<T, 'addChoice' | 'addChoices'>),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit<this, 'addSubcommand' | 'addSubcommandGroup'> : this {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new Instance()) : input;\n\n\t\tassertReturnOfBuilder(result, Instance);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n","import {\n\tAPIApplicationCommandSubcommandGroupOption,\n\tAPIApplicationCommandSubcommandOption,\n\tApplicationCommandOptionType,\n} from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\n\n/**\n * Represents a folder for subcommands\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription)\nexport class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand group\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand group\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The subcommands part of this subcommand group\n\t */\n\tpublic readonly options: SlashCommandSubcommandBuilder[] = [];\n\n\t/**\n\t * Adds a new subcommand to this group\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t) {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandSubcommandGroupOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.SubcommandGroup,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {}\n\n/**\n * Represents a subcommand\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription, SharedSlashCommandOptions)\nexport class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this subcommand\n\t */\n\tpublic readonly options: ApplicationCommandOptionBase[] = [];\n\n\tpublic toJSON(): APIApplicationCommandSubcommandOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.Subcommand,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {}\n","import { z } from 'zod';\nimport { ApplicationCommandType } from 'discord-api-types/v9';\nimport type { ContextMenuCommandType } from './ContextMenuCommandBuilder';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^( *[\\p{L}\\p{N}_-]+ *)+$/u);\n\nconst typePredicate = z.union([z.literal(ApplicationCommandType.User), z.literal(ApplicationCommandType.Message)]);\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nexport function validateType(type: unknown): asserts type is ContextMenuCommandType {\n\ttypePredicate.parse(type);\n}\n\nexport function validateRequiredParameters(name: string, type: number) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert type is valid\n\tvalidateType(type);\n}\n","import { validateRequiredParameters, validateName, validateType, validateDefaultPermission } from './Assertions';\nimport type { ApplicationCommandType, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\n\nexport class ContextMenuCommandBuilder {\n\t/**\n\t * The name of this context menu command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The type of this context menu command\n\t */\n\tpublic readonly type: ContextMenuCommandType = undefined!;\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the type\n\t *\n\t * @param type The type\n\t */\n\tpublic setType(type: ContextMenuCommandType) {\n\t\t// Assert the type is valid\n\t\tvalidateType(type);\n\n\t\tReflect.set(this, 'type', type);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.type);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\ttype: this.type,\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n}\n\nexport type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;\n","export interface JSONEncodable<T> {\n\t/**\n\t * Transforms this object to its JSON format\n\t */\n\ttoJSON: () => T;\n}\n\n/**\n * Indicates if an object is encodable or not.\n * @param maybeEncodable The object to check against\n */\nexport function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n\treturn maybeEncodable !== null && typeof maybeEncodable === 'object' && 'toJSON' in maybeEncodable;\n}\n"],"mappings":"sgCAAA,+oCCAA,oZACA,MAAkB,eAEL,EAAqB,IAAE,SAAS,IAAI,GAAG,IAAI,KAE3C,GAAsB,IAAE,SAAS,IAAI,GAAG,IAAI,MAE5C,GAAuB,IAAE,UAAU,WAEnC,GAAsB,IAAE,OAAO,CAC3C,KAAM,EACN,MAAO,GACP,OAAQ,KAGI,GAA4B,GAAoB,QAEhD,GAAuB,IAAE,SAAS,IAAI,IAE5C,YAA6B,EAAsB,EAAgC,CACzF,GAAqB,MAAO,IAAQ,QAAU,GAAK,GADpC,4BAIT,GAAM,IAAsB,EAAmB,WAEzC,EAAe,IAAE,SAAS,MAAM,UAEhC,GAAe,IAAE,SAAS,MAAM,IAAI,GAAG,IAAI,KAC3C,GAAiB,IAC5B,SACA,MACA,IAAI,GACJ,IAAI,UACJ,WACA,GAAG,IAAE,MAAM,CAAC,GAAc,GAAc,MAE7B,GAAuB,IAAE,SAAS,IAAI,GAAG,IAAI,MAAM,WAEnD,GAAsB,IAAE,SAAS,IAAI,GAAG,IAAI,MAAM,WAElD,GAAqB,IAAE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CQA,YAAyB,EAAmE,CAClG,MAAO,KAAmB,MAAQ,MAAO,IAAmB,UAAY,UAAY,GADrE","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/messages/embed/Assertions.ts","../src/messages/embed/UnsafeEmbed.ts","../src/messages/embed/Embed.ts","../src/messages/formatters.ts","../src/components/Assertions.ts","../src/components/ActionRow.ts","../src/components/Component.ts","../src/components/Components.ts","../src/components/button/UnsafeButton.ts","../src/components/button/Button.ts","../src/components/selectMenu/UnsafeSelectMenu.ts","../src/components/selectMenu/UnsafeSelectMenuOption.ts","../src/components/selectMenu/SelectMenu.ts","../src/components/selectMenu/SelectMenuOption.ts","../src/interactions/slashCommands/Assertions.ts","../src/interactions/slashCommands/SlashCommandBuilder.ts","../src/interactions/slashCommands/options/boolean.ts","../src/interactions/slashCommands/mixins/NameAndDescription.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts","../src/interactions/slashCommands/options/channel.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts","../src/interactions/slashCommands/options/integer.ts","../src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts","../src/interactions/slashCommands/options/mentionable.ts","../src/interactions/slashCommands/options/number.ts","../src/interactions/slashCommands/options/role.ts","../src/interactions/slashCommands/options/attachment.ts","../src/interactions/slashCommands/options/string.ts","../src/interactions/slashCommands/options/user.ts","../src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts","../src/interactions/slashCommands/SlashCommandSubcommands.ts","../src/interactions/contextMenuCommands/Assertions.ts","../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts","../src/util/jsonEncodable.ts"],"sourcesContent":["export * as EmbedAssertions from './messages/embed/Assertions';\nexport * from './messages/embed/Embed';\nexport * from './messages/formatters';\nexport * from './messages/embed/UnsafeEmbed';\n\nexport * as ComponentAssertions from './components/Assertions';\nexport * from './components/ActionRow';\nexport * from './components/button/Button';\nexport * from './components/Component';\nexport * from './components/Components';\nexport * from './components/selectMenu/SelectMenu';\nexport * from './components/selectMenu/SelectMenuOption';\nexport * from './components/button/UnsafeButton';\nexport * from './components/selectMenu/UnsafeSelectMenu';\nexport * from './components/selectMenu/UnsafeSelectMenuOption';\n\nexport * as SlashCommandAssertions from './interactions/slashCommands/Assertions';\nexport * from './interactions/slashCommands/SlashCommandBuilder';\nexport * from './interactions/slashCommands/SlashCommandSubcommands';\nexport * from './interactions/slashCommands/options/boolean';\nexport * from './interactions/slashCommands/options/channel';\nexport * from './interactions/slashCommands/options/integer';\nexport * from './interactions/slashCommands/options/mentionable';\nexport * from './interactions/slashCommands/options/number';\nexport * from './interactions/slashCommands/options/role';\nexport * from './interactions/slashCommands/options/attachment';\nexport * from './interactions/slashCommands/options/string';\nexport * from './interactions/slashCommands/options/user';\n\nexport * as ContextMenuCommandAssertions from './interactions/contextMenuCommands/Assertions';\nexport * from './interactions/contextMenuCommands/ContextMenuCommandBuilder';\n\nexport * from './util/jsonEncodable';\n","import type { APIEmbedField } from 'discord-api-types/v9';\nimport { z } from 'zod';\n\nexport const fieldNamePredicate = z.string().min(1).max(256);\n\nexport const fieldValuePredicate = z.string().min(1).max(1024);\n\nexport const fieldInlinePredicate = z.boolean().optional();\n\nexport const embedFieldPredicate = z.object({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array();\n\nexport const fieldLengthPredicate = z.number().lte(25);\n\nexport function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void {\n\tfieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable();\n\nexport const urlPredicate = z.string().url().nullish();\n\nexport const RGBPredicate = z.number().int().gte(0).lte(255);\nexport const colorPredicate = z\n\t.number()\n\t.int()\n\t.gte(0)\n\t.lte(0xffffff)\n\t.nullable()\n\t.or(z.tuple([RGBPredicate, RGBPredicate, RGBPredicate]));\n\nexport const descriptionPredicate = z.string().min(1).max(4096).nullable();\n\nexport const footerTextPredicate = z.string().min(1).max(2048).nullable();\n\nexport const timestampPredicate = z.union([z.number(), z.date()]).nullable();\n\nexport const titlePredicate = fieldNamePredicate.nullable();\n","import type {\n\tAPIEmbed,\n\tAPIEmbedAuthor,\n\tAPIEmbedField,\n\tAPIEmbedFooter,\n\tAPIEmbedImage,\n\tAPIEmbedVideo,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../../util/equatable';\nimport isEqual from 'fast-deep-equal';\n\nexport type RGBTuple = [red: number, green: number, blue: number];\n\nexport interface IconData {\n\t/**\n\t * The URL of the icon\n\t */\n\ticonURL?: string;\n\t/**\n\t * The proxy URL of the icon\n\t */\n\tproxyIconURL?: string;\n}\n\nexport type EmbedAuthorData = Omit<APIEmbedAuthor, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedAuthorOptions = Omit<EmbedAuthorData, 'proxyIconURL'>;\n\nexport type EmbedFooterData = Omit<APIEmbedFooter, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedFooterOptions = Omit<EmbedFooterData, 'proxyIconURL'>;\n\nexport interface EmbedImageData extends Omit<APIEmbedImage, 'proxy_url'> {\n\t/**\n\t * The proxy URL for the image\n\t */\n\tproxyURL?: string;\n}\n\n/**\n * Represents a non-validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> {\n\tpublic readonly data: APIEmbed;\n\n\tpublic constructor(data: APIEmbed = {}) {\n\t\tthis.data = { ...data };\n\t\tif (data.timestamp) this.data.timestamp = new Date(data.timestamp).toISOString();\n\t}\n\n\t/**\n\t * An array of fields of this embed\n\t */\n\tpublic get fields() {\n\t\treturn this.data.fields;\n\t}\n\n\t/**\n\t * The embed title\n\t */\n\tpublic get title() {\n\t\treturn this.data.title;\n\t}\n\n\t/**\n\t * The embed description\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The embed URL\n\t */\n\tpublic get url() {\n\t\treturn this.data.url;\n\t}\n\n\t/**\n\t * The embed color\n\t */\n\tpublic get color() {\n\t\treturn this.data.color;\n\t}\n\n\t/**\n\t * The timestamp of the embed in an ISO 8601 format\n\t */\n\tpublic get timestamp() {\n\t\treturn this.data.timestamp;\n\t}\n\n\t/**\n\t * The embed thumbnail data\n\t */\n\tpublic get thumbnail(): EmbedImageData | undefined {\n\t\tif (!this.data.thumbnail) return undefined;\n\t\treturn {\n\t\t\turl: this.data.thumbnail.url,\n\t\t\tproxyURL: this.data.thumbnail.proxy_url,\n\t\t\theight: this.data.thumbnail.height,\n\t\t\twidth: this.data.thumbnail.width,\n\t\t};\n\t}\n\n\t/**\n\t * The embed image data\n\t */\n\tpublic get image(): EmbedImageData | undefined {\n\t\tif (!this.data.image) return undefined;\n\t\treturn {\n\t\t\turl: this.data.image.url,\n\t\t\tproxyURL: this.data.image.proxy_url,\n\t\t\theight: this.data.image.height,\n\t\t\twidth: this.data.image.width,\n\t\t};\n\t}\n\n\t/**\n\t * Received video data\n\t */\n\tpublic get video(): APIEmbedVideo | undefined {\n\t\treturn this.data.video;\n\t}\n\n\t/**\n\t * The embed author data\n\t */\n\tpublic get author(): EmbedAuthorData | undefined {\n\t\tif (!this.data.author) return undefined;\n\t\treturn {\n\t\t\tname: this.data.author.name,\n\t\t\turl: this.data.author.url,\n\t\t\ticonURL: this.data.author.icon_url,\n\t\t\tproxyIconURL: this.data.author.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * Received data about the embed provider\n\t */\n\tpublic get provider() {\n\t\treturn this.data.provider;\n\t}\n\n\t/**\n\t * The embed footer data\n\t */\n\tpublic get footer(): EmbedFooterData | undefined {\n\t\tif (!this.data.footer) return undefined;\n\t\treturn {\n\t\t\ttext: this.data.footer.text,\n\t\t\ticonURL: this.data.footer.icon_url,\n\t\t\tproxyIconURL: this.data.footer.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * The accumulated length for the embed title, description, fields, footer text, and author name\n\t */\n\tpublic get length(): number {\n\t\treturn (\n\t\t\t(this.data.title?.length ?? 0) +\n\t\t\t(this.data.description?.length ?? 0) +\n\t\t\t(this.data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) +\n\t\t\t(this.data.footer?.text.length ?? 0) +\n\t\t\t(this.data.author?.name.length ?? 0)\n\t\t);\n\t}\n\n\t/**\n\t * The hex color of the current color of the embed\n\t */\n\tpublic get hexColor() {\n\t\treturn typeof this.data.color === 'number' ? `#${this.data.color.toString(16).padStart(6, '0')}` : this.data.color;\n\t}\n\n\t/**\n\t * Adds fields to the embed (max 25)\n\t *\n\t * @param fields The fields to add\n\t */\n\tpublic addFields(...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.push(...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes, replaces, or inserts fields in the embed (max 25)\n\t *\n\t * @param index The index to start at\n\t * @param deleteCount The number of fields to remove\n\t * @param fields The replacing field objects\n\t */\n\tpublic spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.splice(index, deleteCount, ...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the embed's fields (max 25).\n\t * @param fields The fields to set\n\t */\n\tpublic setFields(...fields: APIEmbedField[]) {\n\t\tthis.spliceFields(0, this.fields?.length ?? 0, ...fields);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the author of this embed\n\t *\n\t * @param options The options for the author\n\t */\n\tpublic setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.author = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the color of this embed\n\t *\n\t * @param color The color of the embed\n\t */\n\tpublic setColor(color: number | RGBTuple | null): this {\n\t\tif (Array.isArray(color)) {\n\t\t\tconst [red, green, blue] = color;\n\t\t\tthis.data.color = (red << 16) + (green << 8) + blue;\n\t\t\treturn this;\n\t\t}\n\t\tthis.data.color = color ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this embed\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string | null): this {\n\t\tthis.data.description = description ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the footer of this embed\n\t *\n\t * @param options The options for the footer\n\t */\n\tpublic setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.footer = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.footer = { text: options.text, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the image of this embed\n\t *\n\t * @param url The URL of the image\n\t */\n\tpublic setImage(url: string | null): this {\n\t\tthis.data.image = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the thumbnail of this embed\n\t *\n\t * @param url The URL of the thumbnail\n\t */\n\tpublic setThumbnail(url: string | null): this {\n\t\tthis.data.thumbnail = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the timestamp of this embed\n\t *\n\t * @param timestamp The timestamp or date\n\t */\n\tpublic setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\tthis.data.timestamp = timestamp ? new Date(timestamp).toISOString() : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the title of this embed\n\t *\n\t * @param title The title\n\t */\n\tpublic setTitle(title: string | null): this {\n\t\tthis.data.title = title ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL of this embed\n\t *\n\t * @param url The URL\n\t */\n\tpublic setURL(url: string | null): this {\n\t\tthis.data.url = url ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Transforms the embed to a plain object\n\t */\n\tpublic toJSON(): APIEmbed {\n\t\treturn { ...this.data };\n\t}\n\n\tpublic equals(other: UnsafeEmbed | APIEmbed) {\n\t\tconst { image: thisImage, thumbnail: thisThumbnail, ...thisData } = this.data;\n\t\tconst data = other instanceof UnsafeEmbed ? other.data : other;\n\t\tconst { image, thumbnail, ...otherData } = data;\n\t\treturn isEqual(otherData, thisData) && image?.url === thisImage?.url && thumbnail?.url === thisThumbnail?.url;\n\t}\n}\n","import type { APIEmbedField } from 'discord-api-types/v9';\nimport {\n\tauthorNamePredicate,\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedFieldsArrayPredicate,\n\tfooterTextPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\nimport { EmbedAuthorOptions, EmbedFooterOptions, RGBTuple, UnsafeEmbed } from './UnsafeEmbed';\n\n/**\n * Represents a validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class Embed extends UnsafeEmbed {\n\tpublic override addFields(...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.addFields(...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length - deleteCount, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.spliceFields(index, deleteCount, ...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setAuthor(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tauthorNamePredicate.parse(options.name);\n\t\turlPredicate.parse(options.iconURL);\n\t\turlPredicate.parse(options.url);\n\n\t\treturn super.setAuthor(options);\n\t}\n\n\tpublic override setColor(color: number | RGBTuple | null): this {\n\t\t// Data assertions\n\t\treturn super.setColor(colorPredicate.parse(color));\n\t}\n\n\tpublic override setDescription(description: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setDescription(descriptionPredicate.parse(description));\n\t}\n\n\tpublic override setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setFooter(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tfooterTextPredicate.parse(options.text);\n\t\turlPredicate.parse(options.iconURL);\n\n\t\treturn super.setFooter(options);\n\t}\n\n\tpublic override setImage(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setImage(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setThumbnail(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setThumbnail(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\t// Data assertions\n\t\treturn super.setTimestamp(timestampPredicate.parse(timestamp));\n\t}\n\n\tpublic override setTitle(title: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setTitle(titlePredicate.parse(title));\n\t}\n\n\tpublic override setURL(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setURL(urlPredicate.parse(url)!);\n\t}\n}\n","import type { Snowflake } from 'discord-api-types/globals';\nimport type { URL } from 'url';\n\n/**\n * Wraps the content inside a codeblock with no language\n *\n * @param content The content to wrap\n */\nexport function codeBlock<C extends string>(content: C): `\\`\\`\\`\\n${C}\\`\\`\\``;\n\n/**\n * Wraps the content inside a codeblock with the specified language\n *\n * @param language The language for the codeblock\n * @param content The content to wrap\n */\nexport function codeBlock<L extends string, C extends string>(language: L, content: C): `\\`\\`\\`${L}\\n${C}\\`\\`\\``;\nexport function codeBlock(language: string, content?: string): string {\n\treturn typeof content === 'undefined' ? `\\`\\`\\`\\n${language}\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\`, which formats it as inline code\n *\n * @param content The content to wrap\n */\nexport function inlineCode<C extends string>(content: C): `\\`${C}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text\n *\n * @param content The content to wrap\n */\nexport function italic<C extends string>(content: C): `_${C}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text\n *\n * @param content The content to wrap\n */\nexport function bold<C extends string>(content: C): `**${C}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underscored text\n *\n * @param content The content to wrap\n */\nexport function underscore<C extends string>(content: C): `__${C}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text\n *\n * @param content The content to wrap\n */\nexport function strikethrough<C extends string>(content: C): `~~${C}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function quote<C extends string>(content: C): `> ${C}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function blockQuote<C extends string>(content: C): `>>> ${C}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed<C extends string>(url: C): `<${C}>`;\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\nexport function hideLinkEmbed(url: string | URL) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, T extends string>(\n\tcontent: C,\n\turl: URL,\n\ttitle: T,\n): `[${C}](${string} \"${T}\")`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, U extends string, T extends string>(\n\tcontent: C,\n\turl: U,\n\ttitle: T,\n): `[${C}](${U} \"${T}\")`;\nexport function hyperlink(content: string, url: string | URL, title?: string) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Wraps the content inside spoiler (hidden text)\n *\n * @param content The content to wrap\n */\nexport function spoiler<C extends string>(content: C): `||${C}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user ID into a user mention\n *\n * @param userId The user ID to format\n */\nexport function userMention<C extends Snowflake>(userId: C): `<@${C}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a user ID into a member-nickname mention\n *\n * @param memberId The user ID to format\n */\nexport function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C}>` {\n\treturn `<@!${memberId}>`;\n}\n\n/**\n * Formats a channel ID into a channel mention\n *\n * @param channelId The channel ID to format\n */\nexport function channelMention<C extends Snowflake>(channelId: C): `<#${C}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role ID into a role mention\n *\n * @param roleId The role ID to format\n */\nexport function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated = false): `<a:_:${C}>` | `<:_:${C}>` {\n\treturn `<${animated ? 'a' : ''}:_:${emojiId}>`;\n}\n\n/**\n * Formats a date into a short date-time string\n *\n * @param date The date to format, defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style\n *\n * @param date The date to format\n * @param style The style to use\n */\nexport function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n */\nexport function time<C extends number>(seconds: C): `<t:${C}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n * @param style The style to use\n */\nexport function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;\nexport function time(timeOrSeconds?: number | Date, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes, e.g. 16:20\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year, e.g. 20/04/2021\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year, e.g. 20 April 2021\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format, e.g. 2 months ago\n\t */\n\tRelativeTime: 'R',\n} as const;\n\n/**\n * The possible values, see {@link TimestampStyles} for more information\n */\nexport type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];\n\n/**\n * An enum with all the available faces from Discord's native slash commands\n */\nexport enum Faces {\n\t/**\n\t * ¯\\\\_(ツ)\\\\_/¯\n\t */\n\tShrug = '¯\\\\_(ツ)\\\\_/¯',\n\n\t/**\n\t * (╯°□°)╯︵ ┻━┻\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * ┬─┬ ノ( ゜-゜ノ)\n\t */\n\tUnflip = '┬─┬ ノ( ゜-゜ノ)',\n}\n","import { APIMessageComponentEmoji, ButtonStyle } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { SelectMenuOption } from './selectMenu/SelectMenuOption';\n\nexport const customIdValidator = z.string().min(1).max(100);\n\nexport const emojiValidator = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tanimated: z.boolean(),\n\t})\n\t.partial()\n\t.strict();\n\nexport const disabledValidator = z.boolean();\n\nexport const buttonLabelValidator = z.string().nonempty().max(80);\n\nexport const buttonStyleValidator = z.number().int().min(ButtonStyle.Primary).max(ButtonStyle.Link);\n\nexport const placeholderValidator = z.string().max(100);\nexport const minMaxValidator = z.number().int().min(0).max(25);\n\nexport const optionsValidator = z.object({}).array().nonempty();\n\nexport function validateRequiredSelectMenuParameters(options: SelectMenuOption[], customId?: string) {\n\tcustomIdValidator.parse(customId);\n\toptionsValidator.parse(options);\n}\n\nexport const labelValueValidator = z.string().min(1).max(100);\nexport const defaultValidator = z.boolean();\n\nexport function validateRequiredSelectMenuOptionParameters(label?: string, value?: string) {\n\tlabelValueValidator.parse(label);\n\tlabelValueValidator.parse(value);\n}\n\nexport const urlValidator = z.string().url();\n\nexport function validateRequiredButtonParameters(\n\tstyle?: ButtonStyle,\n\tlabel?: string,\n\temoji?: APIMessageComponentEmoji,\n\tcustomId?: string,\n\turl?: string,\n) {\n\tif (url && customId) {\n\t\tthrow new RangeError('URL and custom id are mutually exclusive');\n\t}\n\n\tif (!label && !emoji) {\n\t\tthrow new RangeError('Buttons must have a label and/or an emoji');\n\t}\n\n\tif (style === ButtonStyle.Link) {\n\t\tif (!url) {\n\t\t\tthrow new RangeError('Link buttons must have a url');\n\t\t}\n\t} else if (url) {\n\t\tthrow new RangeError('Non-link buttons cannot have a url');\n\t}\n}\n","import { type APIActionRowComponent, ComponentType, APIMessageComponent } from 'discord-api-types/v9';\nimport type { ButtonComponent, SelectMenuComponent } from '..';\nimport { Component } from './Component';\nimport { createComponent } from './Components';\nimport isEqual from 'fast-deep-equal';\n\nexport type MessageComponent = ActionRowComponent | ActionRow;\n\nexport type ActionRowComponent = ButtonComponent | SelectMenuComponent;\n\n// TODO: Add valid form component types\n/**\n * Represents an action row component\n */\nexport class ActionRow<T extends ActionRowComponent = ActionRowComponent> extends Component<\n\tOmit<Partial<APIActionRowComponent<APIMessageComponent>> & { type: ComponentType.ActionRow }, 'components'>\n> {\n\t/**\n\t * The components within this action row\n\t */\n\tpublic readonly components: T[];\n\n\tpublic constructor({ components, ...data }: Partial<APIActionRowComponent<APIMessageComponent>> = {}) {\n\t\tsuper({ type: ComponentType.ActionRow, ...data });\n\t\tthis.components = (components?.map((c) => createComponent(c)) ?? []) as T[];\n\t}\n\n\t/**\n\t * Adds components to this action row.\n\t * @param components The components to add to this action row.\n\t * @returns\n\t */\n\tpublic addComponents(...components: T[]) {\n\t\tthis.components.push(...components);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the components in this action row\n\t * @param components The components to set this row to\n\t */\n\tpublic setComponents(...components: T[]) {\n\t\tthis.components.splice(0, this.components.length, ...components);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIActionRowComponent<APIMessageComponent> {\n\t\treturn {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t};\n\t}\n\n\tpublic equals(other: APIActionRowComponent<APIMessageComponent> | ActionRow) {\n\t\tif (other instanceof ActionRow) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.components, this.components);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t});\n\t}\n}\n","import type { JSONEncodable } from '../util/jsonEncodable';\nimport type {\n\tAPIActionRowComponentTypes,\n\tAPIBaseComponent,\n\tAPIMessageComponent,\n\tComponentType,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../util/equatable';\n\n/**\n * Represents a discord component\n */\nexport abstract class Component<\n\tDataType extends Partial<APIBaseComponent<ComponentType>> & {\n\t\ttype: ComponentType;\n\t} = APIBaseComponent<ComponentType>,\n> implements JSONEncodable<APIMessageComponent>, Equatable<Component | APIActionRowComponentTypes>\n{\n\t/**\n\t * The API data associated with this component\n\t */\n\tpublic readonly data: DataType;\n\n\tpublic abstract toJSON(): APIMessageComponent;\n\n\tpublic abstract equals(other: Component | APIActionRowComponentTypes): boolean;\n\n\tpublic constructor(data: DataType) {\n\t\tthis.data = data;\n\t}\n\n\t/**\n\t * The type of this component\n\t */\n\tpublic get type(): DataType['type'] {\n\t\treturn this.data.type;\n\t}\n}\n","import { APIMessageComponent, ComponentType } from 'discord-api-types/v9';\nimport { ActionRow, ButtonComponent, Component, SelectMenuComponent } from '../index';\nimport type { MessageComponent } from './ActionRow';\n\nexport interface MappedComponentTypes {\n\t[ComponentType.ActionRow]: ActionRow;\n\t[ComponentType.Button]: ButtonComponent;\n\t[ComponentType.SelectMenu]: SelectMenuComponent;\n}\n\n/**\n * Factory for creating components from API data\n * @param data The api data to transform to a component class\n */\nexport function createComponent<T extends keyof MappedComponentTypes>(\n\tdata: APIMessageComponent & { type: T },\n): MappedComponentTypes[T];\nexport function createComponent<C extends MessageComponent>(data: C): C;\nexport function createComponent(data: APIMessageComponent | MessageComponent): Component {\n\tif (data instanceof Component) {\n\t\treturn data;\n\t}\n\n\tswitch (data.type) {\n\t\tcase ComponentType.ActionRow:\n\t\t\treturn new ActionRow(data);\n\t\tcase ComponentType.Button:\n\t\t\treturn new ButtonComponent(data);\n\t\tcase ComponentType.SelectMenu:\n\t\t\treturn new SelectMenuComponent(data);\n\t\tdefault:\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Cannot serialize component type: ${data.type as number}`);\n\t}\n}\n","import {\n\tComponentType,\n\tButtonStyle,\n\ttype APIMessageComponentEmoji,\n\ttype APIButtonComponent,\n\ttype APIButtonComponentWithURL,\n\ttype APIButtonComponentWithCustomId,\n} from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated button component\n */\nexport class UnsafeButtonComponent extends Component<Partial<APIButtonComponent> & { type: ComponentType.Button }> {\n\tpublic constructor(data?: Partial<APIButtonComponent>) {\n\t\tsuper({ type: ComponentType.Button, ...data });\n\t}\n\n\t/**\n\t * The style of this button\n\t */\n\tpublic get style() {\n\t\treturn this.data.style;\n\t}\n\n\t/**\n\t * The label of this button\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The emoji used in this button\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this button is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * The custom id of this button (only defined on non-link buttons)\n\t */\n\tpublic get customId(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithCustomId).custom_id;\n\t}\n\n\t/**\n\t * The URL of this button (only defined on link buttons)\n\t */\n\tpublic get url(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithURL).url;\n\t}\n\n\t/**\n\t * Sets the style of this button\n\t * @param style The style of the button\n\t */\n\tpublic setStyle(style: ButtonStyle) {\n\t\tthis.data.style = style;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL for this button\n\t * @param url The URL to open when this button is clicked\n\t */\n\tpublic setURL(url: string) {\n\t\t(this.data as APIButtonComponentWithURL).url = url;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this button\n\t * @param customId The custom id to use for this button\n\t */\n\tpublic setCustomId(customId: string) {\n\t\t(this.data as APIButtonComponentWithCustomId).custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this button is disable or not\n\t * @param disabled Whether or not to disable this button or not\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the label for this button\n\t * @param label The label to display on this button\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIButtonComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APIButtonComponent;\n\t}\n\n\tpublic equals(other: APIButtonComponent | UnsafeButtonComponent) {\n\t\tif (other instanceof UnsafeButtonComponent) {\n\t\t\treturn isEqual(other.data, this.data);\n\t\t}\n\t\treturn isEqual(other, this.data);\n\t}\n}\n","import type { ButtonStyle, APIMessageComponentEmoji, APIButtonComponent } from 'discord-api-types/v9';\nimport {\n\tbuttonLabelValidator,\n\tbuttonStyleValidator,\n\tcustomIdValidator,\n\tdisabledValidator,\n\temojiValidator,\n\turlValidator,\n\tvalidateRequiredButtonParameters,\n} from '../Assertions';\nimport { UnsafeButtonComponent } from './UnsafeButton';\n\n/**\n * Represents a validated button component\n */\nexport class ButtonComponent extends UnsafeButtonComponent {\n\tpublic override setStyle(style: ButtonStyle) {\n\t\treturn super.setStyle(buttonStyleValidator.parse(style));\n\t}\n\n\tpublic override setURL(url: string) {\n\t\treturn super.setURL(urlValidator.parse(url));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override setLabel(label: string) {\n\t\treturn super.setLabel(buttonLabelValidator.parse(label));\n\t}\n\n\tpublic override toJSON(): APIButtonComponent {\n\t\tvalidateRequiredButtonParameters(this.style, this.label, this.emoji, this.customId, this.url);\n\t\treturn super.toJSON();\n\t}\n}\n","import { APISelectMenuOption, ComponentType, type APISelectMenuComponent } from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated select menu component\n */\nexport class UnsafeSelectMenuComponent extends Component<\n\tPartial<Omit<APISelectMenuComponent, 'options'>> & { type: ComponentType.SelectMenu }\n> {\n\t/**\n\t * The options within this select menu\n\t */\n\tpublic readonly options: UnsafeSelectMenuOption[];\n\n\tpublic constructor(data?: Partial<APISelectMenuComponent>) {\n\t\tconst { options, ...initData } = data ?? {};\n\t\tsuper({ type: ComponentType.SelectMenu, ...initData });\n\t\tthis.options = options?.map((o) => new UnsafeSelectMenuOption(o)) ?? [];\n\t}\n\n\t/**\n\t * The placeholder for this select menu\n\t */\n\tpublic get placeholder() {\n\t\treturn this.data.placeholder;\n\t}\n\n\t/**\n\t * The maximum amount of options that can be selected\n\t */\n\tpublic get maxValues() {\n\t\treturn this.data.max_values;\n\t}\n\n\t/**\n\t * The minimum amount of options that must be selected\n\t */\n\tpublic get minValues() {\n\t\treturn this.data.min_values;\n\t}\n\n\t/**\n\t * The custom id of this select menu\n\t */\n\tpublic get customId() {\n\t\treturn this.data.custom_id;\n\t}\n\n\t/**\n\t * Whether this select menu is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * Sets the placeholder for this select menu\n\t * @param placeholder The placeholder to use for this select menu\n\t */\n\tpublic setPlaceholder(placeholder: string) {\n\t\tthis.data.placeholder = placeholder;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the minimum values that must be selected in the select menu\n\t * @param minValues The minimum values that must be selected\n\t */\n\tpublic setMinValues(minValues: number) {\n\t\tthis.data.min_values = minValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the maximum values that must be selected in the select menu\n\t * @param minValues The maximum values that must be selected\n\t */\n\tpublic setMaxValues(maxValues: number) {\n\t\tthis.data.max_values = maxValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this select menu\n\t * @param customId The custom id to use for this select menu\n\t */\n\tpublic setCustomId(customId: string) {\n\t\tthis.data.custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether or not this select menu is disabled\n\t * @param disabled Whether or not this select menu is disabled\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds options to this select menu\n\t * @param options The options to add to this select menu\n\t * @returns\n\t */\n\tpublic addOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.push(\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the options on this select menu\n\t * @param options The options to set on this select menu\n\t */\n\tpublic setOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.splice(\n\t\t\t0,\n\t\t\tthis.options.length,\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t} as APISelectMenuComponent;\n\t}\n\n\tpublic equals(other: APISelectMenuComponent | UnsafeSelectMenuComponent): boolean {\n\t\tif (other instanceof UnsafeSelectMenuComponent) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.options, this.options);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t});\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\n\n/**\n * Represents a non-validated option within a select menu component\n */\nexport class UnsafeSelectMenuOption {\n\tpublic constructor(protected data: Partial<APISelectMenuOption> = {}) {}\n\n\t/**\n\t * The label for this option\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The value for this option\n\t */\n\tpublic get value() {\n\t\treturn this.data.value;\n\t}\n\n\t/**\n\t * The description for this option\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The emoji for this option\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this option is selected by default\n\t */\n\tpublic get default() {\n\t\treturn this.data.default;\n\t}\n\n\t/**\n\t * Sets the label of this option\n\t * @param label The label to show on this option\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value of this option\n\t * @param value The value of this option\n\t */\n\tpublic setValue(value: string) {\n\t\tthis.data.value = value;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this option.\n\t * @param description The description of this option\n\t */\n\tpublic setDescription(description: string) {\n\t\tthis.data.description = description;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this option is selected by default\n\t * @param isDefault Whether this option is selected by default\n\t */\n\tpublic setDefault(isDefault = true) {\n\t\tthis.data.default = isDefault;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuOption {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APISelectMenuOption;\n\t}\n}\n","import type { APISelectMenuComponent } from 'discord-api-types/v9';\nimport {\n\tcustomIdValidator,\n\tdisabledValidator,\n\tminMaxValidator,\n\tplaceholderValidator,\n\tvalidateRequiredSelectMenuParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuComponent } from './UnsafeSelectMenu';\n\n/**\n * Represents a validated select menu component\n */\nexport class SelectMenuComponent extends UnsafeSelectMenuComponent {\n\tpublic override setPlaceholder(placeholder: string) {\n\t\treturn super.setPlaceholder(placeholderValidator.parse(placeholder));\n\t}\n\n\tpublic override setMinValues(minValues: number) {\n\t\treturn super.setMinValues(minMaxValidator.parse(minValues));\n\t}\n\n\tpublic override setMaxValues(maxValues: number) {\n\t\treturn super.setMaxValues(minMaxValidator.parse(maxValues));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override toJSON(): APISelectMenuComponent {\n\t\tvalidateRequiredSelectMenuParameters(this.options, this.customId);\n\t\treturn super.toJSON();\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\nimport {\n\tdefaultValidator,\n\temojiValidator,\n\tlabelValueValidator,\n\tvalidateRequiredSelectMenuOptionParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\n\n/**\n * Represents a validated option within a select menu component\n */\nexport class SelectMenuOption extends UnsafeSelectMenuOption {\n\tpublic override setDescription(description: string) {\n\t\treturn super.setDescription(labelValueValidator.parse(description));\n\t}\n\n\tpublic override setDefault(isDefault = true) {\n\t\treturn super.setDefault(defaultValidator.parse(isDefault));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override toJSON(): APISelectMenuOption {\n\t\tvalidateRequiredSelectMenuOptionParameters(this.label, this.value);\n\t\treturn super.toJSON();\n\t}\n}\n","import is from '@sindresorhus/is';\nimport type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\nimport type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^[\\P{Lu}\\p{N}_-]+$/u);\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nconst descriptionPredicate = z.string().min(1).max(100);\n\nexport function validateDescription(description: unknown): asserts description is string {\n\tdescriptionPredicate.parse(description);\n}\n\nconst maxArrayLengthPredicate = z.unknown().array().max(25);\n\nexport function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] {\n\tmaxArrayLengthPredicate.parse(options);\n}\n\nexport function validateRequiredParameters(\n\tname: string,\n\tdescription: string,\n\toptions: ToAPIApplicationCommandOptions[],\n) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert description conditions\n\tvalidateDescription(description);\n\n\t// Assert options conditions\n\tvalidateMaxOptionsLength(options);\n}\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateRequired(required: unknown): asserts required is boolean {\n\tbooleanPredicate.parse(required);\n}\n\nexport function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) {\n\tmaxArrayLengthPredicate.parse(choices);\n}\n\nexport function assertReturnOfBuilder<\n\tT extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder,\n>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T {\n\tconst instanceName = ExpectedInstanceOf.name;\n\n\tif (is.nullOrUndefined(input)) {\n\t\tthrow new TypeError(\n\t\t\t`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`,\n\t\t);\n\t}\n\n\tif (is.primitive(input)) {\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);\n\t}\n\n\tif (!(input instanceof ExpectedInstanceOf)) {\n\t\tconst casted = input as Record<PropertyKey, unknown>;\n\n\t\tconst constructorName = is.function_(input) ? input.name : casted.constructor.name;\n\t\tconst stringTag = Reflect.get(casted, Symbol.toStringTag) as string | undefined;\n\n\t\tconst fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;\n\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);\n\t}\n}\n","import type { APIApplicationCommandOption, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport {\n\tassertReturnOfBuilder,\n\tvalidateDefaultPermission,\n\tvalidateMaxOptionsLength,\n\tvalidateRequiredParameters,\n} from './Assertions';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\n@mix(SharedSlashCommandOptions, SharedNameAndDescription)\nexport class SlashCommandBuilder {\n\t/**\n\t * The name of this slash command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this slash command\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this slash command\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand group to this command\n\t *\n\t * @param input A function that returns a subcommand group builder, or an already built builder\n\t */\n\tpublic addSubcommandGroup(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandGroupBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandGroupBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand to this command\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n\nexport interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n\nexport interface SlashCommandSubcommandsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tPick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {}\n\nexport interface SlashCommandOptionsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tSharedSlashCommandOptions,\n\t\tPick<SlashCommandBuilder, 'toJSON'> {}\n\nexport interface ToAPIApplicationCommandOptions {\n\ttoJSON: () => APIApplicationCommandOption;\n}\n","import { APIApplicationCommandBooleanOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandBooleanOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic toJSON(): APIApplicationCommandBooleanOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string): this {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n","import type { APIApplicationCommandBasicOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { validateRequiredParameters, validateRequired } from '../Assertions';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {\n\tpublic abstract readonly type: ApplicationCommandOptionType;\n\n\tpublic readonly required: boolean = false;\n\n\t/**\n\t * Marks the option as required\n\t *\n\t * @param required If this option should be required\n\t */\n\tpublic setRequired(required: boolean) {\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(required);\n\n\t\tReflect.set(this, 'required', required);\n\n\t\treturn this;\n\t}\n\n\tpublic abstract toJSON(): APIApplicationCommandBasicOption;\n\n\tprotected runRequiredValidations() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(this.required);\n\t}\n}\n","import { APIApplicationCommandChannelOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionChannelTypesMixin } from '../mixins/ApplicationCommandOptionChannelTypesMixin';\n\n@mix(ApplicationCommandOptionChannelTypesMixin)\nexport class SlashCommandChannelOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic toJSON(): APIApplicationCommandChannelOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypesMixin {}\n","import { ChannelType } from 'discord-api-types/v9';\nimport { z, ZodLiteral } from 'zod';\n\n// Only allow valid channel types to be used. (This can't be dynamic because const enums are erased at runtime)\nconst allowedChannelTypes = [\n\tChannelType.GuildText,\n\tChannelType.GuildVoice,\n\tChannelType.GuildCategory,\n\tChannelType.GuildNews,\n\tChannelType.GuildStore,\n\tChannelType.GuildNewsThread,\n\tChannelType.GuildPublicThread,\n\tChannelType.GuildPrivateThread,\n\tChannelType.GuildStageVoice,\n] as const;\n\nexport type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];\n\nconst channelTypePredicate = z.union(\n\tallowedChannelTypes.map((type) => z.literal(type)) as [\n\t\tZodLiteral<ChannelType>,\n\t\tZodLiteral<ChannelType>,\n\t\t...ZodLiteral<ChannelType>[]\n\t],\n);\n\nexport class ApplicationCommandOptionChannelTypesMixin {\n\tpublic readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];\n\n\t/**\n\t * Adds a channel type to this option\n\t *\n\t * @param channelType The type of channel to allow\n\t */\n\tpublic addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes) {\n\t\tif (this.channel_types === undefined) {\n\t\t\tReflect.set(this, 'channel_types', []);\n\t\t}\n\n\t\tchannelTypePredicate.parse(channelType);\n\t\tthis.channel_types!.push(channelType);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds channel types to this option\n\t *\n\t * @param channelTypes The channel types to add\n\t */\n\tpublic addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]) {\n\t\tchannelTypes.forEach((channelType) => this.addChannelType(channelType));\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandIntegerOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number().int();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandIntegerOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandIntegerOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandIntegerOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","export abstract class ApplicationCommandNumericOptionMinMaxValueMixin {\n\tpublic readonly max_value?: number;\n\tpublic readonly min_value?: number;\n\n\t/**\n\t * Sets the maximum number value of this option\n\t * @param max The maximum value this option can be\n\t */\n\tpublic abstract setMaxValue(max: number): this;\n\n\t/**\n\t * Sets the minimum number value of this option\n\t * @param min The minimum value this option can be\n\t */\n\tpublic abstract setMinValue(min: number): this;\n}\n","import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport { validateMaxChoicesLength } from '../Assertions';\n\nconst stringPredicate = z.string().min(1).max(100);\nconst numberPredicate = z.number().gt(-Infinity).lt(Infinity);\nconst choicesPredicate = z\n\t.object({ name: stringPredicate, value: z.union([stringPredicate, numberPredicate]) })\n\t.array();\nconst booleanPredicate = z.boolean();\n\nexport class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends string | number> {\n\tpublic readonly choices?: APIApplicationCommandOptionChoice<T>[];\n\tpublic readonly autocomplete?: boolean;\n\n\t// Since this is present and this is a mixin, this is needed\n\tpublic readonly type!: ApplicationCommandOptionType;\n\n\t/**\n\t * Adds a choice for this option\n\t *\n\t * @param choice The choice to add\n\t */\n\tpublic addChoice(choice: APIApplicationCommandOptionChoice<T>): this {\n\t\tconst { name, value } = choice;\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tif (this.choices === undefined) {\n\t\t\tReflect.set(this, 'choices', []);\n\t\t}\n\n\t\tvalidateMaxChoicesLength(this.choices!);\n\n\t\t// Validate name\n\t\tstringPredicate.parse(name);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) {\n\t\t\tstringPredicate.parse(value);\n\t\t} else {\n\t\t\tnumberPredicate.parse(value);\n\t\t}\n\n\t\tthis.choices!.push({ name, value });\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds multiple choices for this option\n\t *\n\t * @param choices The choices to add\n\t */\n\tpublic addChoices(...choices: APIApplicationCommandOptionChoice<T>[]): this {\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tfor (const entry of choices) this.addChoice(entry);\n\t\treturn this;\n\t}\n\n\tpublic setChoices<Input extends APIApplicationCommandOptionChoice<T>[]>(...choices: Input): this {\n\t\tif (choices.length > 0 && this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tReflect.set(this, 'choices', []);\n\t\tfor (const entry of choices) this.addChoice(entry);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Marks the option as autocompletable\n\t * @param autocomplete If this option should be autocompletable\n\t */\n\tpublic setAutocomplete(autocomplete: boolean): this {\n\t\t// Assert that you actually passed a boolean\n\t\tbooleanPredicate.parse(autocomplete);\n\n\t\tif (autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tReflect.set(this, 'autocomplete', autocomplete);\n\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandMentionableOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandMentionableOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic toJSON(): APIApplicationCommandMentionableOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandNumberOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandNumberOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Number as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandNumberOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandNumberOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","import { APIApplicationCommandRoleOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandRoleOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic toJSON(): APIApplicationCommandRoleOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandAttachmentOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandAttachmentOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Attachment as const;\n\n\tpublic toJSON(): APIApplicationCommandAttachmentOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\n@mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandStringOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic toJSON(): APIApplicationCommandStringOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {}\n","import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandUserOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic toJSON(): APIApplicationCommandUserOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { ApplicationCommandOptionBase } from './ApplicationCommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandNumberOption } from '../options/number';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandAttachmentOption } from '../options/attachment';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds an attachment option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addAttachmentOption(\n\t\tinput: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandAttachmentOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput:\n\t\t\t| SlashCommandStringOption\n\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandStringOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandStringOption\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput:\n\t\t\t| SlashCommandIntegerOption\n\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandIntegerOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandIntegerOption\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\t/**\n\t * Adds a number option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addNumberOption(\n\t\tinput:\n\t\t\t| SlashCommandNumberOption\n\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandNumberOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandNumberOption\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandNumberOption);\n\t}\n\n\tprivate _sharedAddOptionMethod<T extends ApplicationCommandOptionBase>(\n\t\tinput:\n\t\t\t| T\n\t\t\t| Omit<T, 'setAutocomplete'>\n\t\t\t| Omit<T, 'addChoice' | 'addChoices'>\n\t\t\t| ((builder: T) => T | Omit<T, 'setAutocomplete'> | Omit<T, 'addChoice' | 'addChoices'>),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit<this, 'addSubcommand' | 'addSubcommandGroup'> : this {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new Instance()) : input;\n\n\t\tassertReturnOfBuilder(result, Instance);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n","import {\n\tAPIApplicationCommandSubcommandGroupOption,\n\tAPIApplicationCommandSubcommandOption,\n\tApplicationCommandOptionType,\n} from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\n\n/**\n * Represents a folder for subcommands\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription)\nexport class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand group\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand group\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The subcommands part of this subcommand group\n\t */\n\tpublic readonly options: SlashCommandSubcommandBuilder[] = [];\n\n\t/**\n\t * Adds a new subcommand to this group\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t) {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandSubcommandGroupOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.SubcommandGroup,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {}\n\n/**\n * Represents a subcommand\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription, SharedSlashCommandOptions)\nexport class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this subcommand\n\t */\n\tpublic readonly options: ApplicationCommandOptionBase[] = [];\n\n\tpublic toJSON(): APIApplicationCommandSubcommandOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.Subcommand,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {}\n","import { z } from 'zod';\nimport { ApplicationCommandType } from 'discord-api-types/v9';\nimport type { ContextMenuCommandType } from './ContextMenuCommandBuilder';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^( *[\\p{L}\\p{N}_-]+ *)+$/u);\n\nconst typePredicate = z.union([z.literal(ApplicationCommandType.User), z.literal(ApplicationCommandType.Message)]);\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nexport function validateType(type: unknown): asserts type is ContextMenuCommandType {\n\ttypePredicate.parse(type);\n}\n\nexport function validateRequiredParameters(name: string, type: number) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert type is valid\n\tvalidateType(type);\n}\n","import { validateRequiredParameters, validateName, validateType, validateDefaultPermission } from './Assertions';\nimport type { ApplicationCommandType, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\n\nexport class ContextMenuCommandBuilder {\n\t/**\n\t * The name of this context menu command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The type of this context menu command\n\t */\n\tpublic readonly type: ContextMenuCommandType = undefined!;\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the type\n\t *\n\t * @param type The type\n\t */\n\tpublic setType(type: ContextMenuCommandType) {\n\t\t// Assert the type is valid\n\t\tvalidateType(type);\n\n\t\tReflect.set(this, 'type', type);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.type);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\ttype: this.type,\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n}\n\nexport type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;\n","export interface JSONEncodable<T> {\n\t/**\n\t * Transforms this object to its JSON format\n\t */\n\ttoJSON: () => T;\n}\n\n/**\n * Indicates if an object is encodable or not.\n * @param maybeEncodable The object to check against\n */\nexport function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n\treturn maybeEncodable !== null && typeof maybeEncodable === 'object' && 'toJSON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AQ,0BAAuB,MAAO,IAAE,QAAQ,0BAAuB,WAElG,GAAmB,IAAE,UAEpB,YAAmC,EAA0C,CACnF,GAAiB,MAAM,GADR,kCAIT,YAAsB,EAAuC,CACnE,GAAc,MAAM,GADL,qBAIT,YAAsB,EAAuD,CACnF,GAAc,MAAM,GADL,qBAIT,YAAoC,EAAc,EAAc,CAEtE,GAAa,GAGb,GAAa,GALE,mCCvBT,YAAgC,CAAhC,aAHP,CAOiB,eAKA,eAOA,4BAOT,QAAQ,EAAc,CAE5B,UAAa,GAEb,QAAQ,IAAI,KAAM,OAAQ,GAEnB,KAQD,QAAQ,EAA8B,CAE5C,UAAa,GAEb,QAAQ,IAAI,KAAM,OAAQ,GAEnB,KAYD,qBAAqB,EAAgB,CAE3C,UAA0B,GAE1B,QAAQ,IAAI,KAAM,oBAAqB,GAEhC,KAQD,QAAiD,CACvD,UAA2B,KAAK,KAAM,KAAK,MACpC,CACN,KAAM,KAAK,KACX,KAAM,KAAK,KACX,mBAAoB,KAAK,qBA1ErB,kCCQA,YAAyB,EAAmE,CAClG,MAAO,KAAmB,MAAQ,MAAO,IAAmB,UAAY,UAAY,GADrE","names":[]}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var k=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var se=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var o=(e,t)=>k(e,"name",{value:t,configurable:!0});var j=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})};var u=(e,t,n,r)=>{for(var p=r>1?void 0:r?ae(t,n):t,x=e.length-1,P;x>=0;x--)(P=e[x])&&(p=(r?P(t,n,p):P(p))||p);return r&&p&&k(t,n,p),p};var i=(e,t,n)=>(se(e,typeof t!="symbol"?t+"":t,n),n);var Vt={};j(Vt,{RGBPredicate:()=>z,authorNamePredicate:()=>dt,colorPredicate:()=>ut,descriptionPredicate:()=>ct,embedFieldPredicate:()=>Lt,embedFieldsArrayPredicate:()=>G,fieldInlinePredicate:()=>Dt,fieldLengthPredicate:()=>_t,fieldNamePredicate:()=>F,fieldValuePredicate:()=>$t,footerTextPredicate:()=>ht,timestampPredicate:()=>bt,titlePredicate:()=>ft,urlPredicate:()=>y,validateFieldLength:()=>W});import{z as l}from"zod";var F=l.string().min(1).max(256),$t=l.string().min(1).max(1024),Dt=l.boolean().optional(),Lt=l.object({name:F,value:$t,inline:Dt}),G=Lt.array(),_t=l.number().lte(25);function W(e,t){_t.parse((t?.length??0)+e)}o(W,"validateFieldLength");var dt=F.nullable(),y=l.string().url().nullish(),z=l.number().int().gte(0).lte(255),ut=l.number().int().gte(0).lte(16777215).nullable().or(l.tuple([z,z,z])),ct=l.string().min(1).max(4096).nullable(),ht=l.string().min(1).max(2048).nullable(),bt=l.union([l.number(),l.date()]).nullable(),ft=F.nullable();import pe from"fast-deep-equal";var T=class{constructor(t={}){i(this,"data");this.data={...t},t.timestamp&&(this.data.timestamp=new Date(t.timestamp).toISOString())}get fields(){return this.data.fields}get title(){return this.data.title}get description(){return this.data.description}get url(){return this.data.url}get color(){return this.data.color}get timestamp(){return this.data.timestamp}get thumbnail(){if(!!this.data.thumbnail)return{url:this.data.thumbnail.url,proxyURL:this.data.thumbnail.proxy_url,height:this.data.thumbnail.height,width:this.data.thumbnail.width}}get image(){if(!!this.data.image)return{url:this.data.image.url,proxyURL:this.data.image.proxy_url,height:this.data.image.height,width:this.data.image.width}}get video(){return this.data.video}get author(){if(!!this.data.author)return{name:this.data.author.name,url:this.data.author.url,iconURL:this.data.author.icon_url,proxyIconURL:this.data.author.proxy_icon_url}}get provider(){return this.data.provider}get footer(){if(!!this.data.footer)return{text:this.data.footer.text,iconURL:this.data.footer.icon_url,proxyIconURL:this.data.footer.proxy_icon_url}}get length(){return(this.data.title?.length??0)+(this.data.description?.length??0)+(this.data.fields?.reduce((t,n)=>t+n.name.length+n.value.length,0)??0)+(this.data.footer?.text.length??0)+(this.data.author?.name.length??0)}get hexColor(){return typeof this.data.color=="number"?`#${this.data.color.toString(16).padStart(6,"0")}`:this.data.color}addField(t){return this.addFields(t)}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.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}}equals(t){let{image:n,thumbnail:r,...p}=this.data,x=t instanceof T?t.data:t,{image:P,thumbnail:ie,...re}=x;return pe(re,p)&&P?.url===n?.url&&ie?.url===r?.url}};o(T,"UnsafeEmbed");var Ut=class extends T{addFields(...t){return W(t.length,this.fields),super.addFields(...G.parse(t))}spliceFields(t,n,...r){return W(r.length-n,this.fields),super.spliceFields(t,n,...G.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(dt.parse(t.name),y.parse(t.iconURL),y.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(ut.parse(t))}setDescription(t){return super.setDescription(ct.parse(t))}setFooter(t){return t===null?super.setFooter(null):(ht.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(bt.parse(t))}setTitle(t){return super.setTitle(ft.parse(t))}setURL(t){return super.setURL(y.parse(t))}};o(Ut,"Embed");function Ze(e,t){return typeof t=="undefined"?`\`\`\`
1
+ var k=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var se=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var o=(e,t)=>k(e,"name",{value:t,configurable:!0});var j=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})};var u=(e,t,n,r)=>{for(var p=r>1?void 0:r?ae(t,n):t,x=e.length-1,P;x>=0;x--)(P=e[x])&&(p=(r?P(t,n,p):P(p))||p);return r&&p&&k(t,n,p),p};var i=(e,t,n)=>(se(e,typeof t!="symbol"?t+"":t,n),n);var Vt={};j(Vt,{RGBPredicate:()=>z,authorNamePredicate:()=>dt,colorPredicate:()=>ut,descriptionPredicate:()=>ct,embedFieldPredicate:()=>Lt,embedFieldsArrayPredicate:()=>G,fieldInlinePredicate:()=>Dt,fieldLengthPredicate:()=>_t,fieldNamePredicate:()=>F,fieldValuePredicate:()=>$t,footerTextPredicate:()=>ht,timestampPredicate:()=>bt,titlePredicate:()=>ft,urlPredicate:()=>y,validateFieldLength:()=>W});import{z as l}from"zod";var F=l.string().min(1).max(256),$t=l.string().min(1).max(1024),Dt=l.boolean().optional(),Lt=l.object({name:F,value:$t,inline:Dt}),G=Lt.array(),_t=l.number().lte(25);function W(e,t){_t.parse((t?.length??0)+e)}o(W,"validateFieldLength");var dt=F.nullable(),y=l.string().url().nullish(),z=l.number().int().gte(0).lte(255),ut=l.number().int().gte(0).lte(16777215).nullable().or(l.tuple([z,z,z])),ct=l.string().min(1).max(4096).nullable(),ht=l.string().min(1).max(2048).nullable(),bt=l.union([l.number(),l.date()]).nullable(),ft=F.nullable();import pe from"fast-deep-equal";var T=class{constructor(t={}){i(this,"data");this.data={...t},t.timestamp&&(this.data.timestamp=new Date(t.timestamp).toISOString())}get fields(){return this.data.fields}get title(){return this.data.title}get description(){return this.data.description}get url(){return this.data.url}get color(){return this.data.color}get timestamp(){return this.data.timestamp}get thumbnail(){if(!!this.data.thumbnail)return{url:this.data.thumbnail.url,proxyURL:this.data.thumbnail.proxy_url,height:this.data.thumbnail.height,width:this.data.thumbnail.width}}get image(){if(!!this.data.image)return{url:this.data.image.url,proxyURL:this.data.image.proxy_url,height:this.data.image.height,width:this.data.image.width}}get video(){return this.data.video}get author(){if(!!this.data.author)return{name:this.data.author.name,url:this.data.author.url,iconURL:this.data.author.icon_url,proxyIconURL:this.data.author.proxy_icon_url}}get provider(){return this.data.provider}get footer(){if(!!this.data.footer)return{text:this.data.footer.text,iconURL:this.data.footer.icon_url,proxyIconURL:this.data.footer.proxy_icon_url}}get length(){return(this.data.title?.length??0)+(this.data.description?.length??0)+(this.data.fields?.reduce((t,n)=>t+n.name.length+n.value.length,0)??0)+(this.data.footer?.text.length??0)+(this.data.author?.name.length??0)}get hexColor(){return typeof this.data.color=="number"?`#${this.data.color.toString(16).padStart(6,"0")}`:this.data.color}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.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}}equals(t){let{image:n,thumbnail:r,...p}=this.data,x=t instanceof T?t.data:t,{image:P,thumbnail:ie,...re}=x;return pe(re,p)&&P?.url===n?.url&&ie?.url===r?.url}};o(T,"UnsafeEmbed");var Ut=class extends T{addFields(...t){return W(t.length,this.fields),super.addFields(...G.parse(t))}spliceFields(t,n,...r){return W(r.length-n,this.fields),super.spliceFields(t,n,...G.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(dt.parse(t.name),y.parse(t.iconURL),y.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(ut.parse(t))}setDescription(t){return super.setDescription(ct.parse(t))}setFooter(t){return t===null?super.setFooter(null):(ht.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(bt.parse(t))}setTitle(t){return super.setTitle(ft.parse(t))}setURL(t){return super.setURL(y.parse(t))}};o(Ut,"Embed");function Ze(e,t){return typeof t=="undefined"?`\`\`\`
2
2
  ${e}\`\`\``:`\`\`\`${e}
3
3
  ${t}\`\`\``}o(Ze,"codeBlock");function Ke(e){return`\`${e}\``}o(Ke,"inlineCode");function Qe(e){return`_${e}_`}o(Qe,"italic");function He(e){return`**${e}**`}o(He,"bold");function Xe(e){return`__${e}__`}o(Xe,"underscore");function Ye(e){return`~~${e}~~`}o(Ye,"strikethrough");function to(e){return`> ${e}`}o(to,"quote");function eo(e){return`>>> ${e}`}o(eo,"blockQuote");function oo(e){return`<${e}>`}o(oo,"hideLinkEmbed");function no(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(no,"hyperlink");function io(e){return`||${e}||`}o(io,"spoiler");function ro(e){return`<@${e}>`}o(ro,"userMention");function ao(e){return`<@!${e}>`}o(ao,"memberNicknameMention");function so(e){return`<#${e}>`}o(so,"channelMention");function po(e){return`<@&${e}>`}o(po,"roleMention");function mo(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(mo,"formatEmoji");function lo(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(lo,"time");var uo={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},me=(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))(me||{});var qt={};j(qt,{buttonLabelValidator:()=>At,buttonStyleValidator:()=>xt,customIdValidator:()=>M,defaultValidator:()=>Ot,disabledValidator:()=>V,emojiValidator:()=>_,labelValueValidator:()=>U,minMaxValidator:()=>Z,optionsValidator:()=>Jt,placeholderValidator:()=>yt,urlValidator:()=>Pt,validateRequiredButtonParameters:()=>It,validateRequiredSelectMenuOptionParameters:()=>St,validateRequiredSelectMenuParameters:()=>gt});import{ButtonStyle as Ct}from"discord-api-types/v9";import{z as d}from"zod";var M=d.string().min(1).max(100),_=d.object({id:d.string(),name:d.string(),animated:d.boolean()}).partial().strict(),V=d.boolean(),At=d.string().nonempty().max(80),xt=d.number().int().min(Ct.Primary).max(Ct.Link),yt=d.string().max(100),Z=d.number().int().min(0).max(25),Jt=d.object({}).array().nonempty();function gt(e,t){M.parse(t),Jt.parse(e)}o(gt,"validateRequiredSelectMenuParameters");var U=d.string().min(1).max(100),Ot=d.boolean();function St(e,t){U.parse(e),U.parse(t)}o(St,"validateRequiredSelectMenuOptionParameters");var Pt=d.string().url();function It(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===Ct.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(It,"validateRequiredButtonParameters");import{ComponentType as le}from"discord-api-types/v9";var c=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(c,"Component");import{ComponentType as Tt}from"discord-api-types/v9";function kt(e){if(e instanceof c)return e;switch(e.type){case Tt.ActionRow:return new R(e);case Tt.Button:return new K(e);case Tt.SelectMenu:return new Q(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(kt,"createComponent");import Mt from"fast-deep-equal";var R=class extends c{constructor({components:t,...n}={}){super({type:le.ActionRow,...n});i(this,"components");this.components=t?.map(r=>kt(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())}}equals(t){return t instanceof R?Mt(t.data,this.data)&&Mt(t.components,this.components):Mt(t,{...this.data,components:this.components.map(n=>n.toJSON())})}};o(R,"ActionRow");import{ComponentType as de}from"discord-api-types/v9";import jt from"fast-deep-equal";var v=class extends c{constructor(t){super({type:de.Button,...t})}get style(){return this.data.style}get label(){return this.data.label}get emoji(){return this.data.emoji}get disabled(){return this.data.disabled}get customId(){return this.data.custom_id}get url(){return this.data.url}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}}equals(t){return t instanceof v?jt(t.data,this.data):jt(t,this.data)}};o(v,"UnsafeButtonComponent");var K=class extends v{setStyle(t){return super.setStyle(xt.parse(t))}setURL(t){return super.setURL(Pt.parse(t))}setCustomId(t){return super.setCustomId(M.parse(t))}setEmoji(t){return super.setEmoji(_.parse(t))}setDisabled(t=!0){return super.setDisabled(V.parse(t))}setLabel(t){return super.setLabel(At.parse(t))}toJSON(){return It(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(K,"ButtonComponent");import{ComponentType as ue}from"discord-api-types/v9";var h=class{constructor(t={}){this.data=t}get label(){return this.data.label}get value(){return this.data.value}get description(){return this.data.description}get emoji(){return this.data.emoji}get default(){return this.data.default}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,"UnsafeSelectMenuOption");import Rt from"fast-deep-equal";var w=class extends c{constructor(t){let{options:n,...r}=t??{};super({type:ue.SelectMenu,...r});i(this,"options");this.options=n?.map(p=>new h(p))??[]}get placeholder(){return this.data.placeholder}get maxValues(){return this.data.max_values}get minValues(){return this.data.min_values}get customId(){return this.data.custom_id}get disabled(){return this.data.disabled}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())}}equals(t){return t instanceof w?Rt(t.data,this.data)&&Rt(t.options,this.options):Rt(t,{...this.data,options:this.options.map(n=>n.toJSON())})}};o(w,"UnsafeSelectMenuComponent");var Q=class extends w{setPlaceholder(t){return super.setPlaceholder(yt.parse(t))}setMinValues(t){return super.setMinValues(Z.parse(t))}setMaxValues(t){return super.setMaxValues(Z.parse(t))}setCustomId(t){return super.setCustomId(M.parse(t))}setDisabled(t=!0){return super.setDisabled(V.parse(t))}toJSON(){return gt(this.options,this.customId),super.toJSON()}};o(Q,"SelectMenuComponent");var Ft=class extends h{setDescription(t){return super.setDescription(U.parse(t))}setDefault(t=!0){return super.setDefault(Ot.parse(t))}setEmoji(t){return super.setEmoji(_.parse(t))}toJSON(){return St(this.label,this.value),super.toJSON()}};o(Ft,"SelectMenuOption");var zt={};j(zt,{assertReturnOfBuilder:()=>O,validateDefaultPermission:()=>wt,validateDescription:()=>Y,validateMaxChoicesLength:()=>Et,validateMaxOptionsLength:()=>b,validateName:()=>X,validateRequired:()=>tt,validateRequiredParameters:()=>g});import vt from"@sindresorhus/is";import{z as H}from"zod";var ce=H.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function X(e){ce.parse(e)}o(X,"validateName");var he=H.string().min(1).max(100);function Y(e){he.parse(e)}o(Y,"validateDescription");var Gt=H.unknown().array().max(25);function b(e){Gt.parse(e)}o(b,"validateMaxOptionsLength");function g(e,t,n){X(e),Y(t),b(n)}o(g,"validateRequiredParameters");var Wt=H.boolean();function wt(e){Wt.parse(e)}o(wt,"validateDefaultPermission");function tt(e){Wt.parse(e)}o(tt,"validateRequired");function Et(e){Gt.parse(e)}o(Et,"validateMaxChoicesLength");function O(e,t){let n=t.name;if(vt.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(vt.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=vt.function_(e)?e.name:r.constructor.name,x=Reflect.get(r,Symbol.toStringTag),P=x?`${p} [${x}]`:p;throw new TypeError(`Expected to receive a ${n} builder, got ${P} instead.`)}}o(O,"assertReturnOfBuilder");import{mix as $e}from"ts-mixer";import{ApplicationCommandOptionType as be}from"discord-api-types/v9";var f=class{constructor(){i(this,"name");i(this,"description")}setName(t){return X(t),Reflect.set(this,"name",t),this}setDescription(t){return Y(t),Reflect.set(this,"description",t),this}};o(f,"SharedNameAndDescription");var m=class extends f{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return tt(t),Reflect.set(this,"required",t),this}runRequiredValidations(){g(this.name,this.description,[]),tt(this.required)}};o(m,"ApplicationCommandOptionBase");var et=class extends m{constructor(){super(...arguments);i(this,"type",be.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(et,"SlashCommandBooleanOption");import{ApplicationCommandOptionType as Ae}from"discord-api-types/v9";import{mix as xe}from"ts-mixer";import{ChannelType as C}from"discord-api-types/v9";import{z as Zt}from"zod";var fe=[C.GuildText,C.GuildVoice,C.GuildCategory,C.GuildNews,C.GuildStore,C.GuildNewsThread,C.GuildPublicThread,C.GuildPrivateThread,C.GuildStageVoice],Ce=Zt.union(fe.map(e=>Zt.literal(e))),ot=class{constructor(){i(this,"channel_types")}addChannelType(t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Ce.parse(t),this.channel_types.push(t),this}addChannelTypes(t){return t.forEach(n=>this.addChannelType(n)),this}};o(ot,"ApplicationCommandOptionChannelTypesMixin");var E=class extends m{constructor(){super(...arguments);i(this,"type",Ae.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(E,"SlashCommandChannelOption"),E=u([xe(ot)],E);import{ApplicationCommandOptionType as Oe}from"discord-api-types/v9";import{mix as Se}from"ts-mixer";import{z as Pe}from"zod";var B=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(B,"ApplicationCommandNumericOptionMinMaxValueMixin");import{ApplicationCommandOptionType as ye}from"discord-api-types/v9";import{z as J}from"zod";var nt=J.string().min(1).max(100),Kt=J.number().gt(-1/0).lt(1/0),Qt=J.object({name:nt,value:J.union([nt,Kt])}).array(),ge=J.boolean(),S=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoice(t){let{name:n,value:r}=t;if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),Et(this.choices),nt.parse(n),this.type===ye.String?nt.parse(r):Kt.parse(r),this.choices.push({name:n,value:r}),this}addChoices(...t){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");Qt.parse(t);for(let n of t)this.addChoice(n);return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");Qt.parse(t),Reflect.set(this,"choices",[]);for(let n of t)this.addChoice(n);return this}setAutocomplete(t){if(ge.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(S,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var Ht=Pe.number().int(),N=class extends m{constructor(){super(...arguments);i(this,"type",Oe.Integer)}setMaxValue(t){return Ht.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return Ht.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([Se(B,S)],N);import{ApplicationCommandOptionType as Ie}from"discord-api-types/v9";var it=class extends m{constructor(){super(...arguments);i(this,"type",Ie.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(it,"SlashCommandMentionableOption");import{ApplicationCommandOptionType as Te}from"discord-api-types/v9";import{mix as Me}from"ts-mixer";import{z as Re}from"zod";var Xt=Re.number(),$=class extends m{constructor(){super(...arguments);i(this,"type",Te.Number)}setMaxValue(t){return Xt.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return Xt.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($,"SlashCommandNumberOption"),$=u([Me(B,S)],$);import{ApplicationCommandOptionType as ve}from"discord-api-types/v9";var rt=class extends m{constructor(){super(...arguments);i(this,"type",ve.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(rt,"SlashCommandRoleOption");import{ApplicationCommandOptionType as we}from"discord-api-types/v9";var at=class extends m{constructor(){super(...arguments);i(this,"type",we.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(at,"SlashCommandAttachmentOption");import{ApplicationCommandOptionType as Ee}from"discord-api-types/v9";import{mix as Be}from"ts-mixer";var D=class extends m{constructor(){super(...arguments);i(this,"type",Ee.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(D,"SlashCommandStringOption"),D=u([Be(S)],D);import{ApplicationCommandOptionType as Ne}from"discord-api-types/v9";var st=class extends m{constructor(){super(...arguments);i(this,"type",Ne.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(st,"SlashCommandUserOption");var L=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,et)}addUserOption(t){return this._sharedAddOptionMethod(t,st)}addChannelOption(t){return this._sharedAddOptionMethod(t,E)}addRoleOption(t){return this._sharedAddOptionMethod(t,rt)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,at)}addMentionableOption(t){return this._sharedAddOptionMethod(t,it)}addStringOption(t){return this._sharedAddOptionMethod(t,D)}addIntegerOption(t){return this._sharedAddOptionMethod(t,N)}addNumberOption(t){return this._sharedAddOptionMethod(t,$)}_sharedAddOptionMethod(t,n){let{options:r}=this;b(r);let p=typeof t=="function"?t(new n):t;return O(p,n),r.push(p),this}};o(L,"SharedSlashCommandOptions");import{ApplicationCommandOptionType as Yt}from"discord-api-types/v9";import{mix as te}from"ts-mixer";var I=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new A):t;return O(r,A),n.push(r),this}toJSON(){return g(this.name,this.description,this.options),{type:Yt.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(I,"SlashCommandSubcommandGroupBuilder"),I=u([te(f)],I);var A=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return g(this.name,this.description,this.options),{type:Yt.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(A,"SlashCommandSubcommandBuilder"),A=u([te(f,L)],A);var pt=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return g(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 wt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new I):t;return O(r,I),n.push(r),this}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new A):t;return O(r,A),n.push(r),this}};o(pt,"SlashCommandBuilder"),pt=u([$e(L,f)],pt);var oe={};j(oe,{validateDefaultPermission:()=>Bt,validateName:()=>mt,validateRequiredParameters:()=>Nt,validateType:()=>lt});import{z as q}from"zod";import{ApplicationCommandType as ee}from"discord-api-types/v9";var De=q.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),Le=q.union([q.literal(ee.User),q.literal(ee.Message)]),_e=q.boolean();function Bt(e){_e.parse(e)}o(Bt,"validateDefaultPermission");function mt(e){De.parse(e)}o(mt,"validateName");function lt(e){Le.parse(e)}o(lt,"validateType");function Nt(e,t){mt(e),lt(t)}o(Nt,"validateRequiredParameters");var ne=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return mt(t),Reflect.set(this,"name",t),this}setType(t){return lt(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Bt(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Nt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(ne,"ContextMenuCommandBuilder");function Li(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(Li,"isJSONEncodable");export{R as ActionRow,K as ButtonComponent,c as Component,qt as ComponentAssertions,oe as ContextMenuCommandAssertions,ne as ContextMenuCommandBuilder,Ut as Embed,Vt as EmbedAssertions,me as Faces,Q as SelectMenuComponent,Ft as SelectMenuOption,zt as SlashCommandAssertions,at as SlashCommandAttachmentOption,et as SlashCommandBooleanOption,pt as SlashCommandBuilder,E as SlashCommandChannelOption,N as SlashCommandIntegerOption,it as SlashCommandMentionableOption,$ as SlashCommandNumberOption,rt as SlashCommandRoleOption,D as SlashCommandStringOption,A as SlashCommandSubcommandBuilder,I as SlashCommandSubcommandGroupBuilder,st as SlashCommandUserOption,uo as TimestampStyles,v as UnsafeButtonComponent,T as UnsafeEmbed,w as UnsafeSelectMenuComponent,h as UnsafeSelectMenuOption,eo as blockQuote,He as bold,so as channelMention,Ze as codeBlock,kt as createComponent,mo as formatEmoji,oo as hideLinkEmbed,no as hyperlink,Ke as inlineCode,Li as isJSONEncodable,Qe as italic,ao as memberNicknameMention,to as quote,po as roleMention,io as spoiler,Ye as strikethrough,lo as time,Xe as underscore,ro as userMention};
4
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/messages/embed/Assertions.ts","../src/messages/embed/UnsafeEmbed.ts","../src/messages/embed/Embed.ts","../src/messages/formatters.ts","../src/components/Assertions.ts","../src/components/ActionRow.ts","../src/components/Component.ts","../src/components/Components.ts","../src/components/button/UnsafeButton.ts","../src/components/button/Button.ts","../src/components/selectMenu/UnsafeSelectMenu.ts","../src/components/selectMenu/UnsafeSelectMenuOption.ts","../src/components/selectMenu/SelectMenu.ts","../src/components/selectMenu/SelectMenuOption.ts","../src/interactions/slashCommands/Assertions.ts","../src/interactions/slashCommands/SlashCommandBuilder.ts","../src/interactions/slashCommands/options/boolean.ts","../src/interactions/slashCommands/mixins/NameAndDescription.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts","../src/interactions/slashCommands/options/channel.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts","../src/interactions/slashCommands/options/integer.ts","../src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts","../src/interactions/slashCommands/options/mentionable.ts","../src/interactions/slashCommands/options/number.ts","../src/interactions/slashCommands/options/role.ts","../src/interactions/slashCommands/options/attachment.ts","../src/interactions/slashCommands/options/string.ts","../src/interactions/slashCommands/options/user.ts","../src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts","../src/interactions/slashCommands/SlashCommandSubcommands.ts","../src/interactions/contextMenuCommands/Assertions.ts","../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts","../src/util/jsonEncodable.ts"],"sourcesContent":["import type { APIEmbedField } from 'discord-api-types/v9';\nimport { z } from 'zod';\n\nexport const fieldNamePredicate = z.string().min(1).max(256);\n\nexport const fieldValuePredicate = z.string().min(1).max(1024);\n\nexport const fieldInlinePredicate = z.boolean().optional();\n\nexport const embedFieldPredicate = z.object({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array();\n\nexport const fieldLengthPredicate = z.number().lte(25);\n\nexport function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void {\n\tfieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable();\n\nexport const urlPredicate = z.string().url().nullish();\n\nexport const RGBPredicate = z.number().int().gte(0).lte(255);\nexport const colorPredicate = z\n\t.number()\n\t.int()\n\t.gte(0)\n\t.lte(0xffffff)\n\t.nullable()\n\t.or(z.tuple([RGBPredicate, RGBPredicate, RGBPredicate]));\n\nexport const descriptionPredicate = z.string().min(1).max(4096).nullable();\n\nexport const footerTextPredicate = z.string().min(1).max(2048).nullable();\n\nexport const timestampPredicate = z.union([z.number(), z.date()]).nullable();\n\nexport const titlePredicate = fieldNamePredicate.nullable();\n","import type {\n\tAPIEmbed,\n\tAPIEmbedAuthor,\n\tAPIEmbedField,\n\tAPIEmbedFooter,\n\tAPIEmbedImage,\n\tAPIEmbedVideo,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../../util/equatable';\nimport isEqual from 'fast-deep-equal';\n\nexport type RGBTuple = [red: number, green: number, blue: number];\n\nexport interface IconData {\n\t/**\n\t * The URL of the icon\n\t */\n\ticonURL?: string;\n\t/**\n\t * The proxy URL of the icon\n\t */\n\tproxyIconURL?: string;\n}\n\nexport type EmbedAuthorData = Omit<APIEmbedAuthor, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedAuthorOptions = Omit<EmbedAuthorData, 'proxyIconURL'>;\n\nexport type EmbedFooterData = Omit<APIEmbedFooter, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedFooterOptions = Omit<EmbedFooterData, 'proxyIconURL'>;\n\nexport interface EmbedImageData extends Omit<APIEmbedImage, 'proxy_url'> {\n\t/**\n\t * The proxy URL for the image\n\t */\n\tproxyURL?: string;\n}\n\n/**\n * Represents a non-validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> {\n\tpublic readonly data: APIEmbed;\n\n\tpublic constructor(data: APIEmbed = {}) {\n\t\tthis.data = { ...data };\n\t\tif (data.timestamp) this.data.timestamp = new Date(data.timestamp).toISOString();\n\t}\n\n\t/**\n\t * An array of fields of this embed\n\t */\n\tpublic get fields() {\n\t\treturn this.data.fields;\n\t}\n\n\t/**\n\t * The embed title\n\t */\n\tpublic get title() {\n\t\treturn this.data.title;\n\t}\n\n\t/**\n\t * The embed description\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The embed URL\n\t */\n\tpublic get url() {\n\t\treturn this.data.url;\n\t}\n\n\t/**\n\t * The embed color\n\t */\n\tpublic get color() {\n\t\treturn this.data.color;\n\t}\n\n\t/**\n\t * The timestamp of the embed in an ISO 8601 format\n\t */\n\tpublic get timestamp() {\n\t\treturn this.data.timestamp;\n\t}\n\n\t/**\n\t * The embed thumbnail data\n\t */\n\tpublic get thumbnail(): EmbedImageData | undefined {\n\t\tif (!this.data.thumbnail) return undefined;\n\t\treturn {\n\t\t\turl: this.data.thumbnail.url,\n\t\t\tproxyURL: this.data.thumbnail.proxy_url,\n\t\t\theight: this.data.thumbnail.height,\n\t\t\twidth: this.data.thumbnail.width,\n\t\t};\n\t}\n\n\t/**\n\t * The embed image data\n\t */\n\tpublic get image(): EmbedImageData | undefined {\n\t\tif (!this.data.image) return undefined;\n\t\treturn {\n\t\t\turl: this.data.image.url,\n\t\t\tproxyURL: this.data.image.proxy_url,\n\t\t\theight: this.data.image.height,\n\t\t\twidth: this.data.image.width,\n\t\t};\n\t}\n\n\t/**\n\t * Received video data\n\t */\n\tpublic get video(): APIEmbedVideo | undefined {\n\t\treturn this.data.video;\n\t}\n\n\t/**\n\t * The embed author data\n\t */\n\tpublic get author(): EmbedAuthorData | undefined {\n\t\tif (!this.data.author) return undefined;\n\t\treturn {\n\t\t\tname: this.data.author.name,\n\t\t\turl: this.data.author.url,\n\t\t\ticonURL: this.data.author.icon_url,\n\t\t\tproxyIconURL: this.data.author.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * Received data about the embed provider\n\t */\n\tpublic get provider() {\n\t\treturn this.data.provider;\n\t}\n\n\t/**\n\t * The embed footer data\n\t */\n\tpublic get footer(): EmbedFooterData | undefined {\n\t\tif (!this.data.footer) return undefined;\n\t\treturn {\n\t\t\ttext: this.data.footer.text,\n\t\t\ticonURL: this.data.footer.icon_url,\n\t\t\tproxyIconURL: this.data.footer.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * The accumulated length for the embed title, description, fields, footer text, and author name\n\t */\n\tpublic get length(): number {\n\t\treturn (\n\t\t\t(this.data.title?.length ?? 0) +\n\t\t\t(this.data.description?.length ?? 0) +\n\t\t\t(this.data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) +\n\t\t\t(this.data.footer?.text.length ?? 0) +\n\t\t\t(this.data.author?.name.length ?? 0)\n\t\t);\n\t}\n\n\t/**\n\t * The hex color of the current color of the embed\n\t */\n\tpublic get hexColor() {\n\t\treturn typeof this.data.color === 'number' ? `#${this.data.color.toString(16).padStart(6, '0')}` : this.data.color;\n\t}\n\n\t/**\n\t * Adds a field to the embed (max 25)\n\t *\n\t * @param field The field to add.\n\t */\n\tpublic addField(field: APIEmbedField): this {\n\t\treturn this.addFields(field);\n\t}\n\n\t/**\n\t * Adds fields to the embed (max 25)\n\t *\n\t * @param fields The fields to add\n\t */\n\tpublic addFields(...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.push(...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes, replaces, or inserts fields in the embed (max 25)\n\t *\n\t * @param index The index to start at\n\t * @param deleteCount The number of fields to remove\n\t * @param fields The replacing field objects\n\t */\n\tpublic spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.splice(index, deleteCount, ...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the embed's fields (max 25).\n\t * @param fields The fields to set\n\t */\n\tpublic setFields(...fields: APIEmbedField[]) {\n\t\tthis.spliceFields(0, this.fields?.length ?? 0, ...fields);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the author of this embed\n\t *\n\t * @param options The options for the author\n\t */\n\tpublic setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.author = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the color of this embed\n\t *\n\t * @param color The color of the embed\n\t */\n\tpublic setColor(color: number | RGBTuple | null): this {\n\t\tif (Array.isArray(color)) {\n\t\t\tconst [red, green, blue] = color;\n\t\t\tthis.data.color = (red << 16) + (green << 8) + blue;\n\t\t\treturn this;\n\t\t}\n\t\tthis.data.color = color ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this embed\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string | null): this {\n\t\tthis.data.description = description ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the footer of this embed\n\t *\n\t * @param options The options for the footer\n\t */\n\tpublic setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.footer = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.footer = { text: options.text, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the image of this embed\n\t *\n\t * @param url The URL of the image\n\t */\n\tpublic setImage(url: string | null): this {\n\t\tthis.data.image = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the thumbnail of this embed\n\t *\n\t * @param url The URL of the thumbnail\n\t */\n\tpublic setThumbnail(url: string | null): this {\n\t\tthis.data.thumbnail = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the timestamp of this embed\n\t *\n\t * @param timestamp The timestamp or date\n\t */\n\tpublic setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\tthis.data.timestamp = timestamp ? new Date(timestamp).toISOString() : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the title of this embed\n\t *\n\t * @param title The title\n\t */\n\tpublic setTitle(title: string | null): this {\n\t\tthis.data.title = title ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL of this embed\n\t *\n\t * @param url The URL\n\t */\n\tpublic setURL(url: string | null): this {\n\t\tthis.data.url = url ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Transforms the embed to a plain object\n\t */\n\tpublic toJSON(): APIEmbed {\n\t\treturn { ...this.data };\n\t}\n\n\tpublic equals(other: UnsafeEmbed | APIEmbed) {\n\t\tconst { image: thisImage, thumbnail: thisThumbnail, ...thisData } = this.data;\n\t\tconst data = other instanceof UnsafeEmbed ? other.data : other;\n\t\tconst { image, thumbnail, ...otherData } = data;\n\t\treturn isEqual(otherData, thisData) && image?.url === thisImage?.url && thumbnail?.url === thisThumbnail?.url;\n\t}\n}\n","import type { APIEmbedField } from 'discord-api-types/v9';\nimport {\n\tauthorNamePredicate,\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedFieldsArrayPredicate,\n\tfooterTextPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\nimport { EmbedAuthorOptions, EmbedFooterOptions, RGBTuple, UnsafeEmbed } from './UnsafeEmbed';\n\n/**\n * Represents a validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class Embed extends UnsafeEmbed {\n\tpublic override addFields(...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.addFields(...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length - deleteCount, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.spliceFields(index, deleteCount, ...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setAuthor(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tauthorNamePredicate.parse(options.name);\n\t\turlPredicate.parse(options.iconURL);\n\t\turlPredicate.parse(options.url);\n\n\t\treturn super.setAuthor(options);\n\t}\n\n\tpublic override setColor(color: number | RGBTuple | null): this {\n\t\t// Data assertions\n\t\treturn super.setColor(colorPredicate.parse(color));\n\t}\n\n\tpublic override setDescription(description: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setDescription(descriptionPredicate.parse(description));\n\t}\n\n\tpublic override setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setFooter(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tfooterTextPredicate.parse(options.text);\n\t\turlPredicate.parse(options.iconURL);\n\n\t\treturn super.setFooter(options);\n\t}\n\n\tpublic override setImage(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setImage(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setThumbnail(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setThumbnail(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\t// Data assertions\n\t\treturn super.setTimestamp(timestampPredicate.parse(timestamp));\n\t}\n\n\tpublic override setTitle(title: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setTitle(titlePredicate.parse(title));\n\t}\n\n\tpublic override setURL(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setURL(urlPredicate.parse(url)!);\n\t}\n}\n","import type { Snowflake } from 'discord-api-types/globals';\nimport type { URL } from 'url';\n\n/**\n * Wraps the content inside a codeblock with no language\n *\n * @param content The content to wrap\n */\nexport function codeBlock<C extends string>(content: C): `\\`\\`\\`\\n${C}\\`\\`\\``;\n\n/**\n * Wraps the content inside a codeblock with the specified language\n *\n * @param language The language for the codeblock\n * @param content The content to wrap\n */\nexport function codeBlock<L extends string, C extends string>(language: L, content: C): `\\`\\`\\`${L}\\n${C}\\`\\`\\``;\nexport function codeBlock(language: string, content?: string): string {\n\treturn typeof content === 'undefined' ? `\\`\\`\\`\\n${language}\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\`, which formats it as inline code\n *\n * @param content The content to wrap\n */\nexport function inlineCode<C extends string>(content: C): `\\`${C}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text\n *\n * @param content The content to wrap\n */\nexport function italic<C extends string>(content: C): `_${C}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text\n *\n * @param content The content to wrap\n */\nexport function bold<C extends string>(content: C): `**${C}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underscored text\n *\n * @param content The content to wrap\n */\nexport function underscore<C extends string>(content: C): `__${C}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text\n *\n * @param content The content to wrap\n */\nexport function strikethrough<C extends string>(content: C): `~~${C}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function quote<C extends string>(content: C): `> ${C}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function blockQuote<C extends string>(content: C): `>>> ${C}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed<C extends string>(url: C): `<${C}>`;\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\nexport function hideLinkEmbed(url: string | URL) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, T extends string>(\n\tcontent: C,\n\turl: URL,\n\ttitle: T,\n): `[${C}](${string} \"${T}\")`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, U extends string, T extends string>(\n\tcontent: C,\n\turl: U,\n\ttitle: T,\n): `[${C}](${U} \"${T}\")`;\nexport function hyperlink(content: string, url: string | URL, title?: string) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Wraps the content inside spoiler (hidden text)\n *\n * @param content The content to wrap\n */\nexport function spoiler<C extends string>(content: C): `||${C}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user ID into a user mention\n *\n * @param userId The user ID to format\n */\nexport function userMention<C extends Snowflake>(userId: C): `<@${C}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a user ID into a member-nickname mention\n *\n * @param memberId The user ID to format\n */\nexport function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C}>` {\n\treturn `<@!${memberId}>`;\n}\n\n/**\n * Formats a channel ID into a channel mention\n *\n * @param channelId The channel ID to format\n */\nexport function channelMention<C extends Snowflake>(channelId: C): `<#${C}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role ID into a role mention\n *\n * @param roleId The role ID to format\n */\nexport function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated = false): `<a:_:${C}>` | `<:_:${C}>` {\n\treturn `<${animated ? 'a' : ''}:_:${emojiId}>`;\n}\n\n/**\n * Formats a date into a short date-time string\n *\n * @param date The date to format, defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style\n *\n * @param date The date to format\n * @param style The style to use\n */\nexport function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n */\nexport function time<C extends number>(seconds: C): `<t:${C}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n * @param style The style to use\n */\nexport function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;\nexport function time(timeOrSeconds?: number | Date, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes, e.g. 16:20\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year, e.g. 20/04/2021\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year, e.g. 20 April 2021\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format, e.g. 2 months ago\n\t */\n\tRelativeTime: 'R',\n} as const;\n\n/**\n * The possible values, see {@link TimestampStyles} for more information\n */\nexport type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];\n\n/**\n * An enum with all the available faces from Discord's native slash commands\n */\nexport enum Faces {\n\t/**\n\t * ¯\\\\_(ツ)\\\\_/¯\n\t */\n\tShrug = '¯\\\\_(ツ)\\\\_/¯',\n\n\t/**\n\t * (╯°□°)╯︵ ┻━┻\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * ┬─┬ ノ( ゜-゜ノ)\n\t */\n\tUnflip = '┬─┬ ノ( ゜-゜ノ)',\n}\n","import { APIMessageComponentEmoji, ButtonStyle } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { SelectMenuOption } from './selectMenu/SelectMenuOption';\n\nexport const customIdValidator = z.string().min(1).max(100);\n\nexport const emojiValidator = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tanimated: z.boolean(),\n\t})\n\t.partial()\n\t.strict();\n\nexport const disabledValidator = z.boolean();\n\nexport const buttonLabelValidator = z.string().nonempty().max(80);\n\nexport const buttonStyleValidator = z.number().int().min(ButtonStyle.Primary).max(ButtonStyle.Link);\n\nexport const placeholderValidator = z.string().max(100);\nexport const minMaxValidator = z.number().int().min(0).max(25);\n\nexport const optionsValidator = z.object({}).array().nonempty();\n\nexport function validateRequiredSelectMenuParameters(options: SelectMenuOption[], customId?: string) {\n\tcustomIdValidator.parse(customId);\n\toptionsValidator.parse(options);\n}\n\nexport const labelValueValidator = z.string().min(1).max(100);\nexport const defaultValidator = z.boolean();\n\nexport function validateRequiredSelectMenuOptionParameters(label?: string, value?: string) {\n\tlabelValueValidator.parse(label);\n\tlabelValueValidator.parse(value);\n}\n\nexport const urlValidator = z.string().url();\n\nexport function validateRequiredButtonParameters(\n\tstyle?: ButtonStyle,\n\tlabel?: string,\n\temoji?: APIMessageComponentEmoji,\n\tcustomId?: string,\n\turl?: string,\n) {\n\tif (url && customId) {\n\t\tthrow new RangeError('URL and custom id are mutually exclusive');\n\t}\n\n\tif (!label && !emoji) {\n\t\tthrow new RangeError('Buttons must have a label and/or an emoji');\n\t}\n\n\tif (style === ButtonStyle.Link) {\n\t\tif (!url) {\n\t\t\tthrow new RangeError('Link buttons must have a url');\n\t\t}\n\t} else if (url) {\n\t\tthrow new RangeError('Non-link buttons cannot have a url');\n\t}\n}\n","import { type APIActionRowComponent, ComponentType, APIMessageComponent } from 'discord-api-types/v9';\nimport type { ButtonComponent, SelectMenuComponent } from '..';\nimport { Component } from './Component';\nimport { createComponent } from './Components';\nimport isEqual from 'fast-deep-equal';\n\nexport type MessageComponent = ActionRowComponent | ActionRow;\n\nexport type ActionRowComponent = ButtonComponent | SelectMenuComponent;\n\n// TODO: Add valid form component types\n/**\n * Represents an action row component\n */\nexport class ActionRow<T extends ActionRowComponent = ActionRowComponent> extends Component<\n\tOmit<Partial<APIActionRowComponent<APIMessageComponent>> & { type: ComponentType.ActionRow }, 'components'>\n> {\n\t/**\n\t * The components within this action row\n\t */\n\tpublic readonly components: T[];\n\n\tpublic constructor({ components, ...data }: Partial<APIActionRowComponent<APIMessageComponent>> = {}) {\n\t\tsuper({ type: ComponentType.ActionRow, ...data });\n\t\tthis.components = (components?.map((c) => createComponent(c)) ?? []) as T[];\n\t}\n\n\t/**\n\t * Adds components to this action row.\n\t * @param components The components to add to this action row.\n\t * @returns\n\t */\n\tpublic addComponents(...components: T[]) {\n\t\tthis.components.push(...components);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the components in this action row\n\t * @param components The components to set this row to\n\t */\n\tpublic setComponents(...components: T[]) {\n\t\tthis.components.splice(0, this.components.length, ...components);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIActionRowComponent<APIMessageComponent> {\n\t\treturn {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t};\n\t}\n\n\tpublic equals(other: APIActionRowComponent<APIMessageComponent> | ActionRow) {\n\t\tif (other instanceof ActionRow) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.components, this.components);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t});\n\t}\n}\n","import type { JSONEncodable } from '../util/jsonEncodable';\nimport type {\n\tAPIActionRowComponentTypes,\n\tAPIBaseComponent,\n\tAPIMessageComponent,\n\tComponentType,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../util/equatable';\n\n/**\n * Represents a discord component\n */\nexport abstract class Component<\n\tDataType extends Partial<APIBaseComponent<ComponentType>> & {\n\t\ttype: ComponentType;\n\t} = APIBaseComponent<ComponentType>,\n> implements JSONEncodable<APIMessageComponent>, Equatable<Component | APIActionRowComponentTypes>\n{\n\t/**\n\t * The API data associated with this component\n\t */\n\tpublic readonly data: DataType;\n\n\tpublic abstract toJSON(): APIMessageComponent;\n\n\tpublic abstract equals(other: Component | APIActionRowComponentTypes): boolean;\n\n\tpublic constructor(data: DataType) {\n\t\tthis.data = data;\n\t}\n\n\t/**\n\t * The type of this component\n\t */\n\tpublic get type(): DataType['type'] {\n\t\treturn this.data.type;\n\t}\n}\n","import { APIMessageComponent, ComponentType } from 'discord-api-types/v9';\nimport { ActionRow, ButtonComponent, Component, SelectMenuComponent } from '../index';\nimport type { MessageComponent } from './ActionRow';\n\nexport interface MappedComponentTypes {\n\t[ComponentType.ActionRow]: ActionRow;\n\t[ComponentType.Button]: ButtonComponent;\n\t[ComponentType.SelectMenu]: SelectMenuComponent;\n}\n\n/**\n * Factory for creating components from API data\n * @param data The api data to transform to a component class\n */\nexport function createComponent<T extends keyof MappedComponentTypes>(\n\tdata: APIMessageComponent & { type: T },\n): MappedComponentTypes[T];\nexport function createComponent<C extends MessageComponent>(data: C): C;\nexport function createComponent(data: APIMessageComponent | MessageComponent): Component {\n\tif (data instanceof Component) {\n\t\treturn data;\n\t}\n\n\tswitch (data.type) {\n\t\tcase ComponentType.ActionRow:\n\t\t\treturn new ActionRow(data);\n\t\tcase ComponentType.Button:\n\t\t\treturn new ButtonComponent(data);\n\t\tcase ComponentType.SelectMenu:\n\t\t\treturn new SelectMenuComponent(data);\n\t\tdefault:\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Cannot serialize component type: ${data.type as number}`);\n\t}\n}\n","import {\n\tComponentType,\n\tButtonStyle,\n\ttype APIMessageComponentEmoji,\n\ttype APIButtonComponent,\n\ttype APIButtonComponentWithURL,\n\ttype APIButtonComponentWithCustomId,\n} from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated button component\n */\nexport class UnsafeButtonComponent extends Component<Partial<APIButtonComponent> & { type: ComponentType.Button }> {\n\tpublic constructor(data?: Partial<APIButtonComponent>) {\n\t\tsuper({ type: ComponentType.Button, ...data });\n\t}\n\n\t/**\n\t * The style of this button\n\t */\n\tpublic get style() {\n\t\treturn this.data.style;\n\t}\n\n\t/**\n\t * The label of this button\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The emoji used in this button\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this button is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * The custom id of this button (only defined on non-link buttons)\n\t */\n\tpublic get customId(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithCustomId).custom_id;\n\t}\n\n\t/**\n\t * The URL of this button (only defined on link buttons)\n\t */\n\tpublic get url(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithURL).url;\n\t}\n\n\t/**\n\t * Sets the style of this button\n\t * @param style The style of the button\n\t */\n\tpublic setStyle(style: ButtonStyle) {\n\t\tthis.data.style = style;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL for this button\n\t * @param url The URL to open when this button is clicked\n\t */\n\tpublic setURL(url: string) {\n\t\t(this.data as APIButtonComponentWithURL).url = url;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this button\n\t * @param customId The custom id to use for this button\n\t */\n\tpublic setCustomId(customId: string) {\n\t\t(this.data as APIButtonComponentWithCustomId).custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this button is disable or not\n\t * @param disabled Whether or not to disable this button or not\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the label for this button\n\t * @param label The label to display on this button\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIButtonComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APIButtonComponent;\n\t}\n\n\tpublic equals(other: APIButtonComponent | UnsafeButtonComponent) {\n\t\tif (other instanceof UnsafeButtonComponent) {\n\t\t\treturn isEqual(other.data, this.data);\n\t\t}\n\t\treturn isEqual(other, this.data);\n\t}\n}\n","import type { ButtonStyle, APIMessageComponentEmoji, APIButtonComponent } from 'discord-api-types/v9';\nimport {\n\tbuttonLabelValidator,\n\tbuttonStyleValidator,\n\tcustomIdValidator,\n\tdisabledValidator,\n\temojiValidator,\n\turlValidator,\n\tvalidateRequiredButtonParameters,\n} from '../Assertions';\nimport { UnsafeButtonComponent } from './UnsafeButton';\n\n/**\n * Represents a validated button component\n */\nexport class ButtonComponent extends UnsafeButtonComponent {\n\tpublic override setStyle(style: ButtonStyle) {\n\t\treturn super.setStyle(buttonStyleValidator.parse(style));\n\t}\n\n\tpublic override setURL(url: string) {\n\t\treturn super.setURL(urlValidator.parse(url));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override setLabel(label: string) {\n\t\treturn super.setLabel(buttonLabelValidator.parse(label));\n\t}\n\n\tpublic override toJSON(): APIButtonComponent {\n\t\tvalidateRequiredButtonParameters(this.style, this.label, this.emoji, this.customId, this.url);\n\t\treturn super.toJSON();\n\t}\n}\n","import { APISelectMenuOption, ComponentType, type APISelectMenuComponent } from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated select menu component\n */\nexport class UnsafeSelectMenuComponent extends Component<\n\tPartial<Omit<APISelectMenuComponent, 'options'>> & { type: ComponentType.SelectMenu }\n> {\n\t/**\n\t * The options within this select menu\n\t */\n\tpublic readonly options: UnsafeSelectMenuOption[];\n\n\tpublic constructor(data?: Partial<APISelectMenuComponent>) {\n\t\tconst { options, ...initData } = data ?? {};\n\t\tsuper({ type: ComponentType.SelectMenu, ...initData });\n\t\tthis.options = options?.map((o) => new UnsafeSelectMenuOption(o)) ?? [];\n\t}\n\n\t/**\n\t * The placeholder for this select menu\n\t */\n\tpublic get placeholder() {\n\t\treturn this.data.placeholder;\n\t}\n\n\t/**\n\t * The maximum amount of options that can be selected\n\t */\n\tpublic get maxValues() {\n\t\treturn this.data.max_values;\n\t}\n\n\t/**\n\t * The minimum amount of options that must be selected\n\t */\n\tpublic get minValues() {\n\t\treturn this.data.min_values;\n\t}\n\n\t/**\n\t * The custom id of this select menu\n\t */\n\tpublic get customId() {\n\t\treturn this.data.custom_id;\n\t}\n\n\t/**\n\t * Whether this select menu is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * Sets the placeholder for this select menu\n\t * @param placeholder The placeholder to use for this select menu\n\t */\n\tpublic setPlaceholder(placeholder: string) {\n\t\tthis.data.placeholder = placeholder;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the minimum values that must be selected in the select menu\n\t * @param minValues The minimum values that must be selected\n\t */\n\tpublic setMinValues(minValues: number) {\n\t\tthis.data.min_values = minValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the maximum values that must be selected in the select menu\n\t * @param minValues The maximum values that must be selected\n\t */\n\tpublic setMaxValues(maxValues: number) {\n\t\tthis.data.max_values = maxValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this select menu\n\t * @param customId The custom id to use for this select menu\n\t */\n\tpublic setCustomId(customId: string) {\n\t\tthis.data.custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether or not this select menu is disabled\n\t * @param disabled Whether or not this select menu is disabled\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds options to this select menu\n\t * @param options The options to add to this select menu\n\t * @returns\n\t */\n\tpublic addOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.push(\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the options on this select menu\n\t * @param options The options to set on this select menu\n\t */\n\tpublic setOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.splice(\n\t\t\t0,\n\t\t\tthis.options.length,\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t} as APISelectMenuComponent;\n\t}\n\n\tpublic equals(other: APISelectMenuComponent | UnsafeSelectMenuComponent): boolean {\n\t\tif (other instanceof UnsafeSelectMenuComponent) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.options, this.options);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t});\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\n\n/**\n * Represents a non-validated option within a select menu component\n */\nexport class UnsafeSelectMenuOption {\n\tpublic constructor(protected data: Partial<APISelectMenuOption> = {}) {}\n\n\t/**\n\t * The label for this option\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The value for this option\n\t */\n\tpublic get value() {\n\t\treturn this.data.value;\n\t}\n\n\t/**\n\t * The description for this option\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The emoji for this option\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this option is selected by default\n\t */\n\tpublic get default() {\n\t\treturn this.data.default;\n\t}\n\n\t/**\n\t * Sets the label of this option\n\t * @param label The label to show on this option\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value of this option\n\t * @param value The value of this option\n\t */\n\tpublic setValue(value: string) {\n\t\tthis.data.value = value;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this option.\n\t * @param description The description of this option\n\t */\n\tpublic setDescription(description: string) {\n\t\tthis.data.description = description;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this option is selected by default\n\t * @param isDefault Whether this option is selected by default\n\t */\n\tpublic setDefault(isDefault = true) {\n\t\tthis.data.default = isDefault;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuOption {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APISelectMenuOption;\n\t}\n}\n","import type { APISelectMenuComponent } from 'discord-api-types/v9';\nimport {\n\tcustomIdValidator,\n\tdisabledValidator,\n\tminMaxValidator,\n\tplaceholderValidator,\n\tvalidateRequiredSelectMenuParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuComponent } from './UnsafeSelectMenu';\n\n/**\n * Represents a validated select menu component\n */\nexport class SelectMenuComponent extends UnsafeSelectMenuComponent {\n\tpublic override setPlaceholder(placeholder: string) {\n\t\treturn super.setPlaceholder(placeholderValidator.parse(placeholder));\n\t}\n\n\tpublic override setMinValues(minValues: number) {\n\t\treturn super.setMinValues(minMaxValidator.parse(minValues));\n\t}\n\n\tpublic override setMaxValues(maxValues: number) {\n\t\treturn super.setMaxValues(minMaxValidator.parse(maxValues));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override toJSON(): APISelectMenuComponent {\n\t\tvalidateRequiredSelectMenuParameters(this.options, this.customId);\n\t\treturn super.toJSON();\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\nimport {\n\tdefaultValidator,\n\temojiValidator,\n\tlabelValueValidator,\n\tvalidateRequiredSelectMenuOptionParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\n\n/**\n * Represents a validated option within a select menu component\n */\nexport class SelectMenuOption extends UnsafeSelectMenuOption {\n\tpublic override setDescription(description: string) {\n\t\treturn super.setDescription(labelValueValidator.parse(description));\n\t}\n\n\tpublic override setDefault(isDefault = true) {\n\t\treturn super.setDefault(defaultValidator.parse(isDefault));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override toJSON(): APISelectMenuOption {\n\t\tvalidateRequiredSelectMenuOptionParameters(this.label, this.value);\n\t\treturn super.toJSON();\n\t}\n}\n","import is from '@sindresorhus/is';\nimport type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\nimport type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^[\\P{Lu}\\p{N}_-]+$/u);\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nconst descriptionPredicate = z.string().min(1).max(100);\n\nexport function validateDescription(description: unknown): asserts description is string {\n\tdescriptionPredicate.parse(description);\n}\n\nconst maxArrayLengthPredicate = z.unknown().array().max(25);\n\nexport function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] {\n\tmaxArrayLengthPredicate.parse(options);\n}\n\nexport function validateRequiredParameters(\n\tname: string,\n\tdescription: string,\n\toptions: ToAPIApplicationCommandOptions[],\n) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert description conditions\n\tvalidateDescription(description);\n\n\t// Assert options conditions\n\tvalidateMaxOptionsLength(options);\n}\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateRequired(required: unknown): asserts required is boolean {\n\tbooleanPredicate.parse(required);\n}\n\nexport function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) {\n\tmaxArrayLengthPredicate.parse(choices);\n}\n\nexport function assertReturnOfBuilder<\n\tT extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder,\n>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T {\n\tconst instanceName = ExpectedInstanceOf.name;\n\n\tif (is.nullOrUndefined(input)) {\n\t\tthrow new TypeError(\n\t\t\t`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`,\n\t\t);\n\t}\n\n\tif (is.primitive(input)) {\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);\n\t}\n\n\tif (!(input instanceof ExpectedInstanceOf)) {\n\t\tconst casted = input as Record<PropertyKey, unknown>;\n\n\t\tconst constructorName = is.function_(input) ? input.name : casted.constructor.name;\n\t\tconst stringTag = Reflect.get(casted, Symbol.toStringTag) as string | undefined;\n\n\t\tconst fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;\n\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);\n\t}\n}\n","import type { APIApplicationCommandOption, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport {\n\tassertReturnOfBuilder,\n\tvalidateDefaultPermission,\n\tvalidateMaxOptionsLength,\n\tvalidateRequiredParameters,\n} from './Assertions';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\n@mix(SharedSlashCommandOptions, SharedNameAndDescription)\nexport class SlashCommandBuilder {\n\t/**\n\t * The name of this slash command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this slash command\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this slash command\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand group to this command\n\t *\n\t * @param input A function that returns a subcommand group builder, or an already built builder\n\t */\n\tpublic addSubcommandGroup(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandGroupBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandGroupBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand to this command\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n\nexport interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n\nexport interface SlashCommandSubcommandsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tPick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {}\n\nexport interface SlashCommandOptionsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tSharedSlashCommandOptions,\n\t\tPick<SlashCommandBuilder, 'toJSON'> {}\n\nexport interface ToAPIApplicationCommandOptions {\n\ttoJSON: () => APIApplicationCommandOption;\n}\n","import { APIApplicationCommandBooleanOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandBooleanOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic toJSON(): APIApplicationCommandBooleanOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string): this {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n","import type { APIApplicationCommandBasicOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { validateRequiredParameters, validateRequired } from '../Assertions';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {\n\tpublic abstract readonly type: ApplicationCommandOptionType;\n\n\tpublic readonly required: boolean = false;\n\n\t/**\n\t * Marks the option as required\n\t *\n\t * @param required If this option should be required\n\t */\n\tpublic setRequired(required: boolean) {\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(required);\n\n\t\tReflect.set(this, 'required', required);\n\n\t\treturn this;\n\t}\n\n\tpublic abstract toJSON(): APIApplicationCommandBasicOption;\n\n\tprotected runRequiredValidations() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(this.required);\n\t}\n}\n","import { APIApplicationCommandChannelOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionChannelTypesMixin } from '../mixins/ApplicationCommandOptionChannelTypesMixin';\n\n@mix(ApplicationCommandOptionChannelTypesMixin)\nexport class SlashCommandChannelOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic toJSON(): APIApplicationCommandChannelOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypesMixin {}\n","import { ChannelType } from 'discord-api-types/v9';\nimport { z, ZodLiteral } from 'zod';\n\n// Only allow valid channel types to be used. (This can't be dynamic because const enums are erased at runtime)\nconst allowedChannelTypes = [\n\tChannelType.GuildText,\n\tChannelType.GuildVoice,\n\tChannelType.GuildCategory,\n\tChannelType.GuildNews,\n\tChannelType.GuildStore,\n\tChannelType.GuildNewsThread,\n\tChannelType.GuildPublicThread,\n\tChannelType.GuildPrivateThread,\n\tChannelType.GuildStageVoice,\n] as const;\n\nexport type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];\n\nconst channelTypePredicate = z.union(\n\tallowedChannelTypes.map((type) => z.literal(type)) as [\n\t\tZodLiteral<ChannelType>,\n\t\tZodLiteral<ChannelType>,\n\t\t...ZodLiteral<ChannelType>[]\n\t],\n);\n\nexport class ApplicationCommandOptionChannelTypesMixin {\n\tpublic readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];\n\n\t/**\n\t * Adds a channel type to this option\n\t *\n\t * @param channelType The type of channel to allow\n\t */\n\tpublic addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes) {\n\t\tif (this.channel_types === undefined) {\n\t\t\tReflect.set(this, 'channel_types', []);\n\t\t}\n\n\t\tchannelTypePredicate.parse(channelType);\n\t\tthis.channel_types!.push(channelType);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds channel types to this option\n\t *\n\t * @param channelTypes The channel types to add\n\t */\n\tpublic addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]) {\n\t\tchannelTypes.forEach((channelType) => this.addChannelType(channelType));\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandIntegerOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number().int();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandIntegerOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandIntegerOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandIntegerOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","export abstract class ApplicationCommandNumericOptionMinMaxValueMixin {\n\tpublic readonly max_value?: number;\n\tpublic readonly min_value?: number;\n\n\t/**\n\t * Sets the maximum number value of this option\n\t * @param max The maximum value this option can be\n\t */\n\tpublic abstract setMaxValue(max: number): this;\n\n\t/**\n\t * Sets the minimum number value of this option\n\t * @param min The minimum value this option can be\n\t */\n\tpublic abstract setMinValue(min: number): this;\n}\n","import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport { validateMaxChoicesLength } from '../Assertions';\n\nconst stringPredicate = z.string().min(1).max(100);\nconst numberPredicate = z.number().gt(-Infinity).lt(Infinity);\nconst choicesPredicate = z\n\t.object({ name: stringPredicate, value: z.union([stringPredicate, numberPredicate]) })\n\t.array();\nconst booleanPredicate = z.boolean();\n\nexport class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends string | number> {\n\tpublic readonly choices?: APIApplicationCommandOptionChoice<T>[];\n\tpublic readonly autocomplete?: boolean;\n\n\t// Since this is present and this is a mixin, this is needed\n\tpublic readonly type!: ApplicationCommandOptionType;\n\n\t/**\n\t * Adds a choice for this option\n\t *\n\t * @param choice The choice to add\n\t */\n\tpublic addChoice(choice: APIApplicationCommandOptionChoice<T>): this {\n\t\tconst { name, value } = choice;\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tif (this.choices === undefined) {\n\t\t\tReflect.set(this, 'choices', []);\n\t\t}\n\n\t\tvalidateMaxChoicesLength(this.choices!);\n\n\t\t// Validate name\n\t\tstringPredicate.parse(name);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) {\n\t\t\tstringPredicate.parse(value);\n\t\t} else {\n\t\t\tnumberPredicate.parse(value);\n\t\t}\n\n\t\tthis.choices!.push({ name, value });\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds multiple choices for this option\n\t *\n\t * @param choices The choices to add\n\t */\n\tpublic addChoices(...choices: APIApplicationCommandOptionChoice<T>[]): this {\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tfor (const entry of choices) this.addChoice(entry);\n\t\treturn this;\n\t}\n\n\tpublic setChoices<Input extends APIApplicationCommandOptionChoice<T>[]>(...choices: Input): this {\n\t\tif (choices.length > 0 && this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tReflect.set(this, 'choices', []);\n\t\tfor (const entry of choices) this.addChoice(entry);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Marks the option as autocompletable\n\t * @param autocomplete If this option should be autocompletable\n\t */\n\tpublic setAutocomplete(autocomplete: boolean): this {\n\t\t// Assert that you actually passed a boolean\n\t\tbooleanPredicate.parse(autocomplete);\n\n\t\tif (autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tReflect.set(this, 'autocomplete', autocomplete);\n\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandMentionableOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandMentionableOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic toJSON(): APIApplicationCommandMentionableOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandNumberOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandNumberOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Number as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandNumberOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandNumberOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","import { APIApplicationCommandRoleOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandRoleOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic toJSON(): APIApplicationCommandRoleOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandAttachmentOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandAttachmentOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Attachment as const;\n\n\tpublic toJSON(): APIApplicationCommandAttachmentOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\n@mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandStringOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic toJSON(): APIApplicationCommandStringOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {}\n","import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandUserOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic toJSON(): APIApplicationCommandUserOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { ApplicationCommandOptionBase } from './ApplicationCommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandNumberOption } from '../options/number';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandAttachmentOption } from '../options/attachment';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds an attachment option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addAttachmentOption(\n\t\tinput: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandAttachmentOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput:\n\t\t\t| SlashCommandStringOption\n\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandStringOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandStringOption\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput:\n\t\t\t| SlashCommandIntegerOption\n\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandIntegerOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandIntegerOption\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\t/**\n\t * Adds a number option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addNumberOption(\n\t\tinput:\n\t\t\t| SlashCommandNumberOption\n\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandNumberOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandNumberOption\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandNumberOption);\n\t}\n\n\tprivate _sharedAddOptionMethod<T extends ApplicationCommandOptionBase>(\n\t\tinput:\n\t\t\t| T\n\t\t\t| Omit<T, 'setAutocomplete'>\n\t\t\t| Omit<T, 'addChoice' | 'addChoices'>\n\t\t\t| ((builder: T) => T | Omit<T, 'setAutocomplete'> | Omit<T, 'addChoice' | 'addChoices'>),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit<this, 'addSubcommand' | 'addSubcommandGroup'> : this {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new Instance()) : input;\n\n\t\tassertReturnOfBuilder(result, Instance);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n","import {\n\tAPIApplicationCommandSubcommandGroupOption,\n\tAPIApplicationCommandSubcommandOption,\n\tApplicationCommandOptionType,\n} from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\n\n/**\n * Represents a folder for subcommands\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription)\nexport class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand group\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand group\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The subcommands part of this subcommand group\n\t */\n\tpublic readonly options: SlashCommandSubcommandBuilder[] = [];\n\n\t/**\n\t * Adds a new subcommand to this group\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t) {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandSubcommandGroupOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.SubcommandGroup,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {}\n\n/**\n * Represents a subcommand\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription, SharedSlashCommandOptions)\nexport class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this subcommand\n\t */\n\tpublic readonly options: ApplicationCommandOptionBase[] = [];\n\n\tpublic toJSON(): APIApplicationCommandSubcommandOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.Subcommand,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {}\n","import { z } from 'zod';\nimport { ApplicationCommandType } from 'discord-api-types/v9';\nimport type { ContextMenuCommandType } from './ContextMenuCommandBuilder';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^( *[\\p{L}\\p{N}_-]+ *)+$/u);\n\nconst typePredicate = z.union([z.literal(ApplicationCommandType.User), z.literal(ApplicationCommandType.Message)]);\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nexport function validateType(type: unknown): asserts type is ContextMenuCommandType {\n\ttypePredicate.parse(type);\n}\n\nexport function validateRequiredParameters(name: string, type: number) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert type is valid\n\tvalidateType(type);\n}\n","import { validateRequiredParameters, validateName, validateType, validateDefaultPermission } from './Assertions';\nimport type { ApplicationCommandType, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\n\nexport class ContextMenuCommandBuilder {\n\t/**\n\t * The name of this context menu command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The type of this context menu command\n\t */\n\tpublic readonly type: ContextMenuCommandType = undefined!;\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the type\n\t *\n\t * @param type The type\n\t */\n\tpublic setType(type: ContextMenuCommandType) {\n\t\t// Assert the type is valid\n\t\tvalidateType(type);\n\n\t\tReflect.set(this, 'type', type);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.type);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\ttype: this.type,\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n}\n\nexport type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;\n","export interface JSONEncodable<T> {\n\t/**\n\t * Transforms this object to its JSON format\n\t */\n\ttoJSON: () => T;\n}\n\n/**\n * Indicates if an object is encodable or not.\n * @param maybeEncodable The object to check against\n */\nexport function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n\treturn maybeEncodable !== null && typeof maybeEncodable === 'object' && 'toJSON' in maybeEncodable;\n}\n"],"mappings":"ycAAA,iZACA,wBAEO,GAAM,GAAqB,EAAE,SAAS,IAAI,GAAG,IAAI,KAE3C,GAAsB,EAAE,SAAS,IAAI,GAAG,IAAI,MAE5C,GAAuB,EAAE,UAAU,WAEnC,GAAsB,EAAE,OAAO,CAC3C,KAAM,EACN,MAAO,GACP,OAAQ,KAGI,EAA4B,GAAoB,QAEhD,GAAuB,EAAE,SAAS,IAAI,IAE5C,WAA6B,EAAsB,EAAgC,CACzF,GA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K,KAAM,KAAK,MACpC,CACN,KAAM,KAAK,KACX,KAAM,KAAK,KACX,mBAAoB,KAAK,qBA1ErB,kCCQA,YAAyB,EAAmE,CAClG,MAAO,KAAmB,MAAQ,MAAO,IAAmB,UAAY,UAAY,GADrE","names":[]}
1
+ {"version":3,"sources":["../src/messages/embed/Assertions.ts","../src/messages/embed/UnsafeEmbed.ts","../src/messages/embed/Embed.ts","../src/messages/formatters.ts","../src/components/Assertions.ts","../src/components/ActionRow.ts","../src/components/Component.ts","../src/components/Components.ts","../src/components/button/UnsafeButton.ts","../src/components/button/Button.ts","../src/components/selectMenu/UnsafeSelectMenu.ts","../src/components/selectMenu/UnsafeSelectMenuOption.ts","../src/components/selectMenu/SelectMenu.ts","../src/components/selectMenu/SelectMenuOption.ts","../src/interactions/slashCommands/Assertions.ts","../src/interactions/slashCommands/SlashCommandBuilder.ts","../src/interactions/slashCommands/options/boolean.ts","../src/interactions/slashCommands/mixins/NameAndDescription.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionBase.ts","../src/interactions/slashCommands/options/channel.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionChannelTypesMixin.ts","../src/interactions/slashCommands/options/integer.ts","../src/interactions/slashCommands/mixins/ApplicationCommandNumericOptionMinMaxValueMixin.ts","../src/interactions/slashCommands/mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin.ts","../src/interactions/slashCommands/options/mentionable.ts","../src/interactions/slashCommands/options/number.ts","../src/interactions/slashCommands/options/role.ts","../src/interactions/slashCommands/options/attachment.ts","../src/interactions/slashCommands/options/string.ts","../src/interactions/slashCommands/options/user.ts","../src/interactions/slashCommands/mixins/SharedSlashCommandOptions.ts","../src/interactions/slashCommands/SlashCommandSubcommands.ts","../src/interactions/contextMenuCommands/Assertions.ts","../src/interactions/contextMenuCommands/ContextMenuCommandBuilder.ts","../src/util/jsonEncodable.ts"],"sourcesContent":["import type { APIEmbedField } from 'discord-api-types/v9';\nimport { z } from 'zod';\n\nexport const fieldNamePredicate = z.string().min(1).max(256);\n\nexport const fieldValuePredicate = z.string().min(1).max(1024);\n\nexport const fieldInlinePredicate = z.boolean().optional();\n\nexport const embedFieldPredicate = z.object({\n\tname: fieldNamePredicate,\n\tvalue: fieldValuePredicate,\n\tinline: fieldInlinePredicate,\n});\n\nexport const embedFieldsArrayPredicate = embedFieldPredicate.array();\n\nexport const fieldLengthPredicate = z.number().lte(25);\n\nexport function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void {\n\tfieldLengthPredicate.parse((fields?.length ?? 0) + amountAdding);\n}\n\nexport const authorNamePredicate = fieldNamePredicate.nullable();\n\nexport const urlPredicate = z.string().url().nullish();\n\nexport const RGBPredicate = z.number().int().gte(0).lte(255);\nexport const colorPredicate = z\n\t.number()\n\t.int()\n\t.gte(0)\n\t.lte(0xffffff)\n\t.nullable()\n\t.or(z.tuple([RGBPredicate, RGBPredicate, RGBPredicate]));\n\nexport const descriptionPredicate = z.string().min(1).max(4096).nullable();\n\nexport const footerTextPredicate = z.string().min(1).max(2048).nullable();\n\nexport const timestampPredicate = z.union([z.number(), z.date()]).nullable();\n\nexport const titlePredicate = fieldNamePredicate.nullable();\n","import type {\n\tAPIEmbed,\n\tAPIEmbedAuthor,\n\tAPIEmbedField,\n\tAPIEmbedFooter,\n\tAPIEmbedImage,\n\tAPIEmbedVideo,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../../util/equatable';\nimport isEqual from 'fast-deep-equal';\n\nexport type RGBTuple = [red: number, green: number, blue: number];\n\nexport interface IconData {\n\t/**\n\t * The URL of the icon\n\t */\n\ticonURL?: string;\n\t/**\n\t * The proxy URL of the icon\n\t */\n\tproxyIconURL?: string;\n}\n\nexport type EmbedAuthorData = Omit<APIEmbedAuthor, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedAuthorOptions = Omit<EmbedAuthorData, 'proxyIconURL'>;\n\nexport type EmbedFooterData = Omit<APIEmbedFooter, 'icon_url' | 'proxy_icon_url'> & IconData;\n\nexport type EmbedFooterOptions = Omit<EmbedFooterData, 'proxyIconURL'>;\n\nexport interface EmbedImageData extends Omit<APIEmbedImage, 'proxy_url'> {\n\t/**\n\t * The proxy URL for the image\n\t */\n\tproxyURL?: string;\n}\n\n/**\n * Represents a non-validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> {\n\tpublic readonly data: APIEmbed;\n\n\tpublic constructor(data: APIEmbed = {}) {\n\t\tthis.data = { ...data };\n\t\tif (data.timestamp) this.data.timestamp = new Date(data.timestamp).toISOString();\n\t}\n\n\t/**\n\t * An array of fields of this embed\n\t */\n\tpublic get fields() {\n\t\treturn this.data.fields;\n\t}\n\n\t/**\n\t * The embed title\n\t */\n\tpublic get title() {\n\t\treturn this.data.title;\n\t}\n\n\t/**\n\t * The embed description\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The embed URL\n\t */\n\tpublic get url() {\n\t\treturn this.data.url;\n\t}\n\n\t/**\n\t * The embed color\n\t */\n\tpublic get color() {\n\t\treturn this.data.color;\n\t}\n\n\t/**\n\t * The timestamp of the embed in an ISO 8601 format\n\t */\n\tpublic get timestamp() {\n\t\treturn this.data.timestamp;\n\t}\n\n\t/**\n\t * The embed thumbnail data\n\t */\n\tpublic get thumbnail(): EmbedImageData | undefined {\n\t\tif (!this.data.thumbnail) return undefined;\n\t\treturn {\n\t\t\turl: this.data.thumbnail.url,\n\t\t\tproxyURL: this.data.thumbnail.proxy_url,\n\t\t\theight: this.data.thumbnail.height,\n\t\t\twidth: this.data.thumbnail.width,\n\t\t};\n\t}\n\n\t/**\n\t * The embed image data\n\t */\n\tpublic get image(): EmbedImageData | undefined {\n\t\tif (!this.data.image) return undefined;\n\t\treturn {\n\t\t\turl: this.data.image.url,\n\t\t\tproxyURL: this.data.image.proxy_url,\n\t\t\theight: this.data.image.height,\n\t\t\twidth: this.data.image.width,\n\t\t};\n\t}\n\n\t/**\n\t * Received video data\n\t */\n\tpublic get video(): APIEmbedVideo | undefined {\n\t\treturn this.data.video;\n\t}\n\n\t/**\n\t * The embed author data\n\t */\n\tpublic get author(): EmbedAuthorData | undefined {\n\t\tif (!this.data.author) return undefined;\n\t\treturn {\n\t\t\tname: this.data.author.name,\n\t\t\turl: this.data.author.url,\n\t\t\ticonURL: this.data.author.icon_url,\n\t\t\tproxyIconURL: this.data.author.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * Received data about the embed provider\n\t */\n\tpublic get provider() {\n\t\treturn this.data.provider;\n\t}\n\n\t/**\n\t * The embed footer data\n\t */\n\tpublic get footer(): EmbedFooterData | undefined {\n\t\tif (!this.data.footer) return undefined;\n\t\treturn {\n\t\t\ttext: this.data.footer.text,\n\t\t\ticonURL: this.data.footer.icon_url,\n\t\t\tproxyIconURL: this.data.footer.proxy_icon_url,\n\t\t};\n\t}\n\n\t/**\n\t * The accumulated length for the embed title, description, fields, footer text, and author name\n\t */\n\tpublic get length(): number {\n\t\treturn (\n\t\t\t(this.data.title?.length ?? 0) +\n\t\t\t(this.data.description?.length ?? 0) +\n\t\t\t(this.data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) +\n\t\t\t(this.data.footer?.text.length ?? 0) +\n\t\t\t(this.data.author?.name.length ?? 0)\n\t\t);\n\t}\n\n\t/**\n\t * The hex color of the current color of the embed\n\t */\n\tpublic get hexColor() {\n\t\treturn typeof this.data.color === 'number' ? `#${this.data.color.toString(16).padStart(6, '0')}` : this.data.color;\n\t}\n\n\t/**\n\t * Adds fields to the embed (max 25)\n\t *\n\t * @param fields The fields to add\n\t */\n\tpublic addFields(...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.push(...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Removes, replaces, or inserts fields in the embed (max 25)\n\t *\n\t * @param index The index to start at\n\t * @param deleteCount The number of fields to remove\n\t * @param fields The replacing field objects\n\t */\n\tpublic spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\tif (this.data.fields) this.data.fields.splice(index, deleteCount, ...fields);\n\t\telse this.data.fields = fields;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the embed's fields (max 25).\n\t * @param fields The fields to set\n\t */\n\tpublic setFields(...fields: APIEmbedField[]) {\n\t\tthis.spliceFields(0, this.fields?.length ?? 0, ...fields);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the author of this embed\n\t *\n\t * @param options The options for the author\n\t */\n\tpublic setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.author = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.author = { name: options.name, url: options.url, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the color of this embed\n\t *\n\t * @param color The color of the embed\n\t */\n\tpublic setColor(color: number | RGBTuple | null): this {\n\t\tif (Array.isArray(color)) {\n\t\t\tconst [red, green, blue] = color;\n\t\t\tthis.data.color = (red << 16) + (green << 8) + blue;\n\t\t\treturn this;\n\t\t}\n\t\tthis.data.color = color ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this embed\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string | null): this {\n\t\tthis.data.description = description ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the footer of this embed\n\t *\n\t * @param options The options for the footer\n\t */\n\tpublic setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\tthis.data.footer = undefined;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.data.footer = { text: options.text, icon_url: options.iconURL };\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the image of this embed\n\t *\n\t * @param url The URL of the image\n\t */\n\tpublic setImage(url: string | null): this {\n\t\tthis.data.image = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the thumbnail of this embed\n\t *\n\t * @param url The URL of the thumbnail\n\t */\n\tpublic setThumbnail(url: string | null): this {\n\t\tthis.data.thumbnail = url ? { url } : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the timestamp of this embed\n\t *\n\t * @param timestamp The timestamp or date\n\t */\n\tpublic setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\tthis.data.timestamp = timestamp ? new Date(timestamp).toISOString() : undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the title of this embed\n\t *\n\t * @param title The title\n\t */\n\tpublic setTitle(title: string | null): this {\n\t\tthis.data.title = title ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL of this embed\n\t *\n\t * @param url The URL\n\t */\n\tpublic setURL(url: string | null): this {\n\t\tthis.data.url = url ?? undefined;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Transforms the embed to a plain object\n\t */\n\tpublic toJSON(): APIEmbed {\n\t\treturn { ...this.data };\n\t}\n\n\tpublic equals(other: UnsafeEmbed | APIEmbed) {\n\t\tconst { image: thisImage, thumbnail: thisThumbnail, ...thisData } = this.data;\n\t\tconst data = other instanceof UnsafeEmbed ? other.data : other;\n\t\tconst { image, thumbnail, ...otherData } = data;\n\t\treturn isEqual(otherData, thisData) && image?.url === thisImage?.url && thumbnail?.url === thisThumbnail?.url;\n\t}\n}\n","import type { APIEmbedField } from 'discord-api-types/v9';\nimport {\n\tauthorNamePredicate,\n\tcolorPredicate,\n\tdescriptionPredicate,\n\tembedFieldsArrayPredicate,\n\tfooterTextPredicate,\n\ttimestampPredicate,\n\ttitlePredicate,\n\turlPredicate,\n\tvalidateFieldLength,\n} from './Assertions';\nimport { EmbedAuthorOptions, EmbedFooterOptions, RGBTuple, UnsafeEmbed } from './UnsafeEmbed';\n\n/**\n * Represents a validated embed in a message (image/video preview, rich embed, etc.)\n */\nexport class Embed extends UnsafeEmbed {\n\tpublic override addFields(...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.addFields(...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this {\n\t\t// Ensure adding these fields won't exceed the 25 field limit\n\t\tvalidateFieldLength(fields.length - deleteCount, this.fields);\n\n\t\t// Data assertions\n\t\treturn super.spliceFields(index, deleteCount, ...embedFieldsArrayPredicate.parse(fields));\n\t}\n\n\tpublic override setAuthor(options: EmbedAuthorOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setAuthor(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tauthorNamePredicate.parse(options.name);\n\t\turlPredicate.parse(options.iconURL);\n\t\turlPredicate.parse(options.url);\n\n\t\treturn super.setAuthor(options);\n\t}\n\n\tpublic override setColor(color: number | RGBTuple | null): this {\n\t\t// Data assertions\n\t\treturn super.setColor(colorPredicate.parse(color));\n\t}\n\n\tpublic override setDescription(description: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setDescription(descriptionPredicate.parse(description));\n\t}\n\n\tpublic override setFooter(options: EmbedFooterOptions | null): this {\n\t\tif (options === null) {\n\t\t\treturn super.setFooter(null);\n\t\t}\n\n\t\t// Data assertions\n\t\tfooterTextPredicate.parse(options.text);\n\t\turlPredicate.parse(options.iconURL);\n\n\t\treturn super.setFooter(options);\n\t}\n\n\tpublic override setImage(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setImage(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setThumbnail(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setThumbnail(urlPredicate.parse(url)!);\n\t}\n\n\tpublic override setTimestamp(timestamp: number | Date | null = Date.now()): this {\n\t\t// Data assertions\n\t\treturn super.setTimestamp(timestampPredicate.parse(timestamp));\n\t}\n\n\tpublic override setTitle(title: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setTitle(titlePredicate.parse(title));\n\t}\n\n\tpublic override setURL(url: string | null): this {\n\t\t// Data assertions\n\t\treturn super.setURL(urlPredicate.parse(url)!);\n\t}\n}\n","import type { Snowflake } from 'discord-api-types/globals';\nimport type { URL } from 'url';\n\n/**\n * Wraps the content inside a codeblock with no language\n *\n * @param content The content to wrap\n */\nexport function codeBlock<C extends string>(content: C): `\\`\\`\\`\\n${C}\\`\\`\\``;\n\n/**\n * Wraps the content inside a codeblock with the specified language\n *\n * @param language The language for the codeblock\n * @param content The content to wrap\n */\nexport function codeBlock<L extends string, C extends string>(language: L, content: C): `\\`\\`\\`${L}\\n${C}\\`\\`\\``;\nexport function codeBlock(language: string, content?: string): string {\n\treturn typeof content === 'undefined' ? `\\`\\`\\`\\n${language}\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\`, which formats it as inline code\n *\n * @param content The content to wrap\n */\nexport function inlineCode<C extends string>(content: C): `\\`${C}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text\n *\n * @param content The content to wrap\n */\nexport function italic<C extends string>(content: C): `_${C}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text\n *\n * @param content The content to wrap\n */\nexport function bold<C extends string>(content: C): `**${C}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underscored text\n *\n * @param content The content to wrap\n */\nexport function underscore<C extends string>(content: C): `__${C}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text\n *\n * @param content The content to wrap\n */\nexport function strikethrough<C extends string>(content: C): `~~${C}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function quote<C extends string>(content: C): `> ${C}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it\n *\n * @param content The content to wrap\n */\nexport function blockQuote<C extends string>(content: C): `>>> ${C}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed<C extends string>(url: C): `<${C}>`;\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding\n *\n * @param url The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\nexport function hideLinkEmbed(url: string | URL) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n */\nexport function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, T extends string>(\n\tcontent: C,\n\turl: URL,\n\ttitle: T,\n): `[${C}](${string} \"${T}\")`;\n\n/**\n * Formats the content and the URL into a masked URL\n *\n * @param content The content to display\n * @param url The URL the content links to\n * @param title The title shown when hovering on the masked link\n */\nexport function hyperlink<C extends string, U extends string, T extends string>(\n\tcontent: C,\n\turl: U,\n\ttitle: T,\n): `[${C}](${U} \"${T}\")`;\nexport function hyperlink(content: string, url: string | URL, title?: string) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Wraps the content inside spoiler (hidden text)\n *\n * @param content The content to wrap\n */\nexport function spoiler<C extends string>(content: C): `||${C}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user ID into a user mention\n *\n * @param userId The user ID to format\n */\nexport function userMention<C extends Snowflake>(userId: C): `<@${C}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a user ID into a member-nickname mention\n *\n * @param memberId The user ID to format\n */\nexport function memberNicknameMention<C extends Snowflake>(memberId: C): `<@!${C}>` {\n\treturn `<@!${memberId}>`;\n}\n\n/**\n * Formats a channel ID into a channel mention\n *\n * @param channelId The channel ID to format\n */\nexport function channelMention<C extends Snowflake>(channelId: C): `<#${C}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role ID into a role mention\n *\n * @param roleId The role ID to format\n */\nexport function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n *\n * @param emojiId The emoji ID to format\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n */\nexport function formatEmoji<C extends Snowflake>(emojiId: C, animated = false): `<a:_:${C}>` | `<:_:${C}>` {\n\treturn `<${animated ? 'a' : ''}:_:${emojiId}>`;\n}\n\n/**\n * Formats a date into a short date-time string\n *\n * @param date The date to format, defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style\n *\n * @param date The date to format\n * @param style The style to use\n */\nexport function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n */\nexport function time<C extends number>(seconds: C): `<t:${C}>`;\n\n/**\n * Formats the given timestamp into a short date-time string\n *\n * @param seconds The time to format, represents an UNIX timestamp in seconds\n * @param style The style to use\n */\nexport function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;\nexport function time(timeOrSeconds?: number | Date, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes, e.g. 16:20\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year, e.g. 20/04/2021\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year, e.g. 20 April 2021\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format, e.g. 2 months ago\n\t */\n\tRelativeTime: 'R',\n} as const;\n\n/**\n * The possible values, see {@link TimestampStyles} for more information\n */\nexport type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];\n\n/**\n * An enum with all the available faces from Discord's native slash commands\n */\nexport enum Faces {\n\t/**\n\t * ¯\\\\_(ツ)\\\\_/¯\n\t */\n\tShrug = '¯\\\\_(ツ)\\\\_/¯',\n\n\t/**\n\t * (╯°□°)╯︵ ┻━┻\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * ┬─┬ ノ( ゜-゜ノ)\n\t */\n\tUnflip = '┬─┬ ノ( ゜-゜ノ)',\n}\n","import { APIMessageComponentEmoji, ButtonStyle } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { SelectMenuOption } from './selectMenu/SelectMenuOption';\n\nexport const customIdValidator = z.string().min(1).max(100);\n\nexport const emojiValidator = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tanimated: z.boolean(),\n\t})\n\t.partial()\n\t.strict();\n\nexport const disabledValidator = z.boolean();\n\nexport const buttonLabelValidator = z.string().nonempty().max(80);\n\nexport const buttonStyleValidator = z.number().int().min(ButtonStyle.Primary).max(ButtonStyle.Link);\n\nexport const placeholderValidator = z.string().max(100);\nexport const minMaxValidator = z.number().int().min(0).max(25);\n\nexport const optionsValidator = z.object({}).array().nonempty();\n\nexport function validateRequiredSelectMenuParameters(options: SelectMenuOption[], customId?: string) {\n\tcustomIdValidator.parse(customId);\n\toptionsValidator.parse(options);\n}\n\nexport const labelValueValidator = z.string().min(1).max(100);\nexport const defaultValidator = z.boolean();\n\nexport function validateRequiredSelectMenuOptionParameters(label?: string, value?: string) {\n\tlabelValueValidator.parse(label);\n\tlabelValueValidator.parse(value);\n}\n\nexport const urlValidator = z.string().url();\n\nexport function validateRequiredButtonParameters(\n\tstyle?: ButtonStyle,\n\tlabel?: string,\n\temoji?: APIMessageComponentEmoji,\n\tcustomId?: string,\n\turl?: string,\n) {\n\tif (url && customId) {\n\t\tthrow new RangeError('URL and custom id are mutually exclusive');\n\t}\n\n\tif (!label && !emoji) {\n\t\tthrow new RangeError('Buttons must have a label and/or an emoji');\n\t}\n\n\tif (style === ButtonStyle.Link) {\n\t\tif (!url) {\n\t\t\tthrow new RangeError('Link buttons must have a url');\n\t\t}\n\t} else if (url) {\n\t\tthrow new RangeError('Non-link buttons cannot have a url');\n\t}\n}\n","import { type APIActionRowComponent, ComponentType, APIMessageComponent } from 'discord-api-types/v9';\nimport type { ButtonComponent, SelectMenuComponent } from '..';\nimport { Component } from './Component';\nimport { createComponent } from './Components';\nimport isEqual from 'fast-deep-equal';\n\nexport type MessageComponent = ActionRowComponent | ActionRow;\n\nexport type ActionRowComponent = ButtonComponent | SelectMenuComponent;\n\n// TODO: Add valid form component types\n/**\n * Represents an action row component\n */\nexport class ActionRow<T extends ActionRowComponent = ActionRowComponent> extends Component<\n\tOmit<Partial<APIActionRowComponent<APIMessageComponent>> & { type: ComponentType.ActionRow }, 'components'>\n> {\n\t/**\n\t * The components within this action row\n\t */\n\tpublic readonly components: T[];\n\n\tpublic constructor({ components, ...data }: Partial<APIActionRowComponent<APIMessageComponent>> = {}) {\n\t\tsuper({ type: ComponentType.ActionRow, ...data });\n\t\tthis.components = (components?.map((c) => createComponent(c)) ?? []) as T[];\n\t}\n\n\t/**\n\t * Adds components to this action row.\n\t * @param components The components to add to this action row.\n\t * @returns\n\t */\n\tpublic addComponents(...components: T[]) {\n\t\tthis.components.push(...components);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the components in this action row\n\t * @param components The components to set this row to\n\t */\n\tpublic setComponents(...components: T[]) {\n\t\tthis.components.splice(0, this.components.length, ...components);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIActionRowComponent<APIMessageComponent> {\n\t\treturn {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t};\n\t}\n\n\tpublic equals(other: APIActionRowComponent<APIMessageComponent> | ActionRow) {\n\t\tif (other instanceof ActionRow) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.components, this.components);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\tcomponents: this.components.map((component) => component.toJSON()),\n\t\t});\n\t}\n}\n","import type { JSONEncodable } from '../util/jsonEncodable';\nimport type {\n\tAPIActionRowComponentTypes,\n\tAPIBaseComponent,\n\tAPIMessageComponent,\n\tComponentType,\n} from 'discord-api-types/v9';\nimport type { Equatable } from '../util/equatable';\n\n/**\n * Represents a discord component\n */\nexport abstract class Component<\n\tDataType extends Partial<APIBaseComponent<ComponentType>> & {\n\t\ttype: ComponentType;\n\t} = APIBaseComponent<ComponentType>,\n> implements JSONEncodable<APIMessageComponent>, Equatable<Component | APIActionRowComponentTypes>\n{\n\t/**\n\t * The API data associated with this component\n\t */\n\tpublic readonly data: DataType;\n\n\tpublic abstract toJSON(): APIMessageComponent;\n\n\tpublic abstract equals(other: Component | APIActionRowComponentTypes): boolean;\n\n\tpublic constructor(data: DataType) {\n\t\tthis.data = data;\n\t}\n\n\t/**\n\t * The type of this component\n\t */\n\tpublic get type(): DataType['type'] {\n\t\treturn this.data.type;\n\t}\n}\n","import { APIMessageComponent, ComponentType } from 'discord-api-types/v9';\nimport { ActionRow, ButtonComponent, Component, SelectMenuComponent } from '../index';\nimport type { MessageComponent } from './ActionRow';\n\nexport interface MappedComponentTypes {\n\t[ComponentType.ActionRow]: ActionRow;\n\t[ComponentType.Button]: ButtonComponent;\n\t[ComponentType.SelectMenu]: SelectMenuComponent;\n}\n\n/**\n * Factory for creating components from API data\n * @param data The api data to transform to a component class\n */\nexport function createComponent<T extends keyof MappedComponentTypes>(\n\tdata: APIMessageComponent & { type: T },\n): MappedComponentTypes[T];\nexport function createComponent<C extends MessageComponent>(data: C): C;\nexport function createComponent(data: APIMessageComponent | MessageComponent): Component {\n\tif (data instanceof Component) {\n\t\treturn data;\n\t}\n\n\tswitch (data.type) {\n\t\tcase ComponentType.ActionRow:\n\t\t\treturn new ActionRow(data);\n\t\tcase ComponentType.Button:\n\t\t\treturn new ButtonComponent(data);\n\t\tcase ComponentType.SelectMenu:\n\t\t\treturn new SelectMenuComponent(data);\n\t\tdefault:\n\t\t\t// @ts-expect-error\n\t\t\tthrow new Error(`Cannot serialize component type: ${data.type as number}`);\n\t}\n}\n","import {\n\tComponentType,\n\tButtonStyle,\n\ttype APIMessageComponentEmoji,\n\ttype APIButtonComponent,\n\ttype APIButtonComponentWithURL,\n\ttype APIButtonComponentWithCustomId,\n} from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated button component\n */\nexport class UnsafeButtonComponent extends Component<Partial<APIButtonComponent> & { type: ComponentType.Button }> {\n\tpublic constructor(data?: Partial<APIButtonComponent>) {\n\t\tsuper({ type: ComponentType.Button, ...data });\n\t}\n\n\t/**\n\t * The style of this button\n\t */\n\tpublic get style() {\n\t\treturn this.data.style;\n\t}\n\n\t/**\n\t * The label of this button\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The emoji used in this button\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this button is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * The custom id of this button (only defined on non-link buttons)\n\t */\n\tpublic get customId(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithCustomId).custom_id;\n\t}\n\n\t/**\n\t * The URL of this button (only defined on link buttons)\n\t */\n\tpublic get url(): string | undefined {\n\t\treturn (this.data as APIButtonComponentWithURL).url;\n\t}\n\n\t/**\n\t * Sets the style of this button\n\t * @param style The style of the button\n\t */\n\tpublic setStyle(style: ButtonStyle) {\n\t\tthis.data.style = style;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the URL for this button\n\t * @param url The URL to open when this button is clicked\n\t */\n\tpublic setURL(url: string) {\n\t\t(this.data as APIButtonComponentWithURL).url = url;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this button\n\t * @param customId The custom id to use for this button\n\t */\n\tpublic setCustomId(customId: string) {\n\t\t(this.data as APIButtonComponentWithCustomId).custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this button is disable or not\n\t * @param disabled Whether or not to disable this button or not\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the label for this button\n\t * @param label The label to display on this button\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIButtonComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APIButtonComponent;\n\t}\n\n\tpublic equals(other: APIButtonComponent | UnsafeButtonComponent) {\n\t\tif (other instanceof UnsafeButtonComponent) {\n\t\t\treturn isEqual(other.data, this.data);\n\t\t}\n\t\treturn isEqual(other, this.data);\n\t}\n}\n","import type { ButtonStyle, APIMessageComponentEmoji, APIButtonComponent } from 'discord-api-types/v9';\nimport {\n\tbuttonLabelValidator,\n\tbuttonStyleValidator,\n\tcustomIdValidator,\n\tdisabledValidator,\n\temojiValidator,\n\turlValidator,\n\tvalidateRequiredButtonParameters,\n} from '../Assertions';\nimport { UnsafeButtonComponent } from './UnsafeButton';\n\n/**\n * Represents a validated button component\n */\nexport class ButtonComponent extends UnsafeButtonComponent {\n\tpublic override setStyle(style: ButtonStyle) {\n\t\treturn super.setStyle(buttonStyleValidator.parse(style));\n\t}\n\n\tpublic override setURL(url: string) {\n\t\treturn super.setURL(urlValidator.parse(url));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override setLabel(label: string) {\n\t\treturn super.setLabel(buttonLabelValidator.parse(label));\n\t}\n\n\tpublic override toJSON(): APIButtonComponent {\n\t\tvalidateRequiredButtonParameters(this.style, this.label, this.emoji, this.customId, this.url);\n\t\treturn super.toJSON();\n\t}\n}\n","import { APISelectMenuOption, ComponentType, type APISelectMenuComponent } from 'discord-api-types/v9';\nimport { Component } from '../Component';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\nimport isEqual from 'fast-deep-equal';\n\n/**\n * Represents a non-validated select menu component\n */\nexport class UnsafeSelectMenuComponent extends Component<\n\tPartial<Omit<APISelectMenuComponent, 'options'>> & { type: ComponentType.SelectMenu }\n> {\n\t/**\n\t * The options within this select menu\n\t */\n\tpublic readonly options: UnsafeSelectMenuOption[];\n\n\tpublic constructor(data?: Partial<APISelectMenuComponent>) {\n\t\tconst { options, ...initData } = data ?? {};\n\t\tsuper({ type: ComponentType.SelectMenu, ...initData });\n\t\tthis.options = options?.map((o) => new UnsafeSelectMenuOption(o)) ?? [];\n\t}\n\n\t/**\n\t * The placeholder for this select menu\n\t */\n\tpublic get placeholder() {\n\t\treturn this.data.placeholder;\n\t}\n\n\t/**\n\t * The maximum amount of options that can be selected\n\t */\n\tpublic get maxValues() {\n\t\treturn this.data.max_values;\n\t}\n\n\t/**\n\t * The minimum amount of options that must be selected\n\t */\n\tpublic get minValues() {\n\t\treturn this.data.min_values;\n\t}\n\n\t/**\n\t * The custom id of this select menu\n\t */\n\tpublic get customId() {\n\t\treturn this.data.custom_id;\n\t}\n\n\t/**\n\t * Whether this select menu is disabled\n\t */\n\tpublic get disabled() {\n\t\treturn this.data.disabled;\n\t}\n\n\t/**\n\t * Sets the placeholder for this select menu\n\t * @param placeholder The placeholder to use for this select menu\n\t */\n\tpublic setPlaceholder(placeholder: string) {\n\t\tthis.data.placeholder = placeholder;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the minimum values that must be selected in the select menu\n\t * @param minValues The minimum values that must be selected\n\t */\n\tpublic setMinValues(minValues: number) {\n\t\tthis.data.min_values = minValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the maximum values that must be selected in the select menu\n\t * @param minValues The maximum values that must be selected\n\t */\n\tpublic setMaxValues(maxValues: number) {\n\t\tthis.data.max_values = maxValues;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the custom Id for this select menu\n\t * @param customId The custom id to use for this select menu\n\t */\n\tpublic setCustomId(customId: string) {\n\t\tthis.data.custom_id = customId;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether or not this select menu is disabled\n\t * @param disabled Whether or not this select menu is disabled\n\t */\n\tpublic setDisabled(disabled = true) {\n\t\tthis.data.disabled = disabled;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds options to this select menu\n\t * @param options The options to add to this select menu\n\t * @returns\n\t */\n\tpublic addOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.push(\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the options on this select menu\n\t * @param options The options to set on this select menu\n\t */\n\tpublic setOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]) {\n\t\tthis.options.splice(\n\t\t\t0,\n\t\t\tthis.options.length,\n\t\t\t...options.map((option) =>\n\t\t\t\toption instanceof UnsafeSelectMenuOption ? option : new UnsafeSelectMenuOption(option),\n\t\t\t),\n\t\t);\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuComponent {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t} as APISelectMenuComponent;\n\t}\n\n\tpublic equals(other: APISelectMenuComponent | UnsafeSelectMenuComponent): boolean {\n\t\tif (other instanceof UnsafeSelectMenuComponent) {\n\t\t\treturn isEqual(other.data, this.data) && isEqual(other.options, this.options);\n\t\t}\n\t\treturn isEqual(other, {\n\t\t\t...this.data,\n\t\t\toptions: this.options.map((o) => o.toJSON()),\n\t\t});\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\n\n/**\n * Represents a non-validated option within a select menu component\n */\nexport class UnsafeSelectMenuOption {\n\tpublic constructor(protected data: Partial<APISelectMenuOption> = {}) {}\n\n\t/**\n\t * The label for this option\n\t */\n\tpublic get label() {\n\t\treturn this.data.label;\n\t}\n\n\t/**\n\t * The value for this option\n\t */\n\tpublic get value() {\n\t\treturn this.data.value;\n\t}\n\n\t/**\n\t * The description for this option\n\t */\n\tpublic get description() {\n\t\treturn this.data.description;\n\t}\n\n\t/**\n\t * The emoji for this option\n\t */\n\tpublic get emoji() {\n\t\treturn this.data.emoji;\n\t}\n\n\t/**\n\t * Whether this option is selected by default\n\t */\n\tpublic get default() {\n\t\treturn this.data.default;\n\t}\n\n\t/**\n\t * Sets the label of this option\n\t * @param label The label to show on this option\n\t */\n\tpublic setLabel(label: string) {\n\t\tthis.data.label = label;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value of this option\n\t * @param value The value of this option\n\t */\n\tpublic setValue(value: string) {\n\t\tthis.data.value = value;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description of this option.\n\t * @param description The description of this option\n\t */\n\tpublic setDescription(description: string) {\n\t\tthis.data.description = description;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether this option is selected by default\n\t * @param isDefault Whether this option is selected by default\n\t */\n\tpublic setDefault(isDefault = true) {\n\t\tthis.data.default = isDefault;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the emoji to display on this button\n\t * @param emoji The emoji to display on this button\n\t */\n\tpublic setEmoji(emoji: APIMessageComponentEmoji) {\n\t\tthis.data.emoji = emoji;\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APISelectMenuOption {\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\treturn {\n\t\t\t...this.data,\n\t\t} as APISelectMenuOption;\n\t}\n}\n","import type { APISelectMenuComponent } from 'discord-api-types/v9';\nimport {\n\tcustomIdValidator,\n\tdisabledValidator,\n\tminMaxValidator,\n\tplaceholderValidator,\n\tvalidateRequiredSelectMenuParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuComponent } from './UnsafeSelectMenu';\n\n/**\n * Represents a validated select menu component\n */\nexport class SelectMenuComponent extends UnsafeSelectMenuComponent {\n\tpublic override setPlaceholder(placeholder: string) {\n\t\treturn super.setPlaceholder(placeholderValidator.parse(placeholder));\n\t}\n\n\tpublic override setMinValues(minValues: number) {\n\t\treturn super.setMinValues(minMaxValidator.parse(minValues));\n\t}\n\n\tpublic override setMaxValues(maxValues: number) {\n\t\treturn super.setMaxValues(minMaxValidator.parse(maxValues));\n\t}\n\n\tpublic override setCustomId(customId: string) {\n\t\treturn super.setCustomId(customIdValidator.parse(customId));\n\t}\n\n\tpublic override setDisabled(disabled = true) {\n\t\treturn super.setDisabled(disabledValidator.parse(disabled));\n\t}\n\n\tpublic override toJSON(): APISelectMenuComponent {\n\t\tvalidateRequiredSelectMenuParameters(this.options, this.customId);\n\t\treturn super.toJSON();\n\t}\n}\n","import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v9';\nimport {\n\tdefaultValidator,\n\temojiValidator,\n\tlabelValueValidator,\n\tvalidateRequiredSelectMenuOptionParameters,\n} from '../Assertions';\nimport { UnsafeSelectMenuOption } from './UnsafeSelectMenuOption';\n\n/**\n * Represents a validated option within a select menu component\n */\nexport class SelectMenuOption extends UnsafeSelectMenuOption {\n\tpublic override setDescription(description: string) {\n\t\treturn super.setDescription(labelValueValidator.parse(description));\n\t}\n\n\tpublic override setDefault(isDefault = true) {\n\t\treturn super.setDefault(defaultValidator.parse(isDefault));\n\t}\n\n\tpublic override setEmoji(emoji: APIMessageComponentEmoji) {\n\t\treturn super.setEmoji(emojiValidator.parse(emoji));\n\t}\n\n\tpublic override toJSON(): APISelectMenuOption {\n\t\tvalidateRequiredSelectMenuOptionParameters(this.label, this.value);\n\t\treturn super.toJSON();\n\t}\n}\n","import is from '@sindresorhus/is';\nimport type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\nimport type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^[\\P{Lu}\\p{N}_-]+$/u);\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nconst descriptionPredicate = z.string().min(1).max(100);\n\nexport function validateDescription(description: unknown): asserts description is string {\n\tdescriptionPredicate.parse(description);\n}\n\nconst maxArrayLengthPredicate = z.unknown().array().max(25);\n\nexport function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] {\n\tmaxArrayLengthPredicate.parse(options);\n}\n\nexport function validateRequiredParameters(\n\tname: string,\n\tdescription: string,\n\toptions: ToAPIApplicationCommandOptions[],\n) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert description conditions\n\tvalidateDescription(description);\n\n\t// Assert options conditions\n\tvalidateMaxOptionsLength(options);\n}\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateRequired(required: unknown): asserts required is boolean {\n\tbooleanPredicate.parse(required);\n}\n\nexport function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) {\n\tmaxArrayLengthPredicate.parse(choices);\n}\n\nexport function assertReturnOfBuilder<\n\tT extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder,\n>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T {\n\tconst instanceName = ExpectedInstanceOf.name;\n\n\tif (is.nullOrUndefined(input)) {\n\t\tthrow new TypeError(\n\t\t\t`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`,\n\t\t);\n\t}\n\n\tif (is.primitive(input)) {\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);\n\t}\n\n\tif (!(input instanceof ExpectedInstanceOf)) {\n\t\tconst casted = input as Record<PropertyKey, unknown>;\n\n\t\tconst constructorName = is.function_(input) ? input.name : casted.constructor.name;\n\t\tconst stringTag = Reflect.get(casted, Symbol.toStringTag) as string | undefined;\n\n\t\tconst fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;\n\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);\n\t}\n}\n","import type { APIApplicationCommandOption, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport {\n\tassertReturnOfBuilder,\n\tvalidateDefaultPermission,\n\tvalidateMaxOptionsLength,\n\tvalidateRequiredParameters,\n} from './Assertions';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\n@mix(SharedSlashCommandOptions, SharedNameAndDescription)\nexport class SlashCommandBuilder {\n\t/**\n\t * The name of this slash command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this slash command\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this slash command\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand group to this command\n\t *\n\t * @param input A function that returns a subcommand group builder, or an already built builder\n\t */\n\tpublic addSubcommandGroup(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandGroupBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandGroupBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand to this command\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n\nexport interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n\nexport interface SlashCommandSubcommandsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tPick<SlashCommandBuilder, 'toJSON' | 'addSubcommand' | 'addSubcommandGroup'> {}\n\nexport interface SlashCommandOptionsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tSharedSlashCommandOptions,\n\t\tPick<SlashCommandBuilder, 'toJSON'> {}\n\nexport interface ToAPIApplicationCommandOptions {\n\ttoJSON: () => APIApplicationCommandOption;\n}\n","import { APIApplicationCommandBooleanOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandBooleanOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic toJSON(): APIApplicationCommandBooleanOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string): this {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t *\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n","import type { APIApplicationCommandBasicOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { validateRequiredParameters, validateRequired } from '../Assertions';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {\n\tpublic abstract readonly type: ApplicationCommandOptionType;\n\n\tpublic readonly required: boolean = false;\n\n\t/**\n\t * Marks the option as required\n\t *\n\t * @param required If this option should be required\n\t */\n\tpublic setRequired(required: boolean) {\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(required);\n\n\t\tReflect.set(this, 'required', required);\n\n\t\treturn this;\n\t}\n\n\tpublic abstract toJSON(): APIApplicationCommandBasicOption;\n\n\tprotected runRequiredValidations() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tvalidateRequired(this.required);\n\t}\n}\n","import { APIApplicationCommandChannelOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionChannelTypesMixin } from '../mixins/ApplicationCommandOptionChannelTypesMixin';\n\n@mix(ApplicationCommandOptionChannelTypesMixin)\nexport class SlashCommandChannelOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic toJSON(): APIApplicationCommandChannelOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandChannelOption extends ApplicationCommandOptionChannelTypesMixin {}\n","import { ChannelType } from 'discord-api-types/v9';\nimport { z, ZodLiteral } from 'zod';\n\n// Only allow valid channel types to be used. (This can't be dynamic because const enums are erased at runtime)\nconst allowedChannelTypes = [\n\tChannelType.GuildText,\n\tChannelType.GuildVoice,\n\tChannelType.GuildCategory,\n\tChannelType.GuildNews,\n\tChannelType.GuildStore,\n\tChannelType.GuildNewsThread,\n\tChannelType.GuildPublicThread,\n\tChannelType.GuildPrivateThread,\n\tChannelType.GuildStageVoice,\n] as const;\n\nexport type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];\n\nconst channelTypePredicate = z.union(\n\tallowedChannelTypes.map((type) => z.literal(type)) as [\n\t\tZodLiteral<ChannelType>,\n\t\tZodLiteral<ChannelType>,\n\t\t...ZodLiteral<ChannelType>[]\n\t],\n);\n\nexport class ApplicationCommandOptionChannelTypesMixin {\n\tpublic readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];\n\n\t/**\n\t * Adds a channel type to this option\n\t *\n\t * @param channelType The type of channel to allow\n\t */\n\tpublic addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes) {\n\t\tif (this.channel_types === undefined) {\n\t\t\tReflect.set(this, 'channel_types', []);\n\t\t}\n\n\t\tchannelTypePredicate.parse(channelType);\n\t\tthis.channel_types!.push(channelType);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds channel types to this option\n\t *\n\t * @param channelTypes The channel types to add\n\t */\n\tpublic addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]) {\n\t\tchannelTypes.forEach((channelType) => this.addChannelType(channelType));\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandIntegerOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number().int();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandIntegerOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandIntegerOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandIntegerOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","export abstract class ApplicationCommandNumericOptionMinMaxValueMixin {\n\tpublic readonly max_value?: number;\n\tpublic readonly min_value?: number;\n\n\t/**\n\t * Sets the maximum number value of this option\n\t * @param max The maximum value this option can be\n\t */\n\tpublic abstract setMaxValue(max: number): this;\n\n\t/**\n\t * Sets the minimum number value of this option\n\t * @param min The minimum value this option can be\n\t */\n\tpublic abstract setMinValue(min: number): this;\n}\n","import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { z } from 'zod';\nimport { validateMaxChoicesLength } from '../Assertions';\n\nconst stringPredicate = z.string().min(1).max(100);\nconst numberPredicate = z.number().gt(-Infinity).lt(Infinity);\nconst choicesPredicate = z\n\t.object({ name: stringPredicate, value: z.union([stringPredicate, numberPredicate]) })\n\t.array();\nconst booleanPredicate = z.boolean();\n\nexport class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends string | number> {\n\tpublic readonly choices?: APIApplicationCommandOptionChoice<T>[];\n\tpublic readonly autocomplete?: boolean;\n\n\t// Since this is present and this is a mixin, this is needed\n\tpublic readonly type!: ApplicationCommandOptionType;\n\n\t/**\n\t * Adds a choice for this option\n\t *\n\t * @param choice The choice to add\n\t */\n\tpublic addChoice(choice: APIApplicationCommandOptionChoice<T>): this {\n\t\tconst { name, value } = choice;\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tif (this.choices === undefined) {\n\t\t\tReflect.set(this, 'choices', []);\n\t\t}\n\n\t\tvalidateMaxChoicesLength(this.choices!);\n\n\t\t// Validate name\n\t\tstringPredicate.parse(name);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) {\n\t\t\tstringPredicate.parse(value);\n\t\t} else {\n\t\t\tnumberPredicate.parse(value);\n\t\t}\n\n\t\tthis.choices!.push({ name, value });\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds multiple choices for this option\n\t *\n\t * @param choices The choices to add\n\t */\n\tpublic addChoices(...choices: APIApplicationCommandOptionChoice<T>[]): this {\n\t\tif (this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tfor (const entry of choices) this.addChoice(entry);\n\t\treturn this;\n\t}\n\n\tpublic setChoices<Input extends APIApplicationCommandOptionChoice<T>[]>(...choices: Input): this {\n\t\tif (choices.length > 0 && this.autocomplete) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tchoicesPredicate.parse(choices);\n\n\t\tReflect.set(this, 'choices', []);\n\t\tfor (const entry of choices) this.addChoice(entry);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Marks the option as autocompletable\n\t * @param autocomplete If this option should be autocompletable\n\t */\n\tpublic setAutocomplete(autocomplete: boolean): this {\n\t\t// Assert that you actually passed a boolean\n\t\tbooleanPredicate.parse(autocomplete);\n\n\t\tif (autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\tReflect.set(this, 'autocomplete', autocomplete);\n\n\t\treturn this;\n\t}\n}\n","import { APIApplicationCommandMentionableOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandMentionableOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic toJSON(): APIApplicationCommandMentionableOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandNumberOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { z } from 'zod';\nimport { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\nconst numberValidator = z.number();\n\n@mix(ApplicationCommandNumericOptionMinMaxValueMixin, ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandNumberOption\n\textends ApplicationCommandOptionBase\n\timplements ApplicationCommandNumericOptionMinMaxValueMixin\n{\n\tpublic readonly type = ApplicationCommandOptionType.Number as const;\n\n\tpublic setMaxValue(max: number): this {\n\t\tnumberValidator.parse(max);\n\n\t\tReflect.set(this, 'max_value', max);\n\n\t\treturn this;\n\t}\n\n\tpublic setMinValue(min: number): this {\n\t\tnumberValidator.parse(min);\n\n\t\tReflect.set(this, 'min_value', min);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandNumberOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandNumberOption\n\textends ApplicationCommandNumericOptionMinMaxValueMixin,\n\t\tApplicationCommandOptionWithChoicesAndAutocompleteMixin<number> {}\n","import { APIApplicationCommandRoleOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandRoleOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic toJSON(): APIApplicationCommandRoleOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandAttachmentOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandAttachmentOption extends ApplicationCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Attachment as const;\n\n\tpublic toJSON(): APIApplicationCommandAttachmentOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { APIApplicationCommandStringOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\nimport { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';\n\n@mix(ApplicationCommandOptionWithChoicesAndAutocompleteMixin)\nexport class SlashCommandStringOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic toJSON(): APIApplicationCommandStringOption {\n\t\tthis.runRequiredValidations();\n\n\t\tif (this.autocomplete && Array.isArray(this.choices) && this.choices.length > 0) {\n\t\t\tthrow new RangeError('Autocomplete and choices are mutually exclusive to each other.');\n\t\t}\n\n\t\treturn { ...this };\n\t}\n}\n\nexport interface SlashCommandStringOption extends ApplicationCommandOptionWithChoicesAndAutocompleteMixin<string> {}\n","import { APIApplicationCommandUserOption, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';\n\nexport class SlashCommandUserOption extends ApplicationCommandOptionBase {\n\tpublic readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic toJSON(): APIApplicationCommandUserOption {\n\t\tthis.runRequiredValidations();\n\n\t\treturn { ...this };\n\t}\n}\n","import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { ApplicationCommandOptionBase } from './ApplicationCommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandNumberOption } from '../options/number';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandAttachmentOption } from '../options/attachment';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds an attachment option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addAttachmentOption(\n\t\tinput: SlashCommandAttachmentOption | ((builder: SlashCommandAttachmentOption) => SlashCommandAttachmentOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandAttachmentOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput:\n\t\t\t| SlashCommandStringOption\n\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandStringOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandStringOption\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput:\n\t\t\t| SlashCommandIntegerOption\n\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandIntegerOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandIntegerOption\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\t/**\n\t * Adds a number option\n\t *\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addNumberOption(\n\t\tinput:\n\t\t\t| SlashCommandNumberOption\n\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>\n\t\t\t| ((\n\t\t\t\t\tbuilder: SlashCommandNumberOption,\n\t\t\t ) =>\n\t\t\t\t\t| SlashCommandNumberOption\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'setAutocomplete'>\n\t\t\t\t\t| Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandNumberOption);\n\t}\n\n\tprivate _sharedAddOptionMethod<T extends ApplicationCommandOptionBase>(\n\t\tinput:\n\t\t\t| T\n\t\t\t| Omit<T, 'setAutocomplete'>\n\t\t\t| Omit<T, 'addChoice' | 'addChoices'>\n\t\t\t| ((builder: T) => T | Omit<T, 'setAutocomplete'> | Omit<T, 'addChoice' | 'addChoices'>),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit<this, 'addSubcommand' | 'addSubcommandGroup'> : this {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new Instance()) : input;\n\n\t\tassertReturnOfBuilder(result, Instance);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n","import {\n\tAPIApplicationCommandSubcommandGroupOption,\n\tAPIApplicationCommandSubcommandOption,\n\tApplicationCommandOptionType,\n} from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\n\n/**\n * Represents a folder for subcommands\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription)\nexport class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand group\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand group\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The subcommands part of this subcommand group\n\t */\n\tpublic readonly options: SlashCommandSubcommandBuilder[] = [];\n\n\t/**\n\t * Adds a new subcommand to this group\n\t *\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t) {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON(): APIApplicationCommandSubcommandGroupOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.SubcommandGroup,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {}\n\n/**\n * Represents a subcommand\n *\n * For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription, SharedSlashCommandOptions)\nexport class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this subcommand\n\t */\n\tpublic readonly options: ApplicationCommandOptionBase[] = [];\n\n\tpublic toJSON(): APIApplicationCommandSubcommandOption {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.Subcommand,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions<false> {}\n","import { z } from 'zod';\nimport { ApplicationCommandType } from 'discord-api-types/v9';\nimport type { ContextMenuCommandType } from './ContextMenuCommandBuilder';\n\nconst namePredicate = z\n\t.string()\n\t.min(1)\n\t.max(32)\n\t.regex(/^( *[\\p{L}\\p{N}_-]+ *)+$/u);\n\nconst typePredicate = z.union([z.literal(ApplicationCommandType.User), z.literal(ApplicationCommandType.Message)]);\n\nconst booleanPredicate = z.boolean();\n\nexport function validateDefaultPermission(value: unknown): asserts value is boolean {\n\tbooleanPredicate.parse(value);\n}\n\nexport function validateName(name: unknown): asserts name is string {\n\tnamePredicate.parse(name);\n}\n\nexport function validateType(type: unknown): asserts type is ContextMenuCommandType {\n\ttypePredicate.parse(type);\n}\n\nexport function validateRequiredParameters(name: string, type: number) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert type is valid\n\tvalidateType(type);\n}\n","import { validateRequiredParameters, validateName, validateType, validateDefaultPermission } from './Assertions';\nimport type { ApplicationCommandType, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v9';\n\nexport class ContextMenuCommandBuilder {\n\t/**\n\t * The name of this context menu command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The type of this context menu command\n\t */\n\tpublic readonly type: ContextMenuCommandType = undefined!;\n\n\t/**\n\t * Whether the command is enabled by default when the app is added to a guild\n\t *\n\t * @default true\n\t */\n\tpublic readonly defaultPermission: boolean | undefined = undefined;\n\n\t/**\n\t * Sets the name\n\t *\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the type\n\t *\n\t * @param type The type\n\t */\n\tpublic setType(type: ContextMenuCommandType) {\n\t\t// Assert the type is valid\n\t\tvalidateType(type);\n\n\t\tReflect.set(this, 'type', type);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets whether the command is enabled by default when the application is added to a guild.\n\t *\n\t * **Note**: If set to `false`, you will have to later `PUT` the permissions for this command.\n\t *\n\t * @param value Whether or not to enable this command by default\n\t *\n\t * @see https://discord.com/developers/docs/interactions/application-commands#permissions\n\t */\n\tpublic setDefaultPermission(value: boolean) {\n\t\t// Assert the value matches the conditions\n\t\tvalidateDefaultPermission(value);\n\n\t\tReflect.set(this, 'defaultPermission', value);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON(): RESTPostAPIApplicationCommandsJSONBody {\n\t\tvalidateRequiredParameters(this.name, this.type);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\ttype: this.type,\n\t\t\tdefault_permission: this.defaultPermission,\n\t\t};\n\t}\n}\n\nexport type ContextMenuCommandType = ApplicationCommandType.User | ApplicationCommandType.Message;\n","export interface JSONEncodable<T> {\n\t/**\n\t * Transforms this object to its JSON format\n\t */\n\ttoJSON: () => T;\n}\n\n/**\n * Indicates if an object is encodable or not.\n * @param maybeEncodable The object to check against\n */\nexport function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n\treturn maybeEncodable !== null && typeof maybeEncodable === 'object' && 'toJSON' in maybeEncodable;\n}\n"],"mappings":"ycAAA,iZACA,wBAEO,GAAM,GAAqB,EAAE,SAAS,IAAI,GAAG,IAAI,KAE3C,GAAsB,EAAE,SAAS,IAAI,GAAG,IAAI,MAE5C,GAAuB,EAAE,UAAU,WAEnC,GAAsB,EAAE,OAAO,CAC3C,KAAM,EACN,MAAO,GACP,OAAQ,KAGI,EAA4B,GAAoB,QAEhD,GAAuB,EAAE,SAAS,IAAI,IAE5C,WAA6B,EAAsB,EAAgC,CACzF,GAAqB,MAAO,IAAQ,QAAU,GAAK,GADpC,2BAIT,GAAM,IAAsB,EAAmB,WAEzC,EAAe,EAAE,SAAS,MAAM,UAEhC,EAAe,EAAE,SAAS,MAAM,IAAI,GAAG,IAAI,KAC3C,GAAiB,EAC5B,SACA,MACA,IAAI,GACJ,IAAI,UACJ,WACA,GAAG,EAAE,MAAM,CAAC,EAAc,EAAc,KAE7B,GAAuB,EAAE,SAAS,IAAI,GAAG,IAAI,MAAM,WAEnD,GAAsB,EAAE,SAAS,IAAI,GAAG,IAAI,MAAM,WAElD,GAAqB,EAAE,MAAM,CAAC,EAAE,SAAU,EAAE,SAAS,WAErD,GAAi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AAa,EAAM,GAAI,IAAmC,EAE1F,SAAsB,EAAQ,GAG9B,EAAQ,KAAK,GAEN,OA1GF,kCADN,GAAI,EAA2B,IACzB,IiBbP,6HAAA,wBACA,+DAGA,GAAM,IAAgB,EACpB,SACA,IAAI,GACJ,IAAI,IACJ,MAAM,6BAEF,GAAgB,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAuB,MAAO,EAAE,QAAQ,GAAuB,WAElG,GAAmB,EAAE,UAEpB,YAAmC,EAA0C,CACnF,GAAiB,MAAM,GADR,kCAIT,YAAsB,EAAuC,CACnE,GAAc,MAAM,GADL,qBAIT,YAAsB,EAAuD,CACnF,GAAc,MAAM,GADL,qBAIT,YAAoC,EAAc,EAAc,CAEtE,GAAa,GAGb,GAAa,GALE,mCCvBT,YAAgC,CAAhC,aAHP,CAOiB,eAKA,eAOA,4BAOT,QAAQ,EAAc,CAE5B,UAAa,GAEb,QAAQ,IAAI,KAAM,OAAQ,GAEnB,KAQD,QAAQ,EAA8B,CAE5C,UAAa,GAEb,QAAQ,IAAI,KAAM,OAAQ,GAEnB,KAYD,qBAAqB,EAAgB,CAE3C,UAA0B,GAE1B,QAAQ,IAAI,KAAM,oBAAqB,GAEhC,KAQD,QAAiD,CACvD,UAA2B,KAAK,KAAM,KAAK,MACpC,CACN,KAAM,KAAK,KACX,KAAM,KAAK,KACX,mBAAoB,KAAK,qBA1ErB,kCCQA,YAAyB,EAAmE,CAClG,MAAO,KAAmB,MAAQ,MAAO,IAAmB,UAAY,UAAY,GADrE","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@discordjs/builders",
3
- "version": "0.13.0-dev.1645877056.a8321d8",
3
+ "version": "0.13.0-dev.1646222605.53defb8",
4
4
  "description": "A set of builders that you can use when creating your bot",
5
5
  "scripts": {
6
6
  "build": "tsup",