@discordjs/builders
Advanced tools
Comparing version 0.13.0-dev.1645142857.f7257f0 to 0.13.0-dev.1645402064.78aa36f
@@ -114,3 +114,3 @@ import * as discord_api_types_v9 from 'discord-api-types/v9'; | ||
declare class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> { | ||
protected data: APIEmbed; | ||
readonly data: APIEmbed; | ||
constructor(data?: APIEmbed); | ||
@@ -257,8 +257,2 @@ /** | ||
equals(other: UnsafeEmbed | APIEmbed): boolean; | ||
/** | ||
* Normalizes field input and resolves strings | ||
* | ||
* @param fields Fields to normalize | ||
*/ | ||
static normalizeFields(...fields: APIEmbedField[]): APIEmbedField[]; | ||
} | ||
@@ -281,8 +275,2 @@ | ||
setURL(url: string | null): this; | ||
/** | ||
* Normalizes field input and resolves strings | ||
* | ||
* @param fields Fields to normalize | ||
*/ | ||
static normalizeFields(...fields: APIEmbedField[]): APIEmbedField[]; | ||
} | ||
@@ -556,3 +544,3 @@ | ||
*/ | ||
setDefault(isDefault: boolean): this; | ||
setDefault(isDefault?: boolean): this; | ||
/** | ||
@@ -571,3 +559,3 @@ * Sets the emoji to display on this button | ||
setDescription(description: string): this; | ||
setDefault(isDefault: boolean): this; | ||
setDefault(isDefault?: boolean): this; | ||
setEmoji(emoji: APIMessageComponentEmoji): this; | ||
@@ -658,3 +646,3 @@ toJSON(): APISelectMenuOption; | ||
*/ | ||
protected readonly data: DataType; | ||
readonly data: DataType; | ||
abstract toJSON(): APIMessageComponent; | ||
@@ -677,2 +665,5 @@ abstract equals(other: Component | APIActionRowComponentTypes): boolean; | ||
}, 'components'>> { | ||
/** | ||
* The components within this action row | ||
*/ | ||
readonly components: T[]; | ||
@@ -750,3 +741,3 @@ constructor({ components, ...data }?: Partial<APIActionRowComponent<APIMessageComponent>>); | ||
*/ | ||
setDisabled(disabled: boolean): this; | ||
setDisabled(disabled?: boolean): this; | ||
/** | ||
@@ -769,3 +760,3 @@ * Sets the label for this button | ||
setEmoji(emoji: APIMessageComponentEmoji): this; | ||
setDisabled(disabled: boolean): this; | ||
setDisabled(disabled?: boolean): this; | ||
setLabel(label: string): this; | ||
@@ -795,2 +786,5 @@ toJSON(): APIButtonComponent; | ||
}> { | ||
/** | ||
* The options within this select menu | ||
*/ | ||
readonly options: UnsafeSelectMenuOption[]; | ||
@@ -842,3 +836,3 @@ constructor(data?: Partial<APISelectMenuComponent>); | ||
*/ | ||
setDisabled(disabled: boolean): this; | ||
setDisabled(disabled?: boolean): this; | ||
/** | ||
@@ -867,3 +861,3 @@ * Adds options to this select menu | ||
setCustomId(customId: string): this; | ||
setDisabled(disabled: boolean): this; | ||
setDisabled(disabled?: boolean): this; | ||
toJSON(): APISelectMenuComponent; | ||
@@ -870,0 +864,0 @@ } |
@@ -1,4 +0,4 @@ | ||
var we=Object.create;var M=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var De=(e,t,n)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qt=e=>M(e,"__esModule",{value:!0}),o=(e,t)=>M(e,"name",{value:t,configurable:!0});var q=(e,t)=>{for(var n in t)M(e,n,{get:t[n],enumerable:!0})},Ht=(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")&&M(e,s,{get:()=>t[s],enumerable:!(r=Kt(t,s))||r.enumerable});return e},k=(e,t)=>Ht(Qt(M(e!=null?we(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=Ht(Qt({}),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?Kt(t,n):t,x=e.length-1,T;x>=0;x--)(T=e[x])&&(s=(r?T(t,n,s):T(s))||s);return r&&s&&M(t,n,s),s};var i=(e,t,n)=>(De(e,typeof t!="symbol"?t+"":t,n),n);var lo={};q(lo,{ActionRow:()=>g,ButtonComponent:()=>L,Component:()=>C,ComponentAssertions:()=>$t,ContextMenuCommandAssertions:()=>Wt,ContextMenuCommandBuilder:()=>Zt,Embed:()=>It,EmbedAssertions:()=>Pt,Faces:()=>ee,SelectMenuComponent:()=>V,SelectMenuOption:()=>Vt,SlashCommandAssertions:()=>Jt,SlashCommandAttachmentOption:()=>H,SlashCommandBooleanOption:()=>Z,SlashCommandBuilder:()=>Y,SlashCommandChannelOption:()=>E,SlashCommandIntegerOption:()=>w,SlashCommandMentionableOption:()=>K,SlashCommandNumberOption:()=>B,SlashCommandRoleOption:()=>Q,SlashCommandStringOption:()=>N,SlashCommandSubcommandBuilder:()=>h,SlashCommandSubcommandGroupBuilder:()=>I,SlashCommandUserOption:()=>X,TimestampStyles:()=>to,UnsafeButtonComponent:()=>v,UnsafeEmbed:()=>b,UnsafeSelectMenuComponent:()=>R,UnsafeSelectMenuOption:()=>u,blockQuote:()=>je,bold:()=>Je,channelMention:()=>Qe,codeBlock:()=>Ve,createComponent:()=>Dt,formatEmoji:()=>Xe,hideLinkEmbed:()=>Ge,hyperlink:()=>ze,inlineCode:()=>_e,isJSONEncodable:()=>mo,italic:()=>Ue,memberNicknameMention:()=>Ke,quote:()=>ke,roleMention:()=>He,spoiler:()=>We,strikethrough:()=>qe,time:()=>Ye,underscore:()=>Fe,userMention:()=>Ze});var Pt={};q(Pt,{RGBPredicate:()=>it,authorNamePredicate:()=>At,colorPredicate:()=>xt,descriptionPredicate:()=>yt,embedFieldPredicate:()=>Xt,embedFieldsArrayPredicate:()=>ot,fieldInlinePredicate:()=>et,fieldLengthPredicate:()=>Yt,fieldNamePredicate:()=>$,fieldValuePredicate:()=>tt,footerTextPredicate:()=>gt,timestampPredicate:()=>Ot,titlePredicate:()=>St,urlPredicate:()=>y,validateFieldLength:()=>nt});var m=require("zod"),$=m.z.string().min(1).max(256),tt=m.z.string().min(1).max(1024),et=m.z.boolean().optional(),Xt=m.z.object({name:$,value:tt,inline:et}),ot=Xt.array(),Yt=m.z.number().lte(25);function nt(e,t){Yt.parse((t?.length??0)+e)}o(nt,"validateFieldLength");var At=$.nullable(),y=m.z.string().url().nullish(),it=m.z.number().int().gte(0).lte(255),xt=m.z.number().int().gte(0).lte(16777215).nullable().or(m.z.tuple([it,it,it])),yt=m.z.string().min(1).max(4096).nullable(),gt=m.z.string().min(1).max(2048).nullable(),Ot=m.z.union([m.z.number(),m.z.date()]).nullable(),St=$.nullable();var te=k(require("fast-deep-equal")),b=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 t=b.normalizeFields(...t),this.data.fields?this.data.fields.push(...t):this.data.fields=t,this}spliceFields(t,n,...r){return r=b.normalizeFields(...r),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,x=t instanceof b?t.data:t,{image:T,thumbnail:Re,...Ee}=x;return(0,te.default)(Ee,s)&&T?.url===n?.url&&Re?.url===r?.url}static normalizeFields(...t){return t.flat(1/0).map(n=>({name:n.name,value:n.value,inline:n.inline??void 0}))}};o(b,"UnsafeEmbed");var It=class extends b{addFields(...t){return nt(t.length,this.fields),super.addFields(...ot.parse(t))}spliceFields(t,n,...r){return nt(r.length-n,this.fields),super.spliceFields(t,n,...ot.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(At.parse(t.name),y.parse(t.iconURL),y.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(xt.parse(t))}setDescription(t){return super.setDescription(yt.parse(t))}setFooter(t){return t===null?super.setFooter(null):(gt.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(Ot.parse(t))}setTitle(t){return super.setTitle(St.parse(t))}setURL(t){return super.setURL(y.parse(t))}static normalizeFields(...t){return t.flat(1/0).map(n=>($.parse(n.name),tt.parse(n.value),et.parse(n.inline),{name:n.name,value:n.value,inline:n.inline??void 0}))}};o(It,"Embed");function Ve(e,t){return typeof t=="undefined"?`\`\`\` | ||
var Ee=Object.create;var T=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?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=e=>T(e,"__esModule",{value:!0}),o=(e,t)=>T(e,"name",{value:t,configurable:!0});var q=(e,t)=>{for(var n in t)T(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")&&T(e,s,{get:()=>t[s],enumerable:!(r=zt(t,s))||r.enumerable});return e},k=(e,t)=>Kt(Zt(T(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,I;A>=0;A--)(I=e[A])&&(s=(r?I(t,n,s):I(s))||s);return r&&s&&T(t,n,s),s};var i=(e,t,n)=>(De(e,typeof t!="symbol"?t+"":t,n),n);var lo={};q(lo,{ActionRow:()=>y,ButtonComponent:()=>D,Component:()=>b,ComponentAssertions:()=>Bt,ContextMenuCommandAssertions:()=>Gt,ContextMenuCommandBuilder:()=>Wt,Embed:()=>St,EmbedAssertions:()=>Ot,Faces:()=>ee,SelectMenuComponent:()=>L,SelectMenuOption:()=>Dt,SlashCommandAssertions:()=>Vt,SlashCommandAttachmentOption:()=>Q,SlashCommandBooleanOption:()=>z,SlashCommandBuilder:()=>X,SlashCommandChannelOption:()=>w,SlashCommandIntegerOption:()=>E,SlashCommandMentionableOption:()=>Z,SlashCommandNumberOption:()=>B,SlashCommandRoleOption:()=>K,SlashCommandStringOption:()=>N,SlashCommandSubcommandBuilder:()=>h,SlashCommandSubcommandGroupBuilder:()=>P,SlashCommandUserOption:()=>H,TimestampStyles:()=>to,UnsafeButtonComponent:()=>R,UnsafeEmbed:()=>M,UnsafeSelectMenuComponent:()=>v,UnsafeSelectMenuOption:()=>u,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={};q(Ot,{RGBPredicate:()=>ot,authorNamePredicate:()=>Ct,colorPredicate:()=>ft,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 Ct=Y.nullable(),x=m.z.string().url().nullish(),ot=m.z.number().int().gte(0).lte(255),ft=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=k(require("fast-deep-equal")),M=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 M?t.data:t,{image:I,thumbnail:ve,...we}=A;return(0,te.default)(we,s)&&I?.url===n?.url&&ve?.url===r?.url}};o(M,"UnsafeEmbed");var St=class extends M{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):(Ct.parse(t.name),x.parse(t.iconURL),x.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(ft.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"?`\`\`\` | ||
${e}\`\`\``:`\`\`\`${e} | ||
${t}\`\`\``}o(Ve,"codeBlock");function _e(e){return`\`${e}\``}o(_e,"inlineCode");function Ue(e){return`_${e}_`}o(Ue,"italic");function Je(e){return`**${e}**`}o(Je,"bold");function Fe(e){return`__${e}__`}o(Fe,"underscore");function qe(e){return`~~${e}~~`}o(qe,"strikethrough");function ke(e){return`> ${e}`}o(ke,"quote");function je(e){return`>>> ${e}`}o(je,"blockQuote");function Ge(e){return`<${e}>`}o(Ge,"hideLinkEmbed");function ze(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(ze,"hyperlink");function We(e){return`||${e}||`}o(We,"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 $t={};q($t,{buttonLabelValidator:()=>Tt,buttonStyleValidator:()=>Mt,customIdValidator:()=>D,defaultValidator:()=>Et,disabledValidator:()=>G,emojiValidator:()=>j,labelValueValidator:()=>z,minMaxValidator:()=>at,optionsValidator:()=>oe,placeholderValidator:()=>vt,urlValidator:()=>Bt,validateRequiredButtonParameters:()=>Nt,validateRequiredSelectMenuOptionParameters:()=>wt,validateRequiredSelectMenuParameters:()=>Rt});var rt=require("discord-api-types/v9"),l=require("zod"),D=l.z.string().min(1).max(100),j=l.z.object({id:l.z.string(),name:l.z.string(),animated:l.z.boolean()}).partial().strict(),G=l.z.boolean(),Tt=l.z.string().nonempty().max(80),Mt=l.z.number().int().min(rt.ButtonStyle.Primary).max(rt.ButtonStyle.Link),vt=l.z.string().max(100),at=l.z.number().int().min(0).max(25),oe=l.z.object({}).array().nonempty();function Rt(e,t){D.parse(t),oe.parse(e)}o(Rt,"validateRequiredSelectMenuParameters");var z=l.z.string().min(1).max(100),Et=l.z.boolean();function wt(e,t){z.parse(e),z.parse(t)}o(wt,"validateRequiredSelectMenuOptionParameters");var Bt=l.z.string().url();function Nt(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===rt.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(Nt,"validateRequiredButtonParameters");var ne=require("discord-api-types/v9");var C=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(C,"Component");var st=require("discord-api-types/v9");function Dt(e){switch(e.type){case st.ComponentType.ActionRow:return e instanceof g?e:new g(e);case st.ComponentType.Button:return e instanceof L?e:new L(e);case st.ComponentType.SelectMenu:return e instanceof V?e:new V(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Dt,"createComponent");var pt=k(require("fast-deep-equal")),g=class extends C{constructor({components:t,...n}={}){super({type:ne.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Dt(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 g?(0,pt.default)(t.data,this.data)&&(0,pt.default)(t.components,this.components):(0,pt.default)(t,{...this.data,components:this.components.map(n=>n.toJSON())})}};o(g,"ActionRow");var ie=require("discord-api-types/v9");var Lt=k(require("fast-deep-equal")),v=class extends C{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){return this.data.disabled=t,this}setLabel(t){return this.data.label=t,this}toJSON(){return{...this.data}}equals(t){return t instanceof v?(0,Lt.default)(t.data,this.data):(0,Lt.default)(t,this.data)}};o(v,"UnsafeButtonComponent");var L=class extends v{setStyle(t){return super.setStyle(Mt.parse(t))}setURL(t){return super.setURL(Bt.parse(t))}setCustomId(t){return super.setCustomId(D.parse(t))}setEmoji(t){return super.setEmoji(j.parse(t))}setDisabled(t){return super.setDisabled(G.parse(t))}setLabel(t){return super.setLabel(Tt.parse(t))}toJSON(){return Nt(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(L,"ButtonComponent");var re=require("discord-api-types/v9");var u=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){return this.data.default=t,this}setEmoji(t){return this.data.emoji=t,this}toJSON(){return{...this.data}}};o(u,"UnsafeSelectMenuOption");var mt=k(require("fast-deep-equal")),R=class extends C{constructor(t){let{options:n,...r}=t??{};super({type:re.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new u(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){return this.data.disabled=t,this}addOptions(...t){return this.options.push(...t.map(n=>n instanceof u?n:new u(n))),this}setOptions(...t){return this.options.splice(0,this.options.length,...t.map(n=>n instanceof u?n:new u(n))),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}equals(t){return t instanceof R?(0,mt.default)(t.data,this.data)&&(0,mt.default)(t.options,this.options):(0,mt.default)(t,{...this.data,options:this.options.map(n=>n.toJSON())})}};o(R,"UnsafeSelectMenuComponent");var V=class extends R{setPlaceholder(t){return super.setPlaceholder(vt.parse(t))}setMinValues(t){return super.setMinValues(at.parse(t))}setMaxValues(t){return super.setMaxValues(at.parse(t))}setCustomId(t){return super.setCustomId(D.parse(t))}setDisabled(t){return super.setDisabled(G.parse(t))}toJSON(){return Rt(this.options,this.customId),super.toJSON()}};o(V,"SelectMenuComponent");var Vt=class extends u{setDescription(t){return super.setDescription(z.parse(t))}setDefault(t){return super.setDefault(Et.parse(t))}setEmoji(t){return super.setEmoji(j.parse(t))}toJSON(){return wt(this.label,this.value),super.toJSON()}};o(Vt,"SelectMenuOption");var Jt={};q(Jt,{assertReturnOfBuilder:()=>S,validateDefaultPermission:()=>_t,validateDescription:()=>ut,validateMaxChoicesLength:()=>Ut,validateMaxOptionsLength:()=>f,validateName:()=>dt,validateRequired:()=>ct,validateRequiredParameters:()=>O});var lt=k(require("@sindresorhus/is")),W=require("zod"),eo=W.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function dt(e){eo.parse(e)}o(dt,"validateName");var oo=W.z.string().min(1).max(100);function ut(e){oo.parse(e)}o(ut,"validateDescription");var ae=W.z.unknown().array().max(25);function f(e){ae.parse(e)}o(f,"validateMaxOptionsLength");function O(e,t,n){dt(e),ut(t),f(n)}o(O,"validateRequiredParameters");var se=W.z.boolean();function _t(e){se.parse(e)}o(_t,"validateDefaultPermission");function ct(e){se.parse(e)}o(ct,"validateRequired");function Ut(e){ae.parse(e)}o(Ut,"validateMaxChoicesLength");function S(e,t){let n=t.name;if(lt.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(lt.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=lt.default.function_(e)?e.name:r.constructor.name,x=Reflect.get(r,Symbol.toStringTag),T=x?`${s} [${x}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${T} instead.`)}}o(S,"assertReturnOfBuilder");var ve=require("ts-mixer");var pe=require("discord-api-types/v9");var A=class{constructor(){i(this,"name");i(this,"description")}setName(t){return dt(t),Reflect.set(this,"name",t),this}setDescription(t){return ut(t),Reflect.set(this,"description",t),this}};o(A,"SharedNameAndDescription");var p=class extends A{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return ct(t),Reflect.set(this,"required",t),this}runRequiredValidations(){O(this.name,this.description,[]),ct(this.required)}};o(p,"ApplicationCommandOptionBase");var 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 c=require("discord-api-types/v9"),Ft=require("zod"),no=[c.ChannelType.GuildText,c.ChannelType.GuildVoice,c.ChannelType.GuildCategory,c.ChannelType.GuildNews,c.ChannelType.GuildStore,c.ChannelType.GuildNewsThread,c.ChannelType.GuildPublicThread,c.ChannelType.GuildPrivateThread,c.ChannelType.GuildStageVoice],io=Ft.z.union(no.map(e=>Ft.z.literal(e))),ht=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(ht,"ApplicationCommandOptionChannelTypesMixin");var E=class extends p{constructor(){super(...arguments);i(this,"type",me.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(E,"SlashCommandChannelOption"),E=d([(0,le.mix)(ht)],E);var he=require("discord-api-types/v9"),be=require("ts-mixer"),Ce=require("zod");var _=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(_,"ApplicationCommandNumericOptionMinMaxValueMixin");var de=require("discord-api-types/v9"),U=require("zod");var bt=U.z.string().min(1).max(100),ue=U.z.number().gt(-1/0).lt(1/0),ce=U.z.object({name:bt,value:U.z.union([bt,ue])}).array(),ro=U.z.boolean(),P=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",[]),Ut(this.choices),bt.parse(n),this.type===de.ApplicationCommandOptionType.String?bt.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(P,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var fe=Ce.z.number().int().nonnegative(),w=class extends p{constructor(){super(...arguments);i(this,"type",he.ApplicationCommandOptionType.Integer)}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(w,"SlashCommandIntegerOption"),w=d([(0,be.mix)(_,P)],w);var Ae=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",Ae.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandMentionableOption");var xe=require("discord-api-types/v9"),ye=require("ts-mixer"),ge=require("zod");var Oe=ge.z.number().nonnegative(),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)(_,P)],B);var Se=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",Se.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandRoleOption");var Pe=require("discord-api-types/v9");var H=class extends p{constructor(){super(...arguments);i(this,"type",Pe.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(H,"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)(P)],N);var Me=require("discord-api-types/v9");var X=class extends p{constructor(){super(...arguments);i(this,"type",Me.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(X,"SlashCommandUserOption");var J=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,Z)}addUserOption(t){return this._sharedAddOptionMethod(t,X)}addChannelOption(t){return this._sharedAddOptionMethod(t,E)}addRoleOption(t){return this._sharedAddOptionMethod(t,Q)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,H)}addMentionableOption(t){return this._sharedAddOptionMethod(t,K)}addStringOption(t){return this._sharedAddOptionMethod(t,N)}addIntegerOption(t){return this._sharedAddOptionMethod(t,w)}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 S(s,n),r.push(s),this}};o(J,"SharedSlashCommandOptions");var qt=require("discord-api-types/v9"),kt=require("ts-mixer");var I=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 h):t;return S(r,h),n.push(r),this}toJSON(){return O(this.name,this.description,this.options),{type:qt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(I,"SlashCommandSubcommandGroupBuilder"),I=d([(0,kt.mix)(A)],I);var h=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return O(this.name,this.description,this.options),{type:qt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(h,"SlashCommandSubcommandBuilder"),h=d([(0,kt.mix)(A,J)],h);var Y=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return O(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(t=>t.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(t){return _t(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new I):t;return S(r,I),n.push(r),this}addSubcommand(t){let{options:n}=this;f(n);let r=typeof t=="function"?t(new h):t;return S(r,h),n.push(r),this}};o(Y,"SlashCommandBuilder"),Y=d([(0,ve.mix)(J,A)],Y);var Wt={};q(Wt,{validateDefaultPermission:()=>Gt,validateName:()=>Ct,validateRequiredParameters:()=>zt,validateType:()=>ft});var F=require("zod"),jt=require("discord-api-types/v9"),ao=F.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),so=F.z.union([F.z.literal(jt.ApplicationCommandType.User),F.z.literal(jt.ApplicationCommandType.Message)]),po=F.z.boolean();function Gt(e){po.parse(e)}o(Gt,"validateDefaultPermission");function Ct(e){ao.parse(e)}o(Ct,"validateName");function ft(e){so.parse(e)}o(ft,"validateType");function zt(e,t){Ct(e),ft(t)}o(zt,"validateRequiredParameters");var Zt=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return Ct(t),Reflect.set(this,"name",t),this}setType(t){return ft(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Gt(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(Zt,"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}); | ||
${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={};q(Bt,{buttonLabelValidator:()=>Pt,buttonStyleValidator:()=>It,customIdValidator:()=>$,defaultValidator:()=>Rt,disabledValidator:()=>F,emojiValidator:()=>j,labelValueValidator:()=>G,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),j=l.z.object({id:l.z.string(),name:l.z.string(),animated:l.z.boolean()}).partial().strict(),F=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 G=l.z.string().min(1).max(100),Rt=l.z.boolean();function vt(e,t){G.parse(e),G.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 b=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(b,"Component");var rt=require("discord-api-types/v9");function Nt(e){switch(e.type){case rt.ComponentType.ActionRow:return e instanceof y?e:new y(e);case rt.ComponentType.Button:return e instanceof D?e:new D(e);case rt.ComponentType.SelectMenu:return e instanceof L?e:new L(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Nt,"createComponent");var at=k(require("fast-deep-equal")),y=class extends b{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 y?(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(y,"ActionRow");var ie=require("discord-api-types/v9");var $t=k(require("fast-deep-equal")),R=class extends b{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 D=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(j.parse(t))}setDisabled(t=!0){return super.setDisabled(F.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(D,"ButtonComponent");var re=require("discord-api-types/v9");var u=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(u,"UnsafeSelectMenuOption");var st=k(require("fast-deep-equal")),v=class extends b{constructor(t){let{options:n,...r}=t??{};super({type:re.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new u(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 u?n:new u(n))),this}setOptions(...t){return this.options.splice(0,this.options.length,...t.map(n=>n instanceof u?n:new u(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 L=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(F.parse(t))}toJSON(){return Mt(this.options,this.customId),super.toJSON()}};o(L,"SelectMenuComponent");var Dt=class extends u{setDescription(t){return super.setDescription(G.parse(t))}setDefault(t=!0){return super.setDefault(Rt.parse(t))}setEmoji(t){return super.setEmoji(j.parse(t))}toJSON(){return vt(this.label,this.value),super.toJSON()}};o(Dt,"SelectMenuOption");var Vt={};q(Vt,{assertReturnOfBuilder:()=>O,validateDefaultPermission:()=>Lt,validateDescription:()=>lt,validateMaxChoicesLength:()=>_t,validateMaxOptionsLength:()=>C,validateName:()=>mt,validateRequired:()=>dt,validateRequiredParameters:()=>g});var pt=k(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 C(e){ae.parse(e)}o(C,"validateMaxOptionsLength");function g(e,t,n){mt(e),lt(t),C(n)}o(g,"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 O(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),I=A?`${s} [${A}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${I} instead.`)}}o(O,"assertReturnOfBuilder");var Re=require("ts-mixer");var pe=require("discord-api-types/v9");var f=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(f,"SharedNameAndDescription");var p=class extends f{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return dt(t),Reflect.set(this,"required",t),this}runRequiredValidations(){g(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 c=require("discord-api-types/v9"),Ut=require("zod"),no=[c.ChannelType.GuildText,c.ChannelType.GuildVoice,c.ChannelType.GuildCategory,c.ChannelType.GuildNews,c.ChannelType.GuildStore,c.ChannelType.GuildNewsThread,c.ChannelType.GuildPublicThread,c.ChannelType.GuildPrivateThread,c.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"),Ce=require("zod");var _=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(_,"ApplicationCommandNumericOptionMinMaxValueMixin");var de=require("discord-api-types/v9"),V=require("zod");var ct=V.z.string().min(1).max(100),ue=V.z.number().gt(-1/0).lt(1/0),ce=V.z.object({name:ct,value:V.z.union([ct,ue])}).array(),ro=V.z.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",[]),_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(S,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var fe=Ce.z.number().int(),E=class extends p{constructor(){super(...arguments);i(this,"type",he.ApplicationCommandOptionType.Integer)}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(E,"SlashCommandIntegerOption"),E=d([(0,be.mix)(_,S)],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)(_,S)],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)(S)],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 U=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;C(r);let s=typeof t=="function"?t(new n):t;return O(s,n),r.push(s),this}};o(U,"SharedSlashCommandOptions");var Jt=require("discord-api-types/v9"),qt=require("ts-mixer");var P=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;C(n);let r=typeof t=="function"?t(new h):t;return O(r,h),n.push(r),this}toJSON(){return g(this.name,this.description,this.options),{type:Jt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(P,"SlashCommandSubcommandGroupBuilder"),P=d([(0,qt.mix)(f)],P);var h=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return g(this.name,this.description,this.options),{type:Jt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(h,"SlashCommandSubcommandBuilder"),h=d([(0,qt.mix)(f,U)],h);var X=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 Lt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;C(n);let r=typeof t=="function"?t(new P):t;return O(r,P),n.push(r),this}addSubcommand(t){let{options:n}=this;C(n);let r=typeof t=="function"?t(new h):t;return O(r,h),n.push(r),this}};o(X,"SlashCommandBuilder"),X=d([(0,Re.mix)(U,f)],X);var Gt={};q(Gt,{validateDefaultPermission:()=>jt,validateName:()=>ht,validateRequiredParameters:()=>Ft,validateType:()=>bt});var J=require("zod"),kt=require("discord-api-types/v9"),ao=J.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),so=J.z.union([J.z.literal(kt.ApplicationCommandType.User),J.z.literal(kt.ApplicationCommandType.Message)]),po=J.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}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@discordjs/builders", | ||
"version": "0.13.0-dev.1645142857.f7257f0", | ||
"version": "0.13.0-dev.1645402064.78aa36f", | ||
"description": "A set of builders that you can use when creating your bot", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
314288
1421