@discordjs/builders 0.13.0-dev.1644797188.0dfdb2c → 0.13.0-dev.1644969969.c1b27f8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -666,7 +666,7 @@ declare class ActionRow<T extends ActionRowComponent = ActionRowComponent> exten
|
|
|
666
666
|
* Sets the components in this action row
|
|
667
667
|
* @param components The components to set this row to
|
|
668
668
|
*/
|
|
669
|
-
setComponents(components: T[]): this;
|
|
669
|
+
setComponents(...components: T[]): this;
|
|
670
670
|
toJSON(): APIActionRowComponent<APIMessageComponent>;
|
|
671
671
|
}
|
|
672
672
|
|
|
@@ -824,7 +824,7 @@ declare class UnsafeSelectMenuComponent extends Component<Partial<Omit<APISelect
|
|
|
824
824
|
* Sets the options on this select menu
|
|
825
825
|
* @param options The options to set on this select menu
|
|
826
826
|
*/
|
|
827
|
-
setOptions(options: UnsafeSelectMenuOption[]): this;
|
|
827
|
+
setOptions(...options: UnsafeSelectMenuOption[]): this;
|
|
828
828
|
toJSON(): APISelectMenuComponent;
|
|
829
829
|
}
|
|
830
830
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var Se=Object.create;var S=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Ie=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var Me=(e,t,n)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gt=e=>S(e,"__esModule",{value:!0}),o=(e,t)=>S(e,"name",{value:t,configurable:!0});var F=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},zt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Pe(t))!Te.call(e,s)&&(n||s!=="default")&&S(e,s,{get:()=>t[s],enumerable:!(r=qt(t,s))||r.enumerable});return e},ve=(e,t)=>zt(Gt(S(e!=null?Se(Ie(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Re=(e=>(t,n)=>e&&e.get(t)||(n=zt(Gt({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0),l=(e,t,n,r)=>{for(var s=r>1?void 0:r?qt(t,n):t,R=e.length-1,U;R>=0;R--)(U=e[R])&&(s=(r?U(t,n,s):U(s))||s);return r&&s&&S(t,n,s),s};var i=(e,t,n)=>(Me(e,typeof t!="symbol"?t+"":t,n),n);var no={};F(no,{ActionRow:()=>B,ButtonComponent:()=>N,Component:()=>h,ComponentAssertions:()=>wt,ContextMenuCommandAssertions:()=>kt,ContextMenuCommandBuilder:()=>jt,Embed:()=>gt,EmbedAssertions:()=>yt,Faces:()=>Kt,SelectMenuComponent:()=>$,SelectMenuOption:()=>Bt,SlashCommandAssertions:()=>_t,SlashCommandAttachmentOption:()=>Q,SlashCommandBooleanOption:()=>W,SlashCommandBuilder:()=>X,SlashCommandChannelOption:()=>I,SlashCommandIntegerOption:()=>T,SlashCommandMentionableOption:()=>Z,SlashCommandNumberOption:()=>M,SlashCommandRoleOption:()=>K,SlashCommandStringOption:()=>v,SlashCommandSubcommandBuilder:()=>c,SlashCommandSubcommandGroupBuilder:()=>O,SlashCommandUserOption:()=>H,TimestampStyles:()=>We,UnsafeButtonComponent:()=>q,UnsafeEmbed:()=>x,UnsafeSelectMenuComponent:()=>G,UnsafeSelectMenuOption:()=>P,blockQuote:()=>Ve,bold:()=>Ne,channelMention:()=>je,codeBlock:()=>we,createComponent:()=>Et,formatEmoji:()=>Ge,hideLinkEmbed:()=>De,hyperlink:()=>Ue,inlineCode:()=>Ee,isJSONEncodable:()=>oo,italic:()=>Be,memberNicknameMention:()=>ke,quote:()=>Le,roleMention:()=>qe,spoiler:()=>Fe,strikethrough:()=>_e,time:()=>ze,underscore:()=>$e,userMention:()=>Je});var yt={};F(yt,{authorNamePredicate:()=>ht,colorPredicate:()=>bt,descriptionPredicate:()=>Ct,embedFieldPredicate:()=>Wt,embedFieldsArrayPredicate:()=>et,fieldInlinePredicate:()=>tt,fieldLengthPredicate:()=>Zt,fieldNamePredicate:()=>w,fieldValuePredicate:()=>Y,footerTextPredicate:()=>ft,timestampPredicate:()=>xt,titlePredicate:()=>At,urlPredicate:()=>f,validateFieldLength:()=>ot});var d=require("zod"),w=d.z.string().min(1).max(256),Y=d.z.string().min(1).max(1024),tt=d.z.boolean().optional(),Wt=d.z.object({name:w,value:Y,inline:tt}),et=Wt.array(),Zt=d.z.number().lte(25);function ot(e,t){Zt.parse((t?.length??0)+e)}o(ot,"validateFieldLength");var ht=w.nullable(),f=d.z.string().url().nullish(),bt=d.z.number().gte(0).lte(16777215).nullable(),Ct=d.z.string().min(1).max(4096).nullable(),ft=d.z.string().min(1).max(2048).nullable(),xt=d.z.union([d.z.number(),d.z.date()]).nullable(),At=w.nullable();var x=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)}addField(t){return this.addFields(t)}addFields(...t){return t=x.normalizeFields(...t),this.data.fields?this.data.fields.push(...t):this.data.fields=t,this}spliceFields(t,n,...r){return r=x.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){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}}static normalizeFields(...t){return t.flat(1/0).map(n=>({name:n.name,value:n.value,inline:n.inline??void 0}))}};o(x,"UnsafeEmbed");var gt=class extends x{addFields(...t){return ot(t.length,this.fields),super.addFields(...et.parse(t))}spliceFields(t,n,...r){return ot(r.length-n,this.fields),super.spliceFields(t,n,...et.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(ht.parse(t.name),f.parse(t.iconURL),f.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(bt.parse(t))}setDescription(t){return super.setDescription(Ct.parse(t))}setFooter(t){return t===null?super.setFooter(null):(ft.parse(t.text),f.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(f.parse(t))}setThumbnail(t){return super.setThumbnail(f.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(xt.parse(t))}setTitle(t){return super.setTitle(At.parse(t))}setURL(t){return super.setURL(f.parse(t))}static normalizeFields(...t){return t.flat(1/0).map(n=>(w.parse(n.name),Y.parse(n.value),tt.parse(n.inline),{name:n.name,value:n.value,inline:n.inline??void 0}))}};o(gt,"Embed");function we(e,t){return typeof t=="undefined"?`\`\`\`
|
|
2
2
|
${e}\`\`\``:`\`\`\`${e}
|
|
3
|
-
${t}\`\`\``}o(we,"codeBlock");function Ee(e){return`\`${e}\``}o(Ee,"inlineCode");function Be(e){return`_${e}_`}o(Be,"italic");function Ne(e){return`**${e}**`}o(Ne,"bold");function $e(e){return`__${e}__`}o($e,"underscore");function _e(e){return`~~${e}~~`}o(_e,"strikethrough");function Le(e){return`> ${e}`}o(Le,"quote");function Ve(e){return`>>> ${e}`}o(Ve,"blockQuote");function De(e){return`<${e}>`}o(De,"hideLinkEmbed");function Ue(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(Ue,"hyperlink");function Fe(e){return`||${e}||`}o(Fe,"spoiler");function Je(e){return`<@${e}>`}o(Je,"userMention");function ke(e){return`<@!${e}>`}o(ke,"memberNicknameMention");function je(e){return`<#${e}>`}o(je,"channelMention");function qe(e){return`<@&${e}>`}o(qe,"roleMention");function Ge(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Ge,"formatEmoji");function ze(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(ze,"time");var We={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Kt=(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))(Kt||{});var wt={};F(wt,{buttonLabelValidator:()=>Ot,buttonStyleValidator:()=>St,customIdValidator:()=>E,defaultValidator:()=>Tt,disabledValidator:()=>k,emojiValidator:()=>J,labelValueValidator:()=>j,minMaxValidator:()=>it,optionsValidator:()=>Qt,placeholderValidator:()=>Pt,urlValidator:()=>vt,validateRequiredButtonParameters:()=>Rt,validateRequiredSelectMenuOptionParameters:()=>Mt,validateRequiredSelectMenuParameters:()=>It});var nt=require("discord-api-types/v9"),m=require("zod"),E=m.z.string().min(1).max(100),J=m.z.object({id:m.z.string(),name:m.z.string(),animated:m.z.boolean()}).partial().strict(),k=m.z.boolean(),Ot=m.z.string().nonempty().max(80),St=m.z.number().int().min(nt.ButtonStyle.Primary).max(nt.ButtonStyle.Link),Pt=m.z.string().max(100),it=m.z.number().int().min(0).max(25),Qt=m.z.object({}).array().nonempty();function It(e,t){E.parse(t),Qt.parse(e)}o(It,"validateRequiredSelectMenuParameters");var j=m.z.string().min(1).max(100),Tt=m.z.boolean();function Mt(e,t){j.parse(e),j.parse(t)}o(Mt,"validateRequiredSelectMenuOptionParameters");var vt=m.z.string().url();function Rt(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(Rt,"validateRequiredButtonParameters");var Ht=require("discord-api-types/v9");var h=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(h,"Component");var rt=require("discord-api-types/v9");function Et(e){switch(e.type){case rt.ComponentType.ActionRow:return e instanceof B?e:new B(e);case rt.ComponentType.Button:return e instanceof N?e:new N(e);case rt.ComponentType.SelectMenu:return e instanceof $?e:new $(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Et,"createComponent");var B=class extends h{constructor({components:t,...n}={}){super({type:Ht.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Et(r))??[]}addComponents(...t){return this.components.push(...t),this}setComponents(t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(B,"ActionRow");var Xt=require("discord-api-types/v9");var q=class extends h{constructor(t){super({type:Xt.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}}};o(q,"UnsafeButtonComponent");var N=class extends q{setStyle(t){return super.setStyle(St.parse(t))}setURL(t){return super.setURL(vt.parse(t))}setCustomId(t){return super.setCustomId(E.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}setDisabled(t){return super.setDisabled(k.parse(t))}setLabel(t){return super.setLabel(Ot.parse(t))}toJSON(){return Rt(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(N,"ButtonComponent");var Yt=require("discord-api-types/v9");var P=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(P,"UnsafeSelectMenuOption");var G=class extends h{constructor(t){let{options:n,...r}=t??{};super({type:Yt.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new P(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),this}setOptions(t){return this.options.splice(0,this.options.length,...t),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}};o(G,"UnsafeSelectMenuComponent");var $=class extends G{setPlaceholder(t){return super.setPlaceholder(Pt.parse(t))}setMinValues(t){return super.setMinValues(it.parse(t))}setMaxValues(t){return super.setMaxValues(it.parse(t))}setCustomId(t){return super.setCustomId(E.parse(t))}setDisabled(t){return super.setDisabled(k.parse(t))}toJSON(){return It(this.options,this.customId),super.toJSON()}};o($,"SelectMenuComponent");var Bt=class extends P{setDescription(t){return super.setDescription(j.parse(t))}setDefault(t){return super.setDefault(Tt.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}toJSON(){return Mt(this.label,this.value),super.toJSON()}};o(Bt,"SelectMenuOption");var _t={};F(_t,{assertReturnOfBuilder:()=>y,validateDefaultPermission:()=>Nt,validateDescription:()=>pt,validateMaxChoicesLength:()=>$t,validateMaxOptionsLength:()=>b,validateName:()=>st,validateRequired:()=>mt,validateRequiredParameters:()=>A});var at=ve(require("@sindresorhus/is")),z=require("zod"),Ze=z.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function st(e){Ze.parse(e)}o(st,"validateName");var Ke=z.z.string().min(1).max(100);function pt(e){Ke.parse(e)}o(pt,"validateDescription");var te=z.z.unknown().array().max(25);function b(e){te.parse(e)}o(b,"validateMaxOptionsLength");function A(e,t,n){st(e),pt(t),b(n)}o(A,"validateRequiredParameters");var ee=z.z.boolean();function Nt(e){ee.parse(e)}o(Nt,"validateDefaultPermission");function mt(e){ee.parse(e)}o(mt,"validateRequired");function $t(e){te.parse(e)}o($t,"validateMaxChoicesLength");function y(e,t){let n=t.name;if(at.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(at.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=at.default.function_(e)?e.name:r.constructor.name,R=Reflect.get(r,Symbol.toStringTag),U=R?`${s} [${R}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${U} instead.`)}}o(y,"assertReturnOfBuilder");var Oe=require("ts-mixer");var oe=require("discord-api-types/v9");var C=class{constructor(){i(this,"name");i(this,"description")}setName(t){return st(t),Reflect.set(this,"name",t),this}setDescription(t){return pt(t),Reflect.set(this,"description",t),this}};o(C,"SharedNameAndDescription");var p=class extends C{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return mt(t),Reflect.set(this,"required",t),this}runRequiredValidations(){A(this.name,this.description,[]),mt(this.required)}};o(p,"ApplicationCommandOptionBase");var W=class extends p{constructor(){super(...arguments);i(this,"type",oe.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(W,"SlashCommandBooleanOption");var ne=require("discord-api-types/v9"),ie=require("ts-mixer");var u=require("discord-api-types/v9"),Lt=require("zod"),Qe=[u.ChannelType.GuildText,u.ChannelType.GuildVoice,u.ChannelType.GuildCategory,u.ChannelType.GuildNews,u.ChannelType.GuildStore,u.ChannelType.GuildNewsThread,u.ChannelType.GuildPublicThread,u.ChannelType.GuildPrivateThread,u.ChannelType.GuildStageVoice],He=Lt.z.union(Qe.map(e=>Lt.z.literal(e))),lt=class{constructor(){i(this,"channel_types")}addChannelType(t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),He.parse(t),this.channel_types.push(t),this}addChannelTypes(t){return t.forEach(n=>this.addChannelType(n)),this}};o(lt,"ApplicationCommandOptionChannelTypesMixin");var I=class extends p{constructor(){super(...arguments);i(this,"type",ne.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(I,"SlashCommandChannelOption"),I=l([(0,ie.mix)(lt)],I);var pe=require("discord-api-types/v9"),me=require("ts-mixer"),le=require("zod");var _=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(_,"ApplicationCommandNumericOptionMinMaxValueMixin");var re=require("discord-api-types/v9"),L=require("zod");var dt=L.z.string().min(1).max(100),ae=L.z.number().gt(-1/0).lt(1/0),se=L.z.object({name:dt,value:L.z.union([dt,ae])}).array(),Xe=L.z.boolean(),g=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),dt.parse(n),this.type===re.ApplicationCommandOptionType.String?dt.parse(r):ae.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.");se.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.");se.parse(t),Reflect.set(this,"choices",[]);for(let n of t)this.addChoice(n);return this}setAutocomplete(t){if(Xe.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(g,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var de=le.z.number().int().nonnegative(),T=class extends p{constructor(){super(...arguments);i(this,"type",pe.ApplicationCommandOptionType.Integer)}setMaxValue(t){return de.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return de.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(T,"SlashCommandIntegerOption"),T=l([(0,me.mix)(_,g)],T);var ue=require("discord-api-types/v9");var Z=class extends p{constructor(){super(...arguments);i(this,"type",ue.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Z,"SlashCommandMentionableOption");var ce=require("discord-api-types/v9"),he=require("ts-mixer"),be=require("zod");var Ce=be.z.number().nonnegative(),M=class extends p{constructor(){super(...arguments);i(this,"type",ce.ApplicationCommandOptionType.Number)}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(M,"SlashCommandNumberOption"),M=l([(0,he.mix)(_,g)],M);var fe=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",fe.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandRoleOption");var xe=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",xe.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandAttachmentOption");var Ae=require("discord-api-types/v9"),ye=require("ts-mixer");var v=class extends p{constructor(){super(...arguments);i(this,"type",Ae.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(v,"SlashCommandStringOption"),v=l([(0,ye.mix)(g)],v);var ge=require("discord-api-types/v9");var H=class extends p{constructor(){super(...arguments);i(this,"type",ge.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(H,"SlashCommandUserOption");var V=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,W)}addUserOption(t){return this._sharedAddOptionMethod(t,H)}addChannelOption(t){return this._sharedAddOptionMethod(t,I)}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,v)}addIntegerOption(t){return this._sharedAddOptionMethod(t,T)}addNumberOption(t){return this._sharedAddOptionMethod(t,M)}_sharedAddOptionMethod(t,n){let{options:r}=this;b(r);let s=typeof t=="function"?t(new n):t;return y(s,n),r.push(s),this}};o(V,"SharedSlashCommandOptions");var Vt=require("discord-api-types/v9"),Dt=require("ts-mixer");var O=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new c):t;return y(r,c),n.push(r),this}toJSON(){return A(this.name,this.description,this.options),{type:Vt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(O,"SlashCommandSubcommandGroupBuilder"),O=l([(0,Dt.mix)(C)],O);var c=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return A(this.name,this.description,this.options),{type:Vt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(c,"SlashCommandSubcommandBuilder"),c=l([(0,Dt.mix)(C,V)],c);var X=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return A(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 Nt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new O):t;return y(r,O),n.push(r),this}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new c):t;return y(r,c),n.push(r),this}};o(X,"SlashCommandBuilder"),X=l([(0,Oe.mix)(V,C)],X);var kt={};F(kt,{validateDefaultPermission:()=>Ft,validateName:()=>ut,validateRequiredParameters:()=>Jt,validateType:()=>ct});var D=require("zod"),Ut=require("discord-api-types/v9"),Ye=D.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),to=D.z.union([D.z.literal(Ut.ApplicationCommandType.User),D.z.literal(Ut.ApplicationCommandType.Message)]),eo=D.z.boolean();function Ft(e){eo.parse(e)}o(Ft,"validateDefaultPermission");function ut(e){Ye.parse(e)}o(ut,"validateName");function ct(e){to.parse(e)}o(ct,"validateType");function Jt(e,t){ut(e),ct(t)}o(Jt,"validateRequiredParameters");var jt=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return ut(t),Reflect.set(this,"name",t),this}setType(t){return ct(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Ft(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Jt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(jt,"ContextMenuCommandBuilder");function oo(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(oo,"isJSONEncodable");module.exports=Re(no);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});
|
|
3
|
+
${t}\`\`\``}o(we,"codeBlock");function Ee(e){return`\`${e}\``}o(Ee,"inlineCode");function Be(e){return`_${e}_`}o(Be,"italic");function Ne(e){return`**${e}**`}o(Ne,"bold");function $e(e){return`__${e}__`}o($e,"underscore");function _e(e){return`~~${e}~~`}o(_e,"strikethrough");function Le(e){return`> ${e}`}o(Le,"quote");function Ve(e){return`>>> ${e}`}o(Ve,"blockQuote");function De(e){return`<${e}>`}o(De,"hideLinkEmbed");function Ue(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(Ue,"hyperlink");function Fe(e){return`||${e}||`}o(Fe,"spoiler");function Je(e){return`<@${e}>`}o(Je,"userMention");function ke(e){return`<@!${e}>`}o(ke,"memberNicknameMention");function je(e){return`<#${e}>`}o(je,"channelMention");function qe(e){return`<@&${e}>`}o(qe,"roleMention");function Ge(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Ge,"formatEmoji");function ze(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(ze,"time");var We={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Kt=(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))(Kt||{});var wt={};F(wt,{buttonLabelValidator:()=>Ot,buttonStyleValidator:()=>St,customIdValidator:()=>E,defaultValidator:()=>Tt,disabledValidator:()=>k,emojiValidator:()=>J,labelValueValidator:()=>j,minMaxValidator:()=>it,optionsValidator:()=>Qt,placeholderValidator:()=>Pt,urlValidator:()=>vt,validateRequiredButtonParameters:()=>Rt,validateRequiredSelectMenuOptionParameters:()=>Mt,validateRequiredSelectMenuParameters:()=>It});var nt=require("discord-api-types/v9"),m=require("zod"),E=m.z.string().min(1).max(100),J=m.z.object({id:m.z.string(),name:m.z.string(),animated:m.z.boolean()}).partial().strict(),k=m.z.boolean(),Ot=m.z.string().nonempty().max(80),St=m.z.number().int().min(nt.ButtonStyle.Primary).max(nt.ButtonStyle.Link),Pt=m.z.string().max(100),it=m.z.number().int().min(0).max(25),Qt=m.z.object({}).array().nonempty();function It(e,t){E.parse(t),Qt.parse(e)}o(It,"validateRequiredSelectMenuParameters");var j=m.z.string().min(1).max(100),Tt=m.z.boolean();function Mt(e,t){j.parse(e),j.parse(t)}o(Mt,"validateRequiredSelectMenuOptionParameters");var vt=m.z.string().url();function Rt(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(Rt,"validateRequiredButtonParameters");var Ht=require("discord-api-types/v9");var h=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(h,"Component");var rt=require("discord-api-types/v9");function Et(e){switch(e.type){case rt.ComponentType.ActionRow:return e instanceof B?e:new B(e);case rt.ComponentType.Button:return e instanceof N?e:new N(e);case rt.ComponentType.SelectMenu:return e instanceof $?e:new $(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Et,"createComponent");var B=class extends h{constructor({components:t,...n}={}){super({type:Ht.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Et(r))??[]}addComponents(...t){return this.components.push(...t),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(B,"ActionRow");var Xt=require("discord-api-types/v9");var q=class extends h{constructor(t){super({type:Xt.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}}};o(q,"UnsafeButtonComponent");var N=class extends q{setStyle(t){return super.setStyle(St.parse(t))}setURL(t){return super.setURL(vt.parse(t))}setCustomId(t){return super.setCustomId(E.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}setDisabled(t){return super.setDisabled(k.parse(t))}setLabel(t){return super.setLabel(Ot.parse(t))}toJSON(){return Rt(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(N,"ButtonComponent");var Yt=require("discord-api-types/v9");var P=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(P,"UnsafeSelectMenuOption");var G=class extends h{constructor(t){let{options:n,...r}=t??{};super({type:Yt.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new P(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),this}setOptions(...t){return this.options.splice(0,this.options.length,...t),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}};o(G,"UnsafeSelectMenuComponent");var $=class extends G{setPlaceholder(t){return super.setPlaceholder(Pt.parse(t))}setMinValues(t){return super.setMinValues(it.parse(t))}setMaxValues(t){return super.setMaxValues(it.parse(t))}setCustomId(t){return super.setCustomId(E.parse(t))}setDisabled(t){return super.setDisabled(k.parse(t))}toJSON(){return It(this.options,this.customId),super.toJSON()}};o($,"SelectMenuComponent");var Bt=class extends P{setDescription(t){return super.setDescription(j.parse(t))}setDefault(t){return super.setDefault(Tt.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}toJSON(){return Mt(this.label,this.value),super.toJSON()}};o(Bt,"SelectMenuOption");var _t={};F(_t,{assertReturnOfBuilder:()=>y,validateDefaultPermission:()=>Nt,validateDescription:()=>pt,validateMaxChoicesLength:()=>$t,validateMaxOptionsLength:()=>b,validateName:()=>st,validateRequired:()=>mt,validateRequiredParameters:()=>A});var at=ve(require("@sindresorhus/is")),z=require("zod"),Ze=z.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function st(e){Ze.parse(e)}o(st,"validateName");var Ke=z.z.string().min(1).max(100);function pt(e){Ke.parse(e)}o(pt,"validateDescription");var te=z.z.unknown().array().max(25);function b(e){te.parse(e)}o(b,"validateMaxOptionsLength");function A(e,t,n){st(e),pt(t),b(n)}o(A,"validateRequiredParameters");var ee=z.z.boolean();function Nt(e){ee.parse(e)}o(Nt,"validateDefaultPermission");function mt(e){ee.parse(e)}o(mt,"validateRequired");function $t(e){te.parse(e)}o($t,"validateMaxChoicesLength");function y(e,t){let n=t.name;if(at.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(at.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=at.default.function_(e)?e.name:r.constructor.name,R=Reflect.get(r,Symbol.toStringTag),U=R?`${s} [${R}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${U} instead.`)}}o(y,"assertReturnOfBuilder");var Oe=require("ts-mixer");var oe=require("discord-api-types/v9");var C=class{constructor(){i(this,"name");i(this,"description")}setName(t){return st(t),Reflect.set(this,"name",t),this}setDescription(t){return pt(t),Reflect.set(this,"description",t),this}};o(C,"SharedNameAndDescription");var p=class extends C{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return mt(t),Reflect.set(this,"required",t),this}runRequiredValidations(){A(this.name,this.description,[]),mt(this.required)}};o(p,"ApplicationCommandOptionBase");var W=class extends p{constructor(){super(...arguments);i(this,"type",oe.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(W,"SlashCommandBooleanOption");var ne=require("discord-api-types/v9"),ie=require("ts-mixer");var u=require("discord-api-types/v9"),Lt=require("zod"),Qe=[u.ChannelType.GuildText,u.ChannelType.GuildVoice,u.ChannelType.GuildCategory,u.ChannelType.GuildNews,u.ChannelType.GuildStore,u.ChannelType.GuildNewsThread,u.ChannelType.GuildPublicThread,u.ChannelType.GuildPrivateThread,u.ChannelType.GuildStageVoice],He=Lt.z.union(Qe.map(e=>Lt.z.literal(e))),lt=class{constructor(){i(this,"channel_types")}addChannelType(t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),He.parse(t),this.channel_types.push(t),this}addChannelTypes(t){return t.forEach(n=>this.addChannelType(n)),this}};o(lt,"ApplicationCommandOptionChannelTypesMixin");var I=class extends p{constructor(){super(...arguments);i(this,"type",ne.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(I,"SlashCommandChannelOption"),I=l([(0,ie.mix)(lt)],I);var pe=require("discord-api-types/v9"),me=require("ts-mixer"),le=require("zod");var _=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(_,"ApplicationCommandNumericOptionMinMaxValueMixin");var re=require("discord-api-types/v9"),L=require("zod");var dt=L.z.string().min(1).max(100),ae=L.z.number().gt(-1/0).lt(1/0),se=L.z.object({name:dt,value:L.z.union([dt,ae])}).array(),Xe=L.z.boolean(),g=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),dt.parse(n),this.type===re.ApplicationCommandOptionType.String?dt.parse(r):ae.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.");se.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.");se.parse(t),Reflect.set(this,"choices",[]);for(let n of t)this.addChoice(n);return this}setAutocomplete(t){if(Xe.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(g,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var de=le.z.number().int().nonnegative(),T=class extends p{constructor(){super(...arguments);i(this,"type",pe.ApplicationCommandOptionType.Integer)}setMaxValue(t){return de.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return de.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(T,"SlashCommandIntegerOption"),T=l([(0,me.mix)(_,g)],T);var ue=require("discord-api-types/v9");var Z=class extends p{constructor(){super(...arguments);i(this,"type",ue.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Z,"SlashCommandMentionableOption");var ce=require("discord-api-types/v9"),he=require("ts-mixer"),be=require("zod");var Ce=be.z.number().nonnegative(),M=class extends p{constructor(){super(...arguments);i(this,"type",ce.ApplicationCommandOptionType.Number)}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(M,"SlashCommandNumberOption"),M=l([(0,he.mix)(_,g)],M);var fe=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",fe.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandRoleOption");var xe=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",xe.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandAttachmentOption");var Ae=require("discord-api-types/v9"),ye=require("ts-mixer");var v=class extends p{constructor(){super(...arguments);i(this,"type",Ae.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(v,"SlashCommandStringOption"),v=l([(0,ye.mix)(g)],v);var ge=require("discord-api-types/v9");var H=class extends p{constructor(){super(...arguments);i(this,"type",ge.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(H,"SlashCommandUserOption");var V=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,W)}addUserOption(t){return this._sharedAddOptionMethod(t,H)}addChannelOption(t){return this._sharedAddOptionMethod(t,I)}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,v)}addIntegerOption(t){return this._sharedAddOptionMethod(t,T)}addNumberOption(t){return this._sharedAddOptionMethod(t,M)}_sharedAddOptionMethod(t,n){let{options:r}=this;b(r);let s=typeof t=="function"?t(new n):t;return y(s,n),r.push(s),this}};o(V,"SharedSlashCommandOptions");var Vt=require("discord-api-types/v9"),Dt=require("ts-mixer");var O=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new c):t;return y(r,c),n.push(r),this}toJSON(){return A(this.name,this.description,this.options),{type:Vt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(O,"SlashCommandSubcommandGroupBuilder"),O=l([(0,Dt.mix)(C)],O);var c=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return A(this.name,this.description,this.options),{type:Vt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(c,"SlashCommandSubcommandBuilder"),c=l([(0,Dt.mix)(C,V)],c);var X=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return A(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 Nt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new O):t;return y(r,O),n.push(r),this}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new c):t;return y(r,c),n.push(r),this}};o(X,"SlashCommandBuilder"),X=l([(0,Oe.mix)(V,C)],X);var kt={};F(kt,{validateDefaultPermission:()=>Ft,validateName:()=>ut,validateRequiredParameters:()=>Jt,validateType:()=>ct});var D=require("zod"),Ut=require("discord-api-types/v9"),Ye=D.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),to=D.z.union([D.z.literal(Ut.ApplicationCommandType.User),D.z.literal(Ut.ApplicationCommandType.Message)]),eo=D.z.boolean();function Ft(e){eo.parse(e)}o(Ft,"validateDefaultPermission");function ut(e){Ye.parse(e)}o(ut,"validateName");function ct(e){to.parse(e)}o(ct,"validateType");function Jt(e,t){ut(e),ct(t)}o(Jt,"validateRequiredParameters");var jt=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return ut(t),Reflect.set(this,"name",t),this}setType(t){return ct(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Ft(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Jt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(jt,"ContextMenuCommandBuilder");function oo(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(oo,"isJSONEncodable");module.exports=Re(no);0&&(module.exports={ActionRow,ButtonComponent,Component,ComponentAssertions,ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SelectMenuComponent,SelectMenuOption,SlashCommandAssertions,SlashCommandAttachmentOption,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,UnsafeButtonComponent,UnsafeEmbed,UnsafeSelectMenuComponent,UnsafeSelectMenuOption,blockQuote,bold,channelMention,codeBlock,createComponent,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,isJSONEncodable,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
|
|
4
4
|
//# sourceMappingURL=index.js.map
|