Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@discordjs/builders

Package Overview
Dependencies
Maintainers
2
Versions
1200
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@discordjs/builders - npm Package Compare versions

Comparing version 0.13.0-dev.1648123730.b520c3d to 0.13.0-dev.1648166909.cedd053

93

dist/index.d.ts

@@ -452,4 +452,4 @@ import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, APIBaseComponent, ComponentType, APIModalComponent, APIMessageComponent, APIActionRowComponent, APIModalActionRowComponent, APIMessageActionRowComponent, APIActionRowComponentTypes, APIButtonComponent, APITextInputComponent, TextInputStyle, APIModalInteractionResponseCallbackData, APISelectMenuComponent, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandAttachmentOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v10';

/**
* Sets the emoji to display on this button
* @param emoji The emoji to display on this button
* Sets the emoji to display on this option
* @param emoji The emoji to display on this option
*/

@@ -489,3 +489,82 @@ setEmoji(emoji: APIMessageComponentEmoji): this;

declare const minMaxValidator: z.ZodNumber;
declare const optionsValidator: z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "atleastone">;
declare const labelValueDescriptionValidator: z.ZodString;
declare const optionValidator: z.ZodUnion<[z.ZodObject<{
label: z.ZodString;
value: z.ZodString;
description: z.ZodOptional<z.ZodString>;
emoji: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
animated: z.ZodOptional<z.ZodBoolean>;
}, "strict", z.ZodTypeAny, {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
}, {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
}>>;
default: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
description?: string | undefined;
emoji?: {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
} | undefined;
default?: boolean | undefined;
value: string;
label: string;
}, {
description?: string | undefined;
emoji?: {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
} | undefined;
default?: boolean | undefined;
value: string;
label: string;
}>, z.ZodType<UnsafeSelectMenuOptionBuilder, z.ZodTypeDef, UnsafeSelectMenuOptionBuilder>]>;
declare const optionsValidator: z.ZodArray<z.ZodUnion<[z.ZodObject<{
label: z.ZodString;
value: z.ZodString;
description: z.ZodOptional<z.ZodString>;
emoji: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodOptional<z.ZodString>;
animated: z.ZodOptional<z.ZodBoolean>;
}, "strict", z.ZodTypeAny, {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
}, {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
}>>;
default: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
description?: string | undefined;
emoji?: {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
} | undefined;
default?: boolean | undefined;
value: string;
label: string;
}, {
description?: string | undefined;
emoji?: {
name?: string | undefined;
id?: string | undefined;
animated?: boolean | undefined;
} | undefined;
default?: boolean | undefined;
value: string;
label: string;
}>, z.ZodType<UnsafeSelectMenuOptionBuilder, z.ZodTypeDef, UnsafeSelectMenuOptionBuilder>]>, "atleastone">;
declare const optionsLengthValidator: z.ZodNumber;
declare function validateRequiredSelectMenuParameters(options: SelectMenuOptionBuilder[], customId?: string): void;

@@ -504,3 +583,6 @@ declare const labelValueValidator: z.ZodString;

declare const Assertions$4_minMaxValidator: typeof minMaxValidator;
declare const Assertions$4_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
declare const Assertions$4_optionValidator: typeof optionValidator;
declare const Assertions$4_optionsValidator: typeof optionsValidator;
declare const Assertions$4_optionsLengthValidator: typeof optionsLengthValidator;
declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;

@@ -521,3 +603,6 @@ declare const Assertions$4_labelValueValidator: typeof labelValueValidator;

Assertions$4_minMaxValidator as minMaxValidator,
Assertions$4_labelValueDescriptionValidator as labelValueDescriptionValidator,
Assertions$4_optionValidator as optionValidator,
Assertions$4_optionsValidator as optionsValidator,
Assertions$4_optionsLengthValidator as optionsLengthValidator,
Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters,

@@ -849,2 +934,4 @@ Assertions$4_labelValueValidator as labelValueValidator,

setDisabled(disabled?: boolean): this;
addOptions(...options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]): this;
setOptions(...options: (UnsafeSelectMenuOptionBuilder | APISelectMenuOption)[]): this;
toJSON(): APISelectMenuComponent;

@@ -851,0 +938,0 @@ }

4

dist/index.js

@@ -1,4 +0,4 @@

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc