@discordjs/builders 0.13.0-dev.1646870850.e787cd5 → 0.13.0-dev.1646913825.dcd4797

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  var z=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Re=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var o=(e,t)=>z(e,"name",{value:t,configurable:!0});var w=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})};var d=(e,t,n,r)=>{for(var p=r>1?void 0:r?Se(t,n):t,y=e.length-1,R;y>=0;y--)(R=e[y])&&(p=(r?R(t,n,p):R(p))||p);return r&&p&&z(t,n,p),p};var i=(e,t,n)=>(Re(e,typeof t!="symbol"?t+"":t,n),n);var Yt={};w(Yt,{RGBPredicate:()=>Q,authorNamePredicate:()=>ft,colorPredicate:()=>At,descriptionPredicate:()=>xt,embedFieldPredicate:()=>Ht,embedFieldsArrayPredicate:()=>Z,fieldInlinePredicate:()=>Qt,fieldLengthPredicate:()=>Xt,fieldNamePredicate:()=>W,fieldValuePredicate:()=>Kt,footerTextPredicate:()=>gt,timestampPredicate:()=>yt,titlePredicate:()=>Ot,urlPredicate:()=>O,validateFieldLength:()=>K});import{z as l}from"zod";var W=l.string().min(1).max(256),Kt=l.string().min(1).max(1024),Qt=l.boolean().optional(),Ht=l.object({name:W,value:Kt,inline:Qt}),Z=Ht.array(),Xt=l.number().lte(25);function K(e,t){Xt.parse((t?.length??0)+e)}o(K,"validateFieldLength");var ft=W.nullable(),O=l.string().url().nullish(),Q=l.number().int().gte(0).lte(255),At=l.number().int().gte(0).lte(16777215).nullable().or(l.tuple([Q,Q,Q])),xt=l.string().min(1).max(4096).nullable(),gt=l.string().min(1).max(2048).nullable(),yt=l.union([l.number(),l.date()]).nullable(),Ot=W.nullable();import Me from"fast-deep-equal";var v=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,y=t instanceof v?t.data:t,{image:R,thumbnail:Pe,...Ie}=y;return Me(Ie,p)&&R?.url===n?.url&&Pe?.url===r?.url}};o(v,"UnsafeEmbed");var te=class extends v{addFields(...t){return K(t.length,this.fields),super.addFields(...Z.parse(t))}spliceFields(t,n,...r){return K(r.length-n,this.fields),super.spliceFields(t,n,...Z.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(ft.parse(t.name),O.parse(t.iconURL),O.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(At.parse(t))}setDescription(t){return super.setDescription(xt.parse(t))}setFooter(t){return t===null?super.setFooter(null):(gt.parse(t.text),O.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(O.parse(t))}setThumbnail(t){return super.setThumbnail(O.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(yt.parse(t))}setTitle(t){return super.setTitle(Ot.parse(t))}setURL(t){return super.setURL(O.parse(t))}};o(te,"Embed");function Ao(e,t){return typeof t=="undefined"?`\`\`\`
2
2
  ${e}\`\`\``:`\`\`\`${e}
3
- ${t}\`\`\``}o(Ao,"codeBlock");function xo(e){return`\`${e}\``}o(xo,"inlineCode");function go(e){return`_${e}_`}o(go,"italic");function yo(e){return`**${e}**`}o(yo,"bold");function Oo(e){return`__${e}__`}o(Oo,"underscore");function Po(e){return`~~${e}~~`}o(Po,"strikethrough");function Io(e){return`> ${e}`}o(Io,"quote");function So(e){return`>>> ${e}`}o(So,"blockQuote");function Ro(e){return`<${e}>`}o(Ro,"hideLinkEmbed");function Mo(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(Mo,"hyperlink");function To(e){return`||${e}||`}o(To,"spoiler");function wo(e){return`<@${e}>`}o(wo,"userMention");function vo(e){return`<@!${e}>`}o(vo,"memberNicknameMention");function Eo(e){return`<#${e}>`}o(Eo,"channelMention");function No(e){return`<@&${e}>`}o(No,"roleMention");function Bo(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Bo,"formatEmoji");function Vo(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(Vo,"time");var Lo={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Te=(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))(Te||{});var oe={};w(oe,{buttonLabelValidator:()=>It,buttonStyleValidator:()=>St,customIdValidator:()=>c,defaultValidator:()=>Tt,disabledValidator:()=>U,emojiValidator:()=>J,labelValueValidator:()=>k,minMaxValidator:()=>H,optionsValidator:()=>ee,placeholderValidator:()=>Rt,urlValidator:()=>vt,validateRequiredButtonParameters:()=>Et,validateRequiredSelectMenuOptionParameters:()=>wt,validateRequiredSelectMenuParameters:()=>Mt});import{ButtonStyle as Pt}from"discord-api-types/v9";import{z as u}from"zod";var c=u.string().min(1).max(100),J=u.object({id:u.string(),name:u.string(),animated:u.boolean()}).partial().strict(),U=u.boolean(),It=u.string().nonempty().max(80),St=u.number().int().min(Pt.Primary).max(Pt.Link),Rt=u.string().max(100),H=u.number().int().min(0).max(25),ee=u.object({}).array().nonempty();function Mt(e,t){c.parse(t),ee.parse(e)}o(Mt,"validateRequiredSelectMenuParameters");var k=u.string().min(1).max(100),Tt=u.boolean();function wt(e,t){k.parse(e),k.parse(t)}o(wt,"validateRequiredSelectMenuOptionParameters");var vt=u.string().url();function Et(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===Pt.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(Et,"validateRequiredButtonParameters");import{ComponentType as we}from"discord-api-types/v9";var h=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(h,"Component");import{ComponentType as X}from"discord-api-types/v9";function Y(e){if(e instanceof h)return e;switch(e.type){case X.ActionRow:return new b(e);case X.Button:return new tt(e);case X.SelectMenu:return new ot(e);case X.TextInput:return new et(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Y,"createComponent");import Nt from"fast-deep-equal";var b=class extends h{constructor({components:t,...n}={}){super({type:we.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Y(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 b?Nt(t.data,this.data)&&Nt(t.components,this.components):Nt(t,{...this.data,components:this.components.map(n=>n.toJSON())})}};o(b,"ActionRow");import{ComponentType as ve}from"discord-api-types/v9";import ne from"fast-deep-equal";var E=class extends h{constructor(t){super({type:ve.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 E?ne(t.data,this.data):ne(t,this.data)}};o(E,"UnsafeButtonComponent");var tt=class extends E{setStyle(t){return super.setStyle(St.parse(t))}setURL(t){return super.setURL(vt.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}setDisabled(t=!0){return super.setDisabled(U.parse(t))}setLabel(t){return super.setLabel(It.parse(t))}toJSON(){return Et(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(tt,"ButtonComponent");var ae={};w(ae,{labelValidator:()=>re,maxLengthValidator:()=>Vt,minLengthValidator:()=>Bt,placeholderValidator:()=>_t,requiredValidator:()=>Lt,textInputStyleValidator:()=>ie,validateRequiredParameters:()=>Dt,valueValidator:()=>$t});import{TextInputStyle as Ee}from"discord-api-types/v9";import{z as M}from"zod";var ie=M.nativeEnum(Ee),Bt=M.number().int().min(0).max(4e3),Vt=M.number().int().min(1).max(4e3),Lt=M.boolean(),$t=M.string().max(4e3),_t=M.string().max(100),re=M.string().min(1).max(45);function Dt(e,t,n){c.parse(e),ie.parse(t),re.parse(n)}o(Dt,"validateRequiredParameters");import{ComponentType as Ne}from"discord-api-types/v9";import se from"fast-deep-equal";var N=class extends h{constructor(t){super({type:Ne.TextInput,...t})}get style(){return this.data.style}get customId(){return this.data.custom_id}get label(){return this.data.label}get placeholder(){return this.data.placeholder}get value(){return this.data.value}get minLength(){return this.data.min_length}get maxLength(){return this.data.max_length}get required(){return this.data.required}setCustomId(t){return this.data.custom_id=t,this}setLabel(t){return this.data.label=t,this}setStyle(t){return this.data.style=t,this}setMinLength(t){return this.data.min_length=t,this}setMaxLength(t){return this.data.max_length=t,this}setPlaceholder(t){return this.data.placeholder=t,this}setValue(t){return this.data.value=t,this}setRequired(t=!0){return this.data.required=t,this}toJSON(){return{...this.data}}equals(t){return t instanceof N?se(t.data,this.data):se(t,this.data)}};o(N,"UnsafeTextInputComponent");var et=class extends N{setMinLength(t){return super.setMinLength(Bt.parse(t))}setMaxLength(t){return super.setMaxLength(Vt.parse(t))}setRequired(t=!0){return super.setRequired(Lt.parse(t))}setValue(t){return super.setValue($t.parse(t))}setPlaceholder(t){return super.setPlaceholder(_t.parse(t))}toJSON(){return Dt(this.data.custom_id,this.data.style,this.data.label),super.toJSON()}};o(et,"TextInputComponent");var nt=class{constructor({components:t,...n}={}){i(this,"data");i(this,"components",[]);this.data={...n},this.components=t?.map(r=>Y(r))??[]}get customId(){return this.data.custom_id}get title(){return this.data.title}setTitle(t){return this.data.title=t,this}setCustomId(t){return this.data.custom_id=t,this}addComponents(...t){return this.components.push(...t.map(n=>n instanceof b?n:new b(n))),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(nt,"UnsafeModal");var me={};w(me,{componentsValidator:()=>pe,titleValidator:()=>it,validateRequiredParameters:()=>Jt});import{z as qt}from"zod";var it=qt.string().min(1).max(45),pe=qt.array(qt.instanceof(b)).min(1);function Jt(e,t,n){c.parse(e),it.parse(t),pe.parse(n)}o(Jt,"validateRequiredParameters");var le=class extends nt{setCustomId(t){return super.setCustomId(c.parse(t))}setTitle(t){return super.setTitle(it.parse(t))}toJSON(){return Jt(this.data.custom_id,this.data.title,this.components),super.toJSON()}};o(le,"Modal");import{ComponentType as Be}from"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");import Ut from"fast-deep-equal";var B=class extends h{constructor(t){let{options:n,...r}=t??{};super({type:Be.SelectMenu,...r});i(this,"options");this.options=n?.map(p=>new C(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 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 B?Ut(t.data,this.data)&&Ut(t.options,this.options):Ut(t,{...this.data,options:this.options.map(n=>n.toJSON())})}};o(B,"UnsafeSelectMenuComponent");var ot=class extends B{setPlaceholder(t){return super.setPlaceholder(Rt.parse(t))}setMinValues(t){return super.setMinValues(H.parse(t))}setMaxValues(t){return super.setMaxValues(H.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setDisabled(t=!0){return super.setDisabled(U.parse(t))}toJSON(){return Mt(this.options,this.customId),super.toJSON()}};o(ot,"SelectMenuComponent");var ue=class extends C{setDescription(t){return super.setDescription(k.parse(t))}setDefault(t=!0){return super.setDefault(Tt.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}toJSON(){return wt(this.label,this.value),super.toJSON()}};o(ue,"SelectMenuOption");var ce={};w(ce,{assertReturnOfBuilder:()=>I,validateChoicesLength:()=>Ft,validateDefaultPermission:()=>jt,validateDescription:()=>at,validateMaxOptionsLength:()=>f,validateName:()=>rt,validateRequired:()=>st,validateRequiredParameters:()=>P});import kt from"@sindresorhus/is";import{z as j}from"zod";var Ve=j.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function rt(e){Ve.parse(e)}o(rt,"validateName");var Le=j.string().min(1).max(100);function at(e){Le.parse(e)}o(at,"validateDescription");var $e=j.unknown().array().max(25);function f(e){$e.parse(e)}o(f,"validateMaxOptionsLength");function P(e,t,n){rt(e),at(t),f(n)}o(P,"validateRequiredParameters");var de=j.boolean();function jt(e){de.parse(e)}o(jt,"validateDefaultPermission");function st(e){de.parse(e)}o(st,"validateRequired");var _e=j.number().lte(25);function Ft(e,t){_e.parse((t?.length??0)+e)}o(Ft,"validateChoicesLength");function I(e,t){let n=t.name;if(kt.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(kt.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,p=kt.function_(e)?e.name:r.constructor.name,y=Reflect.get(r,Symbol.toStringTag),R=y?`${p} [${y}]`:p;throw new TypeError(`Expected to receive a ${n} builder, got ${R} instead.`)}}o(I,"assertReturnOfBuilder");import{mix as no}from"ts-mixer";import{ApplicationCommandOptionType as De}from"discord-api-types/v9";var A=class{constructor(){i(this,"name");i(this,"description")}setName(t){return rt(t),Reflect.set(this,"name",t),this}setDescription(t){return at(t),Reflect.set(this,"description",t),this}};o(A,"SharedNameAndDescription");var m=class extends A{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return st(t),Reflect.set(this,"required",t),this}runRequiredValidations(){P(this.name,this.description,[]),st(this.required)}};o(m,"ApplicationCommandOptionBase");var pt=class extends m{constructor(){super(...arguments);i(this,"type",De.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(pt,"SlashCommandBooleanOption");import{ApplicationCommandOptionType as Ue}from"discord-api-types/v9";import{mix as ke}from"ts-mixer";import{ChannelType as x}from"discord-api-types/v9";import{z as Gt}from"zod";var qe=[x.GuildText,x.GuildVoice,x.GuildCategory,x.GuildNews,x.GuildStore,x.GuildNewsThread,x.GuildPublicThread,x.GuildPrivateThread,x.GuildStageVoice],Je=Gt.array(Gt.union(qe.map(e=>Gt.literal(e)))),mt=class{constructor(){i(this,"channel_types")}addChannelTypes(...t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Je.parse(t),this.channel_types.push(...t),this}};o(mt,"ApplicationCommandOptionChannelTypesMixin");var V=class extends m{constructor(){super(...arguments);i(this,"type",Ue.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(V,"SlashCommandChannelOption"),V=d([ke(mt)],V);import{ApplicationCommandOptionType as Ge}from"discord-api-types/v9";import{mix as ze}from"ts-mixer";import{z as We}from"zod";var L=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(L,"ApplicationCommandNumericOptionMinMaxValueMixin");import{ApplicationCommandOptionType as je}from"discord-api-types/v9";import{z as F}from"zod";var zt=F.string().min(1).max(100),he=F.number().gt(-1/0).lt(1/0),be=F.object({name:zt,value:F.union([zt,he])}).array(),Fe=F.boolean(),S=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");be.parse(t),this.choices===void 0&&Reflect.set(this,"choices",[]),Ft(t.length,this.choices);for(let{name:n,value:r}of t)this.type===je.String?zt.parse(r):he.parse(r),this.choices.push({name:n,value:r});return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return be.parse(t),Reflect.set(this,"choices",[]),this.addChoices(...t),this}setAutocomplete(t){if(Fe.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 Ce=We.number().int(),$=class extends m{constructor(){super(...arguments);i(this,"type",Ge.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($,"SlashCommandIntegerOption"),$=d([ze(L,S)],$);import{ApplicationCommandOptionType as Ze}from"discord-api-types/v9";var lt=class extends m{constructor(){super(...arguments);i(this,"type",Ze.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(lt,"SlashCommandMentionableOption");import{ApplicationCommandOptionType as Ke}from"discord-api-types/v9";import{mix as Qe}from"ts-mixer";import{z as He}from"zod";var fe=He.number(),_=class extends m{constructor(){super(...arguments);i(this,"type",Ke.Number)}setMaxValue(t){return fe.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return fe.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"),_=d([Qe(L,S)],_);import{ApplicationCommandOptionType as Xe}from"discord-api-types/v9";var ut=class extends m{constructor(){super(...arguments);i(this,"type",Xe.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ut,"SlashCommandRoleOption");import{ApplicationCommandOptionType as Ye}from"discord-api-types/v9";var dt=class extends m{constructor(){super(...arguments);i(this,"type",Ye.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(dt,"SlashCommandAttachmentOption");import{ApplicationCommandOptionType as to}from"discord-api-types/v9";import{mix as eo}from"ts-mixer";var D=class extends m{constructor(){super(...arguments);i(this,"type",to.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=d([eo(S)],D);import{ApplicationCommandOptionType as oo}from"discord-api-types/v9";var ct=class extends m{constructor(){super(...arguments);i(this,"type",oo.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ct,"SlashCommandUserOption");var q=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,pt)}addUserOption(t){return this._sharedAddOptionMethod(t,ct)}addChannelOption(t){return this._sharedAddOptionMethod(t,V)}addRoleOption(t){return this._sharedAddOptionMethod(t,ut)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,dt)}addMentionableOption(t){return this._sharedAddOptionMethod(t,lt)}addStringOption(t){return this._sharedAddOptionMethod(t,D)}addIntegerOption(t){return this._sharedAddOptionMethod(t,$)}addNumberOption(t){return this._sharedAddOptionMethod(t,_)}_sharedAddOptionMethod(t,n){let{options:r}=this;f(r);let p=typeof t=="function"?t(new n):t;return I(p,n),r.push(p),this}};o(q,"SharedSlashCommandOptions");import{ApplicationCommandOptionType as Ae}from"discord-api-types/v9";import{mix as xe}from"ts-mixer";var T=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 g):t;return I(r,g),n.push(r),this}toJSON(){return P(this.name,this.description,this.options),{type:Ae.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(T,"SlashCommandSubcommandGroupBuilder"),T=d([xe(A)],T);var g=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return P(this.name,this.description,this.options),{type:Ae.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(g,"SlashCommandSubcommandBuilder"),g=d([xe(A,q)],g);var ht=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return P(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 jt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new T):t;return I(r,T),n.push(r),this}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new g):t;return I(r,g),n.push(r),this}};o(ht,"SlashCommandBuilder"),ht=d([no(q,A)],ht);var ye={};w(ye,{validateDefaultPermission:()=>Wt,validateName:()=>bt,validateRequiredParameters:()=>Zt,validateType:()=>Ct});import{z as G}from"zod";import{ApplicationCommandType as ge}from"discord-api-types/v9";var io=G.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),ro=G.union([G.literal(ge.User),G.literal(ge.Message)]),ao=G.boolean();function Wt(e){ao.parse(e)}o(Wt,"validateDefaultPermission");function bt(e){io.parse(e)}o(bt,"validateName");function Ct(e){ro.parse(e)}o(Ct,"validateType");function Zt(e,t){bt(e),Ct(t)}o(Zt,"validateRequiredParameters");var Oe=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return bt(t),Reflect.set(this,"name",t),this}setType(t){return Ct(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Wt(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Zt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(Oe,"ContextMenuCommandBuilder");function vr(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(vr,"isJSONEncodable");export{b as ActionRow,tt as ButtonComponent,h as Component,oe as ComponentAssertions,ye as ContextMenuCommandAssertions,Oe as ContextMenuCommandBuilder,te as Embed,Yt as EmbedAssertions,Te as Faces,le as Modal,me as ModalAssertions,ot as SelectMenuComponent,ue as SelectMenuOption,ce as SlashCommandAssertions,dt as SlashCommandAttachmentOption,pt as SlashCommandBooleanOption,ht as SlashCommandBuilder,V as SlashCommandChannelOption,$ as SlashCommandIntegerOption,lt as SlashCommandMentionableOption,_ as SlashCommandNumberOption,ut as SlashCommandRoleOption,D as SlashCommandStringOption,g as SlashCommandSubcommandBuilder,T as SlashCommandSubcommandGroupBuilder,ct as SlashCommandUserOption,ae as TextInputAssertions,et as TextInputComponent,Lo as TimestampStyles,E as UnsafeButtonComponent,v as UnsafeEmbed,nt as UnsafeModal,B as UnsafeSelectMenuComponent,C as UnsafeSelectMenuOption,N as UnsafeTextInputComponent,So as blockQuote,yo as bold,Eo as channelMention,Ao as codeBlock,Y as createComponent,Bo as formatEmoji,Ro as hideLinkEmbed,Mo as hyperlink,xo as inlineCode,vr as isJSONEncodable,go as italic,vo as memberNicknameMention,Io as quote,No as roleMention,To as spoiler,Po as strikethrough,Vo as time,Oo as underscore,wo as userMention};
3
+ ${t}\`\`\``}o(Ao,"codeBlock");function xo(e){return`\`${e}\``}o(xo,"inlineCode");function go(e){return`_${e}_`}o(go,"italic");function yo(e){return`**${e}**`}o(yo,"bold");function Oo(e){return`__${e}__`}o(Oo,"underscore");function Po(e){return`~~${e}~~`}o(Po,"strikethrough");function Io(e){return`> ${e}`}o(Io,"quote");function So(e){return`>>> ${e}`}o(So,"blockQuote");function Ro(e){return`<${e}>`}o(Ro,"hideLinkEmbed");function Mo(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(Mo,"hyperlink");function To(e){return`||${e}||`}o(To,"spoiler");function wo(e){return`<@${e}>`}o(wo,"userMention");function vo(e){return`<@!${e}>`}o(vo,"memberNicknameMention");function Eo(e){return`<#${e}>`}o(Eo,"channelMention");function No(e){return`<@&${e}>`}o(No,"roleMention");function Bo(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Bo,"formatEmoji");function Vo(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(Vo,"time");var Lo={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Te=(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))(Te||{});var oe={};w(oe,{buttonLabelValidator:()=>It,buttonStyleValidator:()=>St,customIdValidator:()=>c,defaultValidator:()=>Tt,disabledValidator:()=>U,emojiValidator:()=>J,labelValueValidator:()=>k,minMaxValidator:()=>H,optionsValidator:()=>ee,placeholderValidator:()=>Rt,urlValidator:()=>vt,validateRequiredButtonParameters:()=>Et,validateRequiredSelectMenuOptionParameters:()=>wt,validateRequiredSelectMenuParameters:()=>Mt});import{ButtonStyle as Pt}from"discord-api-types/v9";import{z as u}from"zod";var c=u.string().min(1).max(100),J=u.object({id:u.string(),name:u.string(),animated:u.boolean()}).partial().strict(),U=u.boolean(),It=u.string().nonempty().max(80),St=u.number().int().min(Pt.Primary).max(Pt.Link),Rt=u.string().max(150),H=u.number().int().min(0).max(25),ee=u.object({}).array().nonempty();function Mt(e,t){c.parse(t),ee.parse(e)}o(Mt,"validateRequiredSelectMenuParameters");var k=u.string().min(1).max(100),Tt=u.boolean();function wt(e,t){k.parse(e),k.parse(t)}o(wt,"validateRequiredSelectMenuOptionParameters");var vt=u.string().url();function Et(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===Pt.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(Et,"validateRequiredButtonParameters");import{ComponentType as we}from"discord-api-types/v9";var h=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(h,"Component");import{ComponentType as X}from"discord-api-types/v9";function Y(e){if(e instanceof h)return e;switch(e.type){case X.ActionRow:return new b(e);case X.Button:return new tt(e);case X.SelectMenu:return new ot(e);case X.TextInput:return new et(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Y,"createComponent");import Nt from"fast-deep-equal";var b=class extends h{constructor({components:t,...n}={}){super({type:we.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Y(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 b?Nt(t.data,this.data)&&Nt(t.components,this.components):Nt(t,{...this.data,components:this.components.map(n=>n.toJSON())})}};o(b,"ActionRow");import{ComponentType as ve}from"discord-api-types/v9";import ne from"fast-deep-equal";var E=class extends h{constructor(t){super({type:ve.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 E?ne(t.data,this.data):ne(t,this.data)}};o(E,"UnsafeButtonComponent");var tt=class extends E{setStyle(t){return super.setStyle(St.parse(t))}setURL(t){return super.setURL(vt.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}setDisabled(t=!0){return super.setDisabled(U.parse(t))}setLabel(t){return super.setLabel(It.parse(t))}toJSON(){return Et(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(tt,"ButtonComponent");var ae={};w(ae,{labelValidator:()=>re,maxLengthValidator:()=>Vt,minLengthValidator:()=>Bt,placeholderValidator:()=>_t,requiredValidator:()=>Lt,textInputStyleValidator:()=>ie,validateRequiredParameters:()=>Dt,valueValidator:()=>$t});import{TextInputStyle as Ee}from"discord-api-types/v9";import{z as M}from"zod";var ie=M.nativeEnum(Ee),Bt=M.number().int().min(0).max(4e3),Vt=M.number().int().min(1).max(4e3),Lt=M.boolean(),$t=M.string().max(4e3),_t=M.string().max(100),re=M.string().min(1).max(45);function Dt(e,t,n){c.parse(e),ie.parse(t),re.parse(n)}o(Dt,"validateRequiredParameters");import{ComponentType as Ne}from"discord-api-types/v9";import se from"fast-deep-equal";var N=class extends h{constructor(t){super({type:Ne.TextInput,...t})}get style(){return this.data.style}get customId(){return this.data.custom_id}get label(){return this.data.label}get placeholder(){return this.data.placeholder}get value(){return this.data.value}get minLength(){return this.data.min_length}get maxLength(){return this.data.max_length}get required(){return this.data.required}setCustomId(t){return this.data.custom_id=t,this}setLabel(t){return this.data.label=t,this}setStyle(t){return this.data.style=t,this}setMinLength(t){return this.data.min_length=t,this}setMaxLength(t){return this.data.max_length=t,this}setPlaceholder(t){return this.data.placeholder=t,this}setValue(t){return this.data.value=t,this}setRequired(t=!0){return this.data.required=t,this}toJSON(){return{...this.data}}equals(t){return t instanceof N?se(t.data,this.data):se(t,this.data)}};o(N,"UnsafeTextInputComponent");var et=class extends N{setMinLength(t){return super.setMinLength(Bt.parse(t))}setMaxLength(t){return super.setMaxLength(Vt.parse(t))}setRequired(t=!0){return super.setRequired(Lt.parse(t))}setValue(t){return super.setValue($t.parse(t))}setPlaceholder(t){return super.setPlaceholder(_t.parse(t))}toJSON(){return Dt(this.data.custom_id,this.data.style,this.data.label),super.toJSON()}};o(et,"TextInputComponent");var nt=class{constructor({components:t,...n}={}){i(this,"data");i(this,"components",[]);this.data={...n},this.components=t?.map(r=>Y(r))??[]}get customId(){return this.data.custom_id}get title(){return this.data.title}setTitle(t){return this.data.title=t,this}setCustomId(t){return this.data.custom_id=t,this}addComponents(...t){return this.components.push(...t.map(n=>n instanceof b?n:new b(n))),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(nt,"UnsafeModal");var me={};w(me,{componentsValidator:()=>pe,titleValidator:()=>it,validateRequiredParameters:()=>Jt});import{z as qt}from"zod";var it=qt.string().min(1).max(45),pe=qt.array(qt.instanceof(b)).min(1);function Jt(e,t,n){c.parse(e),it.parse(t),pe.parse(n)}o(Jt,"validateRequiredParameters");var le=class extends nt{setCustomId(t){return super.setCustomId(c.parse(t))}setTitle(t){return super.setTitle(it.parse(t))}toJSON(){return Jt(this.data.custom_id,this.data.title,this.components),super.toJSON()}};o(le,"Modal");import{ComponentType as Be}from"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");import Ut from"fast-deep-equal";var B=class extends h{constructor(t){let{options:n,...r}=t??{};super({type:Be.SelectMenu,...r});i(this,"options");this.options=n?.map(p=>new C(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 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 B?Ut(t.data,this.data)&&Ut(t.options,this.options):Ut(t,{...this.data,options:this.options.map(n=>n.toJSON())})}};o(B,"UnsafeSelectMenuComponent");var ot=class extends B{setPlaceholder(t){return super.setPlaceholder(Rt.parse(t))}setMinValues(t){return super.setMinValues(H.parse(t))}setMaxValues(t){return super.setMaxValues(H.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setDisabled(t=!0){return super.setDisabled(U.parse(t))}toJSON(){return Mt(this.options,this.customId),super.toJSON()}};o(ot,"SelectMenuComponent");var ue=class extends C{setDescription(t){return super.setDescription(k.parse(t))}setDefault(t=!0){return super.setDefault(Tt.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}toJSON(){return wt(this.label,this.value),super.toJSON()}};o(ue,"SelectMenuOption");var ce={};w(ce,{assertReturnOfBuilder:()=>I,validateChoicesLength:()=>Ft,validateDefaultPermission:()=>jt,validateDescription:()=>at,validateMaxOptionsLength:()=>f,validateName:()=>rt,validateRequired:()=>st,validateRequiredParameters:()=>P});import kt from"@sindresorhus/is";import{z as j}from"zod";var Ve=j.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function rt(e){Ve.parse(e)}o(rt,"validateName");var Le=j.string().min(1).max(100);function at(e){Le.parse(e)}o(at,"validateDescription");var $e=j.unknown().array().max(25);function f(e){$e.parse(e)}o(f,"validateMaxOptionsLength");function P(e,t,n){rt(e),at(t),f(n)}o(P,"validateRequiredParameters");var de=j.boolean();function jt(e){de.parse(e)}o(jt,"validateDefaultPermission");function st(e){de.parse(e)}o(st,"validateRequired");var _e=j.number().lte(25);function Ft(e,t){_e.parse((t?.length??0)+e)}o(Ft,"validateChoicesLength");function I(e,t){let n=t.name;if(kt.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(kt.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,p=kt.function_(e)?e.name:r.constructor.name,y=Reflect.get(r,Symbol.toStringTag),R=y?`${p} [${y}]`:p;throw new TypeError(`Expected to receive a ${n} builder, got ${R} instead.`)}}o(I,"assertReturnOfBuilder");import{mix as no}from"ts-mixer";import{ApplicationCommandOptionType as De}from"discord-api-types/v9";var A=class{constructor(){i(this,"name");i(this,"description")}setName(t){return rt(t),Reflect.set(this,"name",t),this}setDescription(t){return at(t),Reflect.set(this,"description",t),this}};o(A,"SharedNameAndDescription");var m=class extends A{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return st(t),Reflect.set(this,"required",t),this}runRequiredValidations(){P(this.name,this.description,[]),st(this.required)}};o(m,"ApplicationCommandOptionBase");var pt=class extends m{constructor(){super(...arguments);i(this,"type",De.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(pt,"SlashCommandBooleanOption");import{ApplicationCommandOptionType as Ue}from"discord-api-types/v9";import{mix as ke}from"ts-mixer";import{ChannelType as x}from"discord-api-types/v9";import{z as Gt}from"zod";var qe=[x.GuildText,x.GuildVoice,x.GuildCategory,x.GuildNews,x.GuildStore,x.GuildNewsThread,x.GuildPublicThread,x.GuildPrivateThread,x.GuildStageVoice],Je=Gt.array(Gt.union(qe.map(e=>Gt.literal(e)))),mt=class{constructor(){i(this,"channel_types")}addChannelTypes(...t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Je.parse(t),this.channel_types.push(...t),this}};o(mt,"ApplicationCommandOptionChannelTypesMixin");var V=class extends m{constructor(){super(...arguments);i(this,"type",Ue.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(V,"SlashCommandChannelOption"),V=d([ke(mt)],V);import{ApplicationCommandOptionType as Ge}from"discord-api-types/v9";import{mix as ze}from"ts-mixer";import{z as We}from"zod";var L=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(L,"ApplicationCommandNumericOptionMinMaxValueMixin");import{ApplicationCommandOptionType as je}from"discord-api-types/v9";import{z as F}from"zod";var zt=F.string().min(1).max(100),he=F.number().gt(-1/0).lt(1/0),be=F.object({name:zt,value:F.union([zt,he])}).array(),Fe=F.boolean(),S=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");be.parse(t),this.choices===void 0&&Reflect.set(this,"choices",[]),Ft(t.length,this.choices);for(let{name:n,value:r}of t)this.type===je.String?zt.parse(r):he.parse(r),this.choices.push({name:n,value:r});return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return be.parse(t),Reflect.set(this,"choices",[]),this.addChoices(...t),this}setAutocomplete(t){if(Fe.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 Ce=We.number().int(),$=class extends m{constructor(){super(...arguments);i(this,"type",Ge.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($,"SlashCommandIntegerOption"),$=d([ze(L,S)],$);import{ApplicationCommandOptionType as Ze}from"discord-api-types/v9";var lt=class extends m{constructor(){super(...arguments);i(this,"type",Ze.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(lt,"SlashCommandMentionableOption");import{ApplicationCommandOptionType as Ke}from"discord-api-types/v9";import{mix as Qe}from"ts-mixer";import{z as He}from"zod";var fe=He.number(),_=class extends m{constructor(){super(...arguments);i(this,"type",Ke.Number)}setMaxValue(t){return fe.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return fe.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"),_=d([Qe(L,S)],_);import{ApplicationCommandOptionType as Xe}from"discord-api-types/v9";var ut=class extends m{constructor(){super(...arguments);i(this,"type",Xe.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ut,"SlashCommandRoleOption");import{ApplicationCommandOptionType as Ye}from"discord-api-types/v9";var dt=class extends m{constructor(){super(...arguments);i(this,"type",Ye.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(dt,"SlashCommandAttachmentOption");import{ApplicationCommandOptionType as to}from"discord-api-types/v9";import{mix as eo}from"ts-mixer";var D=class extends m{constructor(){super(...arguments);i(this,"type",to.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=d([eo(S)],D);import{ApplicationCommandOptionType as oo}from"discord-api-types/v9";var ct=class extends m{constructor(){super(...arguments);i(this,"type",oo.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ct,"SlashCommandUserOption");var q=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,pt)}addUserOption(t){return this._sharedAddOptionMethod(t,ct)}addChannelOption(t){return this._sharedAddOptionMethod(t,V)}addRoleOption(t){return this._sharedAddOptionMethod(t,ut)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,dt)}addMentionableOption(t){return this._sharedAddOptionMethod(t,lt)}addStringOption(t){return this._sharedAddOptionMethod(t,D)}addIntegerOption(t){return this._sharedAddOptionMethod(t,$)}addNumberOption(t){return this._sharedAddOptionMethod(t,_)}_sharedAddOptionMethod(t,n){let{options:r}=this;f(r);let p=typeof t=="function"?t(new n):t;return I(p,n),r.push(p),this}};o(q,"SharedSlashCommandOptions");import{ApplicationCommandOptionType as Ae}from"discord-api-types/v9";import{mix as xe}from"ts-mixer";var T=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 g):t;return I(r,g),n.push(r),this}toJSON(){return P(this.name,this.description,this.options),{type:Ae.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(T,"SlashCommandSubcommandGroupBuilder"),T=d([xe(A)],T);var g=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return P(this.name,this.description,this.options),{type:Ae.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(g,"SlashCommandSubcommandBuilder"),g=d([xe(A,q)],g);var ht=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return P(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 jt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new T):t;return I(r,T),n.push(r),this}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new g):t;return I(r,g),n.push(r),this}};o(ht,"SlashCommandBuilder"),ht=d([no(q,A)],ht);var ye={};w(ye,{validateDefaultPermission:()=>Wt,validateName:()=>bt,validateRequiredParameters:()=>Zt,validateType:()=>Ct});import{z as G}from"zod";import{ApplicationCommandType as ge}from"discord-api-types/v9";var io=G.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),ro=G.union([G.literal(ge.User),G.literal(ge.Message)]),ao=G.boolean();function Wt(e){ao.parse(e)}o(Wt,"validateDefaultPermission");function bt(e){io.parse(e)}o(bt,"validateName");function Ct(e){ro.parse(e)}o(Ct,"validateType");function Zt(e,t){bt(e),Ct(t)}o(Zt,"validateRequiredParameters");var Oe=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return bt(t),Reflect.set(this,"name",t),this}setType(t){return Ct(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Wt(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Zt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(Oe,"ContextMenuCommandBuilder");function vr(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(vr,"isJSONEncodable");export{b as ActionRow,tt as ButtonComponent,h as Component,oe as ComponentAssertions,ye as ContextMenuCommandAssertions,Oe as ContextMenuCommandBuilder,te as Embed,Yt as EmbedAssertions,Te as Faces,le as Modal,me as ModalAssertions,ot as SelectMenuComponent,ue as SelectMenuOption,ce as SlashCommandAssertions,dt as SlashCommandAttachmentOption,pt as SlashCommandBooleanOption,ht as SlashCommandBuilder,V as SlashCommandChannelOption,$ as SlashCommandIntegerOption,lt as SlashCommandMentionableOption,_ as SlashCommandNumberOption,ut as SlashCommandRoleOption,D as SlashCommandStringOption,g as SlashCommandSubcommandBuilder,T as SlashCommandSubcommandGroupBuilder,ct as SlashCommandUserOption,ae as TextInputAssertions,et as TextInputComponent,Lo as TimestampStyles,E as UnsafeButtonComponent,v as UnsafeEmbed,nt as UnsafeModal,B as UnsafeSelectMenuComponent,C as UnsafeSelectMenuOption,N as UnsafeTextInputComponent,So as blockQuote,yo as bold,Eo as channelMention,Ao as codeBlock,Y as createComponent,Bo as formatEmoji,Ro as hideLinkEmbed,Mo as hyperlink,xo as inlineCode,vr as isJSONEncodable,go as italic,vo as memberNicknameMention,Io as quote,No as roleMention,To as spoiler,Po as strikethrough,Vo as time,Oo as underscore,wo as userMention};
4
4
  //# sourceMappingURL=index.mjs.map