New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@discordjs/builders

Package Overview
Dependencies
Maintainers
2
Versions
1252
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.1644106034.d8184f9 to 0.13.0-dev.1644235495.b936103

24

dist/index.d.ts

@@ -1,2 +0,2 @@

import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, APIMessageComponentEmoji, APISelectMenuOption, ButtonStyle, ComponentType, APIMessageComponent, APIActionRowComponent, APIButtonComponent, APISelectMenuComponent, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, APIMessageComponentEmoji, APISelectMenuOption, ButtonStyle, APIMessageComponent, ComponentType, APIActionRowComponent, APIButtonComponent, APISelectMenuComponent, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
import { z } from 'zod';

@@ -78,2 +78,14 @@ import { Snowflake } from 'discord-api-types/globals';

interface JSONEncodable<T> {
/**
* Transforms this object to its JSON format
*/
toJSON: () => T;
}
/**
* Indicates if an object is encodable or not.
* @param maybeEncodable The object to check against
*/
declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown>;
interface AuthorOptions {

@@ -88,3 +100,3 @@ name: string;

}
declare class UnsafeEmbed implements APIEmbed {
declare class UnsafeEmbed implements APIEmbed, JSONEncodable<APIEmbed> {
/**

@@ -589,3 +601,3 @@ * An array of fields of this embed

*/
interface Component {
interface Component extends JSONEncodable<APIMessageComponent> {
/**

@@ -595,6 +607,2 @@ * The type of this component

readonly type: ComponentType;
/**
* Converts this component to an API-compatible JSON object
*/
toJSON: () => APIMessageComponent;
}

@@ -1151,2 +1159,2 @@

export { ActionRow, ActionRowComponent, AuthorOptions, ButtonComponent, Component, Assertions$2 as ComponentAssertions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$3 as EmbedAssertions, Faces, FooterOptions, MappedComponentTypes, MessageComponent, SelectMenuComponent, SelectMenuOption, Assertions$1 as SlashCommandAssertions, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, UnsafeButtonComponent, UnsafeEmbed, UnsafeSelectMenuComponent, UnsafeSelectMenuOption, blockQuote, bold, channelMention, codeBlock, createComponent, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, italic, memberNicknameMention, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };
export { ActionRow, ActionRowComponent, AuthorOptions, ButtonComponent, Component, Assertions$2 as ComponentAssertions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$3 as EmbedAssertions, Faces, FooterOptions, JSONEncodable, MappedComponentTypes, MessageComponent, SelectMenuComponent, SelectMenuOption, Assertions$1 as SlashCommandAssertions, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, UnsafeButtonComponent, UnsafeEmbed, UnsafeSelectMenuComponent, UnsafeSelectMenuOption, blockQuote, bold, channelMention, codeBlock, createComponent, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, isJSONEncodable, italic, memberNicknameMention, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };

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

var yt=Object.create;var g=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var Pt=(t,e,n)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var qe=t=>g(t,"__esModule",{value:!0}),o=(t,e)=>g(t,"name",{value:e,configurable:!0});var D=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},Ge=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of gt(e))!St.call(t,a)&&(n||a!=="default")&&g(t,a,{get:()=>e[a],enumerable:!(r=Je(e,a))||r.enumerable});return t},It=(t,e)=>Ge(qe(g(t!=null?yt(Ot(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Tt=(t=>(e,n)=>t&&t.get(e)||(n=Ge(qe({}),e,1),t&&t.set(e,n),n))(typeof WeakMap!="undefined"?new WeakMap:0),m=(t,e,n,r)=>{for(var a=r>1?void 0:r?Je(e,n):e,T=t.length-1,L;T>=0;T--)(L=t[T])&&(a=(r?L(e,n,a):L(a))||a);return r&&a&&g(e,n,a),a};var i=(t,e,n)=>(Pt(t,typeof e!="symbol"?e+"":e,n),n);var Yt={};D(Yt,{ActionRow:()=>w,ButtonComponent:()=>B,ComponentAssertions:()=>we,ContextMenuCommandAssertions:()=>je,ContextMenuCommandBuilder:()=>Ue,Embed:()=>R,EmbedAssertions:()=>ge,Faces:()=>Ze,SelectMenuComponent:()=>E,SelectMenuOption:()=>G,SlashCommandAssertions:()=>$e,SlashCommandBooleanOption:()=>Z,SlashCommandBuilder:()=>X,SlashCommandChannelOption:()=>O,SlashCommandIntegerOption:()=>S,SlashCommandMentionableOption:()=>K,SlashCommandNumberOption:()=>P,SlashCommandRoleOption:()=>Q,SlashCommandStringOption:()=>I,SlashCommandSubcommandBuilder:()=>c,SlashCommandSubcommandGroupBuilder:()=>y,SlashCommandUserOption:()=>H,TimestampStyles:()=>qt,UnsafeButtonComponent:()=>J,UnsafeEmbed:()=>k,UnsafeSelectMenuComponent:()=>z,UnsafeSelectMenuOption:()=>q,blockQuote:()=>$t,bold:()=>wt,channelMention:()=>Ft,codeBlock:()=>vt,createComponent:()=>Be,formatEmoji:()=>Ut,hideLinkEmbed:()=>_t,hyperlink:()=>Vt,inlineCode:()=>Rt,italic:()=>Mt,memberNicknameMention:()=>kt,quote:()=>Nt,roleMention:()=>jt,spoiler:()=>Lt,strikethrough:()=>Et,time:()=>Jt,underscore:()=>Bt,userMention:()=>Dt});var ge={};D(ge,{authorNamePredicate:()=>be,colorPredicate:()=>fe,descriptionPredicate:()=>Ce,embedFieldPredicate:()=>ze,embedFieldsArrayPredicate:()=>te,fieldInlinePredicate:()=>ee,fieldLengthPredicate:()=>We,fieldNamePredicate:()=>v,fieldValuePredicate:()=>Y,footerTextPredicate:()=>xe,timestampPredicate:()=>Ae,titlePredicate:()=>ye,urlPredicate:()=>f,validateFieldLength:()=>oe});var d=require("zod"),v=d.z.string().min(1).max(256),Y=d.z.string().min(1).max(1024),ee=d.z.boolean().optional(),ze=d.z.object({name:v,value:Y,inline:ee}),te=ze.array(),We=d.z.number().lte(25);function oe(t,e){We.parse(t.length+e)}o(oe,"validateFieldLength");var be=v.nullable(),f=d.z.string().url().nullish(),fe=d.z.number().gte(0).lte(16777215).nullable(),Ce=d.z.string().min(1).max(4096).nullable(),xe=d.z.string().min(1).max(2048).nullable(),Ae=d.z.union([d.z.number(),d.z.date()]).nullable(),ye=v.nullable();var k=class{constructor(e={}){i(this,"fields");i(this,"title");i(this,"description");i(this,"url");i(this,"color");i(this,"timestamp");i(this,"thumbnail");i(this,"image");i(this,"video");i(this,"author");i(this,"provider");i(this,"footer");this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.thumbnail=e.thumbnail,this.image=e.image,this.video=e.video,this.author=e.author,this.provider=e.provider,this.footer=e.footer,this.fields=e.fields??[],e.timestamp&&(this.timestamp=new Date(e.timestamp).toISOString())}get length(){return(this.title?.length??0)+(this.description?.length??0)+this.fields.reduce((e,n)=>e+n.name.length+n.value.length,0)+(this.footer?.text.length??0)+(this.author?.name.length??0)}addField(e){return this.addFields(e)}addFields(...e){return this.fields.push(...R.normalizeFields(...e)),this}spliceFields(e,n,...r){return this.fields.splice(e,n,...R.normalizeFields(...r)),this}setFields(...e){return this.spliceFields(0,this.fields.length,...e),this}setAuthor(e){return e===null?(Reflect.set(this,"author",void 0),this):(Reflect.set(this,"author",{name:e.name,url:e.url,icon_url:e.iconURL}),this)}setColor(e){return Reflect.set(this,"color",e??void 0),this}setDescription(e){return Reflect.set(this,"description",e??void 0),this}setFooter(e){return e===null?(Reflect.set(this,"footer",void 0),this):(Reflect.set(this,"footer",{text:e.text,icon_url:e.iconURL}),this)}setImage(e){return Reflect.set(this,"image",e?{url:e}:void 0),this}setThumbnail(e){return Reflect.set(this,"thumbnail",e?{url:e}:void 0),this}setTimestamp(e=Date.now()){return Reflect.set(this,"timestamp",e?new Date(e).toISOString():void 0),this}setTitle(e){return Reflect.set(this,"title",e??void 0),this}setURL(e){return Reflect.set(this,"url",e??void 0),this}toJSON(){return{...this}}static normalizeFields(...e){return e.flat(1/0).map(n=>({name:n.name,value:n.value,inline:n.inline??void 0}))}};o(k,"UnsafeEmbed");var R=class extends k{addFields(...e){return oe(this.fields,e.length),super.addFields(...te.parse(e))}spliceFields(e,n,...r){return oe(this.fields,r.length-n),super.spliceFields(e,n,...te.parse(r))}setAuthor(e){return e===null?super.setAuthor(null):(be.parse(e.name),f.parse(e.iconURL),f.parse(e.url),super.setAuthor(e))}setColor(e){return super.setColor(fe.parse(e))}setDescription(e){return super.setDescription(Ce.parse(e))}setFooter(e){return e===null?super.setFooter(null):(xe.parse(e.text),f.parse(e.iconURL),super.setFooter(e))}setImage(e){return super.setImage(f.parse(e))}setThumbnail(e){return super.setThumbnail(f.parse(e))}setTimestamp(e=Date.now()){return super.setTimestamp(Ae.parse(e))}setTitle(e){return super.setTitle(ye.parse(e))}setURL(e){return super.setURL(f.parse(e))}static normalizeFields(...e){return e.flat(1/0).map(n=>(v.parse(n.name),Y.parse(n.value),ee.parse(n.inline),{name:n.name,value:n.value,inline:n.inline??void 0}))}};o(R,"Embed");function vt(t,e){return typeof e=="undefined"?`\`\`\`
var yt=Object.create;var O=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty;var Pt=(t,e,n)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var qe=t=>O(t,"__esModule",{value:!0}),o=(t,e)=>O(t,"name",{value:e,configurable:!0});var k=(t,e)=>{for(var n in e)O(t,n,{get:e[n],enumerable:!0})},Ge=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of gt(e))!St.call(t,a)&&(n||a!=="default")&&O(t,a,{get:()=>e[a],enumerable:!(r=Ue(e,a))||r.enumerable});return t},It=(t,e)=>Ge(qe(O(t!=null?yt(Ot(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Tt=(t=>(e,n)=>t&&t.get(e)||(n=Ge(qe({}),e,1),t&&t.set(e,n),n))(typeof WeakMap!="undefined"?new WeakMap:0),m=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ue(e,n):e,v=t.length-1,L;v>=0;v--)(L=t[v])&&(a=(r?L(e,n,a):L(a))||a);return r&&a&&O(e,n,a),a};var i=(t,e,n)=>(Pt(t,typeof e!="symbol"?e+"":e,n),n);var eo={};k(eo,{ActionRow:()=>w,ButtonComponent:()=>N,ComponentAssertions:()=>we,ContextMenuCommandAssertions:()=>Fe,ContextMenuCommandBuilder:()=>je,Embed:()=>ge,EmbedAssertions:()=>ye,Faces:()=>Ze,SelectMenuComponent:()=>E,SelectMenuOption:()=>q,SlashCommandAssertions:()=>$e,SlashCommandBooleanOption:()=>W,SlashCommandBuilder:()=>H,SlashCommandChannelOption:()=>S,SlashCommandIntegerOption:()=>P,SlashCommandMentionableOption:()=>Z,SlashCommandNumberOption:()=>I,SlashCommandRoleOption:()=>K,SlashCommandStringOption:()=>T,SlashCommandSubcommandBuilder:()=>c,SlashCommandSubcommandGroupBuilder:()=>g,SlashCommandUserOption:()=>Q,TimestampStyles:()=>qt,UnsafeButtonComponent:()=>j,UnsafeEmbed:()=>C,UnsafeSelectMenuComponent:()=>G,UnsafeSelectMenuOption:()=>U,blockQuote:()=>$t,bold:()=>wt,channelMention:()=>Jt,codeBlock:()=>vt,createComponent:()=>Ne,formatEmoji:()=>jt,hideLinkEmbed:()=>Vt,hyperlink:()=>_t,inlineCode:()=>Rt,isJSONEncodable:()=>Yt,italic:()=>Mt,memberNicknameMention:()=>Dt,quote:()=>Bt,roleMention:()=>Ft,spoiler:()=>Lt,strikethrough:()=>Et,time:()=>Ut,underscore:()=>Nt,userMention:()=>kt});var ye={};k(ye,{authorNamePredicate:()=>he,colorPredicate:()=>be,descriptionPredicate:()=>fe,embedFieldPredicate:()=>ze,embedFieldsArrayPredicate:()=>ee,fieldInlinePredicate:()=>Y,fieldLengthPredicate:()=>We,fieldNamePredicate:()=>R,fieldValuePredicate:()=>X,footerTextPredicate:()=>Ce,timestampPredicate:()=>xe,titlePredicate:()=>Ae,urlPredicate:()=>f,validateFieldLength:()=>te});var d=require("zod"),R=d.z.string().min(1).max(256),X=d.z.string().min(1).max(1024),Y=d.z.boolean().optional(),ze=d.z.object({name:R,value:X,inline:Y}),ee=ze.array(),We=d.z.number().lte(25);function te(t,e){We.parse(t.length+e)}o(te,"validateFieldLength");var he=R.nullable(),f=d.z.string().url().nullish(),be=d.z.number().gte(0).lte(16777215).nullable(),fe=d.z.string().min(1).max(4096).nullable(),Ce=d.z.string().min(1).max(2048).nullable(),xe=d.z.union([d.z.number(),d.z.date()]).nullable(),Ae=R.nullable();var C=class{constructor(e={}){i(this,"fields");i(this,"title");i(this,"description");i(this,"url");i(this,"color");i(this,"timestamp");i(this,"thumbnail");i(this,"image");i(this,"video");i(this,"author");i(this,"provider");i(this,"footer");this.title=e.title,this.description=e.description,this.url=e.url,this.color=e.color,this.thumbnail=e.thumbnail,this.image=e.image,this.video=e.video,this.author=e.author,this.provider=e.provider,this.footer=e.footer,this.fields=e.fields??[],e.timestamp&&(this.timestamp=new Date(e.timestamp).toISOString())}get length(){return(this.title?.length??0)+(this.description?.length??0)+this.fields.reduce((e,n)=>e+n.name.length+n.value.length,0)+(this.footer?.text.length??0)+(this.author?.name.length??0)}addField(e){return this.addFields(e)}addFields(...e){return this.fields.push(...C.normalizeFields(...e)),this}spliceFields(e,n,...r){return this.fields.splice(e,n,...C.normalizeFields(...r)),this}setFields(...e){return this.spliceFields(0,this.fields.length,...e),this}setAuthor(e){return e===null?(Reflect.set(this,"author",void 0),this):(Reflect.set(this,"author",{name:e.name,url:e.url,icon_url:e.iconURL}),this)}setColor(e){return Reflect.set(this,"color",e??void 0),this}setDescription(e){return Reflect.set(this,"description",e??void 0),this}setFooter(e){return e===null?(Reflect.set(this,"footer",void 0),this):(Reflect.set(this,"footer",{text:e.text,icon_url:e.iconURL}),this)}setImage(e){return Reflect.set(this,"image",e?{url:e}:void 0),this}setThumbnail(e){return Reflect.set(this,"thumbnail",e?{url:e}:void 0),this}setTimestamp(e=Date.now()){return Reflect.set(this,"timestamp",e?new Date(e).toISOString():void 0),this}setTitle(e){return Reflect.set(this,"title",e??void 0),this}setURL(e){return Reflect.set(this,"url",e??void 0),this}toJSON(){return{...this}}static normalizeFields(...e){return e.flat(1/0).map(n=>({name:n.name,value:n.value,inline:n.inline??void 0}))}};o(C,"UnsafeEmbed");var ge=class extends C{addFields(...e){return te(this.fields,e.length),super.addFields(...ee.parse(e))}spliceFields(e,n,...r){return te(this.fields,r.length-n),super.spliceFields(e,n,...ee.parse(r))}setAuthor(e){return e===null?super.setAuthor(null):(he.parse(e.name),f.parse(e.iconURL),f.parse(e.url),super.setAuthor(e))}setColor(e){return super.setColor(be.parse(e))}setDescription(e){return super.setDescription(fe.parse(e))}setFooter(e){return e===null?super.setFooter(null):(Ce.parse(e.text),f.parse(e.iconURL),super.setFooter(e))}setImage(e){return super.setImage(f.parse(e))}setThumbnail(e){return super.setThumbnail(f.parse(e))}setTimestamp(e=Date.now()){return super.setTimestamp(xe.parse(e))}setTitle(e){return super.setTitle(Ae.parse(e))}setURL(e){return super.setURL(f.parse(e))}static normalizeFields(...e){return e.flat(1/0).map(n=>(R.parse(n.name),X.parse(n.value),Y.parse(n.inline),{name:n.name,value:n.value,inline:n.inline??void 0}))}};o(ge,"Embed");function vt(t,e){return typeof e=="undefined"?`\`\`\`
${t}\`\`\``:`\`\`\`${t}
${e}\`\`\``}o(vt,"codeBlock");function Rt(t){return`\`${t}\``}o(Rt,"inlineCode");function Mt(t){return`_${t}_`}o(Mt,"italic");function wt(t){return`**${t}**`}o(wt,"bold");function Bt(t){return`__${t}__`}o(Bt,"underscore");function Et(t){return`~~${t}~~`}o(Et,"strikethrough");function Nt(t){return`> ${t}`}o(Nt,"quote");function $t(t){return`>>> ${t}`}o($t,"blockQuote");function _t(t){return`<${t}>`}o(_t,"hideLinkEmbed");function Vt(t,e,n){return n?`[${t}](${e} "${n}")`:`[${t}](${e})`}o(Vt,"hyperlink");function Lt(t){return`||${t}||`}o(Lt,"spoiler");function Dt(t){return`<@${t}>`}o(Dt,"userMention");function kt(t){return`<@!${t}>`}o(kt,"memberNicknameMention");function Ft(t){return`<#${t}>`}o(Ft,"channelMention");function jt(t){return`<@&${t}>`}o(jt,"roleMention");function Ut(t,e=!1){return`<${e?"a":""}:_:${t}>`}o(Ut,"formatEmoji");function Jt(t,e){return typeof t!="number"&&(t=Math.floor((t?.getTime()??Date.now())/1e3)),typeof e=="string"?`<t:${t}:${e}>`:`<t:${t}>`}o(Jt,"time");var qt={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Ze=(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))(Ze||{});var we={};D(we,{buttonLabelValidator:()=>Oe,buttonStyleValidator:()=>Se,customIdValidator:()=>M,defaultValidator:()=>Te,disabledValidator:()=>j,emojiValidator:()=>F,labelValueValidator:()=>U,minMaxValidator:()=>ne,optionsValidator:()=>Ke,placeholderValidator:()=>Pe,urlValidator:()=>Re,validateRequiredButtonParameters:()=>Me,validateRequiredSelectMenuOptionParameters:()=>ve,validateRequiredSelectMenuParameters:()=>Ie});var ie=require("discord-api-types/v9"),l=require("zod"),M=l.z.string().min(1).max(100),F=l.z.object({id:l.z.string(),name:l.z.string(),animated:l.z.boolean()}).partial().strict(),j=l.z.boolean(),Oe=l.z.string().nonempty().max(80),Se=l.z.number().int().min(ie.ButtonStyle.Primary).max(ie.ButtonStyle.Link),Pe=l.z.string().max(100),ne=l.z.number().int().min(0).max(25),Ke=l.z.object({}).array().nonempty();function Ie(t,e){M.parse(e),Ke.parse(t)}o(Ie,"validateRequiredSelectMenuParameters");var U=l.z.string().min(1).max(100),Te=l.z.boolean();function ve(t,e){U.parse(t),U.parse(e)}o(ve,"validateRequiredSelectMenuOptionParameters");var Re=l.z.string().url();function Me(t,e,n,r,a){if(a&&r)throw new RangeError("URL and custom id are mutually exclusive");if(!e&&!n)throw new RangeError("Buttons must have a label and/or an emoji");if(t===ie.ButtonStyle.Link){if(!a)throw new RangeError("Link buttons must have a url")}else if(a)throw new RangeError("Non-link buttons cannot have a url")}o(Me,"validateRequiredButtonParameters");var Qe=require("discord-api-types/v9");var re=require("discord-api-types/v9");function Be(t){switch(t.type){case re.ComponentType.ActionRow:return t instanceof w?t:new w(t);case re.ComponentType.Button:return t instanceof B?t:new B(t);case re.ComponentType.SelectMenu:return t instanceof E?t:new E(t);default:throw new Error(`Cannot serialize component type: ${t.type}`)}}o(Be,"createComponent");var w=class{constructor(e){i(this,"components",[]);i(this,"type",Qe.ComponentType.ActionRow);this.components=e?.components.map(Be)??[]}addComponents(...e){return this.components.push(...e),this}setComponents(e){return Reflect.set(this,"components",[...e]),this}toJSON(){return{...this,components:this.components.map(e=>e.toJSON())}}};o(w,"ActionRow");var se=require("discord-api-types/v9"),J=class{constructor(e){i(this,"type",se.ComponentType.Button);i(this,"style");i(this,"label");i(this,"emoji");i(this,"disabled");i(this,"custom_id");i(this,"url");this.style=e?.style,this.label=e?.label,this.emoji=e?.emoji,this.disabled=e?.disabled,e?.style===se.ButtonStyle.Link?this.url=e.url:this.custom_id=e?.custom_id}setStyle(e){return Reflect.set(this,"style",e),this}setURL(e){return Reflect.set(this,"url",e),this}setCustomId(e){return Reflect.set(this,"custom_id",e),this}setEmoji(e){return Reflect.set(this,"emoji",e),this}setDisabled(e){return Reflect.set(this,"disabled",e),this}setLabel(e){return Reflect.set(this,"label",e),this}toJSON(){return{...this}}};o(J,"UnsafeButtonComponent");var B=class extends J{setStyle(e){return super.setStyle(Se.parse(e))}setURL(e){return super.setURL(Re.parse(e))}setCustomId(e){return super.setCustomId(M.parse(e))}setEmoji(e){return super.setEmoji(F.parse(e))}setDisabled(e){return super.setDisabled(j.parse(e))}setLabel(e){return super.setLabel(Oe.parse(e))}toJSON(){return Me(this.style,this.label,this.emoji,this.custom_id,this.url),super.toJSON()}};o(B,"ButtonComponent");var He=require("discord-api-types/v9");var q=class{constructor(e){i(this,"label");i(this,"value");i(this,"description");i(this,"emoji");i(this,"default");this.label=e?.label,this.value=e?.value,this.description=e?.description,this.emoji=e?.emoji,this.default=e?.default}setLabel(e){return Reflect.set(this,"label",e),this}setValue(e){return Reflect.set(this,"value",e),this}setDescription(e){return Reflect.set(this,"description",e),this}setDefault(e){return Reflect.set(this,"default",e),this}setEmoji(e){return Reflect.set(this,"emoji",e),this}toJSON(){return{...this}}};o(q,"UnsafeSelectMenuOption");var G=class extends q{setDescription(e){return super.setDescription(U.parse(e))}setDefault(e){return super.setDefault(Te.parse(e))}setEmoji(e){return super.setEmoji(F.parse(e))}toJSON(){return ve(this.label,this.value),super.toJSON()}};o(G,"SelectMenuOption");var z=class{constructor(e){i(this,"type",He.ComponentType.SelectMenu);i(this,"options");i(this,"placeholder");i(this,"min_values");i(this,"max_values");i(this,"custom_id");i(this,"disabled");this.options=e?.options.map(n=>new G(n))??[],this.placeholder=e?.placeholder,this.min_values=e?.min_values,this.max_values=e?.max_values,this.custom_id=e?.custom_id,this.disabled=e?.disabled}setPlaceholder(e){return Reflect.set(this,"placeholder",e),this}setMinValues(e){return Reflect.set(this,"min_values",e),this}setMaxValues(e){return Reflect.set(this,"max_values",e),this}setCustomId(e){return Reflect.set(this,"custom_id",e),this}setDisabled(e){return Reflect.set(this,"disabled",e),this}addOptions(...e){return this.options.push(...e),this}setOptions(e){return Reflect.set(this,"options",[...e]),this}toJSON(){return{...this,options:this.options.map(e=>e.toJSON())}}};o(z,"UnsafeSelectMenuComponent");var E=class extends z{setPlaceholder(e){return super.setPlaceholder(Pe.parse(e))}setMinValues(e){return super.setMinValues(ne.parse(e))}setMaxValues(e){return super.setMaxValues(ne.parse(e))}setCustomId(e){return super.setCustomId(M.parse(e))}setDisabled(e){return super.setDisabled(j.parse(e))}toJSON(){return Ie(this.options,this.custom_id),super.toJSON()}};o(E,"SelectMenuComponent");var $e={};D($e,{assertReturnOfBuilder:()=>x,validateDefaultPermission:()=>Ee,validateDescription:()=>le,validateMaxChoicesLength:()=>Ne,validateMaxOptionsLength:()=>h,validateName:()=>pe,validateRequired:()=>me,validateRequiredParameters:()=>C});var ae=It(require("@sindresorhus/is")),W=require("zod"),Gt=W.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function pe(t){Gt.parse(t)}o(pe,"validateName");var zt=W.z.string().min(1).max(100);function le(t){zt.parse(t)}o(le,"validateDescription");var Xe=W.z.unknown().array().max(25);function h(t){Xe.parse(t)}o(h,"validateMaxOptionsLength");function C(t,e,n){pe(t),le(e),h(n)}o(C,"validateRequiredParameters");var Ye=W.z.boolean();function Ee(t){Ye.parse(t)}o(Ee,"validateDefaultPermission");function me(t){Ye.parse(t)}o(me,"validateRequired");function Ne(t){Xe.parse(t)}o(Ne,"validateMaxChoicesLength");function x(t,e){let n=e.name;if(ae.default.nullOrUndefined(t))throw new TypeError(`Expected to receive a ${n} builder, got ${t===null?"null":"undefined"} instead.`);if(ae.default.primitive(t))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof t}) instead.`);if(!(t instanceof e)){let r=t,a=ae.default.function_(t)?t.name:r.constructor.name,T=Reflect.get(r,Symbol.toStringTag),L=T?`${a} [${T}]`:a;throw new TypeError(`Expected to receive a ${n} builder, got ${L} instead.`)}}o(x,"assertReturnOfBuilder");var At=require("ts-mixer");var et=require("discord-api-types/v9");var b=class{constructor(){i(this,"name");i(this,"description")}setName(e){return pe(e),Reflect.set(this,"name",e),this}setDescription(e){return le(e),Reflect.set(this,"description",e),this}};o(b,"SharedNameAndDescription");var p=class extends b{constructor(){super(...arguments);i(this,"required",!1)}setRequired(e){return me(e),Reflect.set(this,"required",e),this}runRequiredValidations(){C(this.name,this.description,[]),me(this.required)}};o(p,"ApplicationCommandOptionBase");var Z=class extends p{constructor(){super(...arguments);i(this,"type",et.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Z,"SlashCommandBooleanOption");var tt=require("discord-api-types/v9"),ot=require("ts-mixer");var u=require("discord-api-types/v9"),_e=require("zod"),Wt=[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],Zt=_e.z.union(Wt.map(t=>_e.z.literal(t))),de=class{constructor(){i(this,"channel_types")}addChannelType(e){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Zt.parse(e),this.channel_types.push(e),this}addChannelTypes(e){return e.forEach(n=>this.addChannelType(n)),this}};o(de,"ApplicationCommandOptionChannelTypesMixin");var O=class extends p{constructor(){super(...arguments);i(this,"type",tt.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(O,"SlashCommandChannelOption"),O=m([(0,ot.mix)(de)],O);var st=require("discord-api-types/v9"),at=require("ts-mixer"),pt=require("zod");var N=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(N,"ApplicationCommandNumericOptionMinMaxValueMixin");var it=require("discord-api-types/v9"),$=require("zod");var ue=$.z.string().min(1).max(100),nt=$.z.number().gt(-1/0).lt(1/0),rt=$.z.tuple([ue,$.z.union([ue,nt])]).array(),Kt=$.z.boolean(),A=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoice(e,n){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),Ne(this.choices),ue.parse(e),this.type===it.ApplicationCommandOptionType.String?ue.parse(n):nt.parse(n),this.choices.push({name:e,value:n}),this}addChoices(e){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");rt.parse(e);for(let[n,r]of e)this.addChoice(n,r);return this}setChoices(e){if(e.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");rt.parse(e),Reflect.set(this,"choices",[]);for(let[n,r]of e)this.addChoice(n,r);return this}setAutocomplete(e){if(Kt.parse(e),e&&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",e),this}};o(A,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var lt=pt.z.number().int().nonnegative(),S=class extends p{constructor(){super(...arguments);i(this,"type",st.ApplicationCommandOptionType.Integer)}setMaxValue(e){return lt.parse(e),Reflect.set(this,"max_value",e),this}setMinValue(e){return lt.parse(e),Reflect.set(this,"min_value",e),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(S,"SlashCommandIntegerOption"),S=m([(0,at.mix)(N,A)],S);var mt=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",mt.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandMentionableOption");var dt=require("discord-api-types/v9"),ut=require("ts-mixer"),ct=require("zod");var ht=ct.z.number().nonnegative(),P=class extends p{constructor(){super(...arguments);i(this,"type",dt.ApplicationCommandOptionType.Number)}setMaxValue(e){return ht.parse(e),Reflect.set(this,"max_value",e),this}setMinValue(e){return ht.parse(e),Reflect.set(this,"min_value",e),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(P,"SlashCommandNumberOption"),P=m([(0,ut.mix)(N,A)],P);var bt=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",bt.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandRoleOption");var ft=require("discord-api-types/v9"),Ct=require("ts-mixer");var I=class extends p{constructor(){super(...arguments);i(this,"type",ft.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(I,"SlashCommandStringOption"),I=m([(0,Ct.mix)(A)],I);var xt=require("discord-api-types/v9");var H=class extends p{constructor(){super(...arguments);i(this,"type",xt.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(H,"SlashCommandUserOption");var _=class{constructor(){i(this,"options")}addBooleanOption(e){return this._sharedAddOptionMethod(e,Z)}addUserOption(e){return this._sharedAddOptionMethod(e,H)}addChannelOption(e){return this._sharedAddOptionMethod(e,O)}addRoleOption(e){return this._sharedAddOptionMethod(e,Q)}addMentionableOption(e){return this._sharedAddOptionMethod(e,K)}addStringOption(e){return this._sharedAddOptionMethod(e,I)}addIntegerOption(e){return this._sharedAddOptionMethod(e,S)}addNumberOption(e){return this._sharedAddOptionMethod(e,P)}_sharedAddOptionMethod(e,n){let{options:r}=this;h(r);let a=typeof e=="function"?e(new n):e;return x(a,n),r.push(a),this}};o(_,"SharedSlashCommandOptions");var Ve=require("discord-api-types/v9"),Le=require("ts-mixer");var y=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(e){let{options:n}=this;h(n);let r=typeof e=="function"?e(new c):e;return x(r,c),n.push(r),this}toJSON(){return C(this.name,this.description,this.options),{type:Ve.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};o(y,"SlashCommandSubcommandGroupBuilder"),y=m([(0,Le.mix)(b)],y);var c=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return C(this.name,this.description,this.options),{type:Ve.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};o(c,"SlashCommandSubcommandBuilder"),c=m([(0,Le.mix)(b,_)],c);var X=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return C(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(e=>e.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(e){return Ee(e),Reflect.set(this,"defaultPermission",e),this}addSubcommandGroup(e){let{options:n}=this;h(n);let r=typeof e=="function"?e(new y):e;return x(r,y),n.push(r),this}addSubcommand(e){let{options:n}=this;h(n);let r=typeof e=="function"?e(new c):e;return x(r,c),n.push(r),this}};o(X,"SlashCommandBuilder"),X=m([(0,At.mix)(_,b)],X);var je={};D(je,{validateDefaultPermission:()=>ke,validateName:()=>ce,validateRequiredParameters:()=>Fe,validateType:()=>he});var V=require("zod"),De=require("discord-api-types/v9"),Qt=V.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),Ht=V.z.union([V.z.literal(De.ApplicationCommandType.User),V.z.literal(De.ApplicationCommandType.Message)]),Xt=V.z.boolean();function ke(t){Xt.parse(t)}o(ke,"validateDefaultPermission");function ce(t){Qt.parse(t)}o(ce,"validateName");function he(t){Ht.parse(t)}o(he,"validateType");function Fe(t,e){ce(t),he(e)}o(Fe,"validateRequiredParameters");var Ue=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(e){return ce(e),Reflect.set(this,"name",e),this}setType(e){return he(e),Reflect.set(this,"type",e),this}setDefaultPermission(e){return ke(e),Reflect.set(this,"defaultPermission",e),this}toJSON(){return Fe(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(Ue,"ContextMenuCommandBuilder");module.exports=Tt(Yt);0&&(module.exports={ActionRow,ButtonComponent,ComponentAssertions,ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SelectMenuComponent,SelectMenuOption,SlashCommandAssertions,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,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
${e}\`\`\``}o(vt,"codeBlock");function Rt(t){return`\`${t}\``}o(Rt,"inlineCode");function Mt(t){return`_${t}_`}o(Mt,"italic");function wt(t){return`**${t}**`}o(wt,"bold");function Nt(t){return`__${t}__`}o(Nt,"underscore");function Et(t){return`~~${t}~~`}o(Et,"strikethrough");function Bt(t){return`> ${t}`}o(Bt,"quote");function $t(t){return`>>> ${t}`}o($t,"blockQuote");function Vt(t){return`<${t}>`}o(Vt,"hideLinkEmbed");function _t(t,e,n){return n?`[${t}](${e} "${n}")`:`[${t}](${e})`}o(_t,"hyperlink");function Lt(t){return`||${t}||`}o(Lt,"spoiler");function kt(t){return`<@${t}>`}o(kt,"userMention");function Dt(t){return`<@!${t}>`}o(Dt,"memberNicknameMention");function Jt(t){return`<#${t}>`}o(Jt,"channelMention");function Ft(t){return`<@&${t}>`}o(Ft,"roleMention");function jt(t,e=!1){return`<${e?"a":""}:_:${t}>`}o(jt,"formatEmoji");function Ut(t,e){return typeof t!="number"&&(t=Math.floor((t?.getTime()??Date.now())/1e3)),typeof e=="string"?`<t:${t}:${e}>`:`<t:${t}>`}o(Ut,"time");var qt={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Ze=(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))(Ze||{});var we={};k(we,{buttonLabelValidator:()=>Oe,buttonStyleValidator:()=>Se,customIdValidator:()=>M,defaultValidator:()=>Te,disabledValidator:()=>J,emojiValidator:()=>D,labelValueValidator:()=>F,minMaxValidator:()=>ie,optionsValidator:()=>Ke,placeholderValidator:()=>Pe,urlValidator:()=>Re,validateRequiredButtonParameters:()=>Me,validateRequiredSelectMenuOptionParameters:()=>ve,validateRequiredSelectMenuParameters:()=>Ie});var oe=require("discord-api-types/v9"),l=require("zod"),M=l.z.string().min(1).max(100),D=l.z.object({id:l.z.string(),name:l.z.string(),animated:l.z.boolean()}).partial().strict(),J=l.z.boolean(),Oe=l.z.string().nonempty().max(80),Se=l.z.number().int().min(oe.ButtonStyle.Primary).max(oe.ButtonStyle.Link),Pe=l.z.string().max(100),ie=l.z.number().int().min(0).max(25),Ke=l.z.object({}).array().nonempty();function Ie(t,e){M.parse(e),Ke.parse(t)}o(Ie,"validateRequiredSelectMenuParameters");var F=l.z.string().min(1).max(100),Te=l.z.boolean();function ve(t,e){F.parse(t),F.parse(e)}o(ve,"validateRequiredSelectMenuOptionParameters");var Re=l.z.string().url();function Me(t,e,n,r,a){if(a&&r)throw new RangeError("URL and custom id are mutually exclusive");if(!e&&!n)throw new RangeError("Buttons must have a label and/or an emoji");if(t===oe.ButtonStyle.Link){if(!a)throw new RangeError("Link buttons must have a url")}else if(a)throw new RangeError("Non-link buttons cannot have a url")}o(Me,"validateRequiredButtonParameters");var Qe=require("discord-api-types/v9");var ne=require("discord-api-types/v9");function Ne(t){switch(t.type){case ne.ComponentType.ActionRow:return t instanceof w?t:new w(t);case ne.ComponentType.Button:return t instanceof N?t:new N(t);case ne.ComponentType.SelectMenu:return t instanceof E?t:new E(t);default:throw new Error(`Cannot serialize component type: ${t.type}`)}}o(Ne,"createComponent");var w=class{constructor(e){i(this,"components",[]);i(this,"type",Qe.ComponentType.ActionRow);this.components=e?.components.map(Ne)??[]}addComponents(...e){return this.components.push(...e),this}setComponents(e){return Reflect.set(this,"components",[...e]),this}toJSON(){return{...this,components:this.components.map(e=>e.toJSON())}}};o(w,"ActionRow");var re=require("discord-api-types/v9"),j=class{constructor(e){i(this,"type",re.ComponentType.Button);i(this,"style");i(this,"label");i(this,"emoji");i(this,"disabled");i(this,"custom_id");i(this,"url");this.style=e?.style,this.label=e?.label,this.emoji=e?.emoji,this.disabled=e?.disabled,e?.style===re.ButtonStyle.Link?this.url=e.url:this.custom_id=e?.custom_id}setStyle(e){return Reflect.set(this,"style",e),this}setURL(e){return Reflect.set(this,"url",e),this}setCustomId(e){return Reflect.set(this,"custom_id",e),this}setEmoji(e){return Reflect.set(this,"emoji",e),this}setDisabled(e){return Reflect.set(this,"disabled",e),this}setLabel(e){return Reflect.set(this,"label",e),this}toJSON(){return{...this}}};o(j,"UnsafeButtonComponent");var N=class extends j{setStyle(e){return super.setStyle(Se.parse(e))}setURL(e){return super.setURL(Re.parse(e))}setCustomId(e){return super.setCustomId(M.parse(e))}setEmoji(e){return super.setEmoji(D.parse(e))}setDisabled(e){return super.setDisabled(J.parse(e))}setLabel(e){return super.setLabel(Oe.parse(e))}toJSON(){return Me(this.style,this.label,this.emoji,this.custom_id,this.url),super.toJSON()}};o(N,"ButtonComponent");var He=require("discord-api-types/v9");var U=class{constructor(e){i(this,"label");i(this,"value");i(this,"description");i(this,"emoji");i(this,"default");this.label=e?.label,this.value=e?.value,this.description=e?.description,this.emoji=e?.emoji,this.default=e?.default}setLabel(e){return Reflect.set(this,"label",e),this}setValue(e){return Reflect.set(this,"value",e),this}setDescription(e){return Reflect.set(this,"description",e),this}setDefault(e){return Reflect.set(this,"default",e),this}setEmoji(e){return Reflect.set(this,"emoji",e),this}toJSON(){return{...this}}};o(U,"UnsafeSelectMenuOption");var q=class extends U{setDescription(e){return super.setDescription(F.parse(e))}setDefault(e){return super.setDefault(Te.parse(e))}setEmoji(e){return super.setEmoji(D.parse(e))}toJSON(){return ve(this.label,this.value),super.toJSON()}};o(q,"SelectMenuOption");var G=class{constructor(e){i(this,"type",He.ComponentType.SelectMenu);i(this,"options");i(this,"placeholder");i(this,"min_values");i(this,"max_values");i(this,"custom_id");i(this,"disabled");this.options=e?.options.map(n=>new q(n))??[],this.placeholder=e?.placeholder,this.min_values=e?.min_values,this.max_values=e?.max_values,this.custom_id=e?.custom_id,this.disabled=e?.disabled}setPlaceholder(e){return Reflect.set(this,"placeholder",e),this}setMinValues(e){return Reflect.set(this,"min_values",e),this}setMaxValues(e){return Reflect.set(this,"max_values",e),this}setCustomId(e){return Reflect.set(this,"custom_id",e),this}setDisabled(e){return Reflect.set(this,"disabled",e),this}addOptions(...e){return this.options.push(...e),this}setOptions(e){return Reflect.set(this,"options",[...e]),this}toJSON(){return{...this,options:this.options.map(e=>e.toJSON())}}};o(G,"UnsafeSelectMenuComponent");var E=class extends G{setPlaceholder(e){return super.setPlaceholder(Pe.parse(e))}setMinValues(e){return super.setMinValues(ie.parse(e))}setMaxValues(e){return super.setMaxValues(ie.parse(e))}setCustomId(e){return super.setCustomId(M.parse(e))}setDisabled(e){return super.setDisabled(J.parse(e))}toJSON(){return Ie(this.options,this.custom_id),super.toJSON()}};o(E,"SelectMenuComponent");var $e={};k($e,{assertReturnOfBuilder:()=>A,validateDefaultPermission:()=>Ee,validateDescription:()=>pe,validateMaxChoicesLength:()=>Be,validateMaxOptionsLength:()=>h,validateName:()=>ae,validateRequired:()=>le,validateRequiredParameters:()=>x});var se=It(require("@sindresorhus/is")),z=require("zod"),Gt=z.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function ae(t){Gt.parse(t)}o(ae,"validateName");var zt=z.z.string().min(1).max(100);function pe(t){zt.parse(t)}o(pe,"validateDescription");var Xe=z.z.unknown().array().max(25);function h(t){Xe.parse(t)}o(h,"validateMaxOptionsLength");function x(t,e,n){ae(t),pe(e),h(n)}o(x,"validateRequiredParameters");var Ye=z.z.boolean();function Ee(t){Ye.parse(t)}o(Ee,"validateDefaultPermission");function le(t){Ye.parse(t)}o(le,"validateRequired");function Be(t){Xe.parse(t)}o(Be,"validateMaxChoicesLength");function A(t,e){let n=e.name;if(se.default.nullOrUndefined(t))throw new TypeError(`Expected to receive a ${n} builder, got ${t===null?"null":"undefined"} instead.`);if(se.default.primitive(t))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof t}) instead.`);if(!(t instanceof e)){let r=t,a=se.default.function_(t)?t.name:r.constructor.name,v=Reflect.get(r,Symbol.toStringTag),L=v?`${a} [${v}]`:a;throw new TypeError(`Expected to receive a ${n} builder, got ${L} instead.`)}}o(A,"assertReturnOfBuilder");var At=require("ts-mixer");var et=require("discord-api-types/v9");var b=class{constructor(){i(this,"name");i(this,"description")}setName(e){return ae(e),Reflect.set(this,"name",e),this}setDescription(e){return pe(e),Reflect.set(this,"description",e),this}};o(b,"SharedNameAndDescription");var p=class extends b{constructor(){super(...arguments);i(this,"required",!1)}setRequired(e){return le(e),Reflect.set(this,"required",e),this}runRequiredValidations(){x(this.name,this.description,[]),le(this.required)}};o(p,"ApplicationCommandOptionBase");var W=class extends p{constructor(){super(...arguments);i(this,"type",et.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(W,"SlashCommandBooleanOption");var tt=require("discord-api-types/v9"),ot=require("ts-mixer");var u=require("discord-api-types/v9"),Ve=require("zod"),Wt=[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],Zt=Ve.z.union(Wt.map(t=>Ve.z.literal(t))),me=class{constructor(){i(this,"channel_types")}addChannelType(e){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Zt.parse(e),this.channel_types.push(e),this}addChannelTypes(e){return e.forEach(n=>this.addChannelType(n)),this}};o(me,"ApplicationCommandOptionChannelTypesMixin");var S=class extends p{constructor(){super(...arguments);i(this,"type",tt.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(S,"SlashCommandChannelOption"),S=m([(0,ot.mix)(me)],S);var st=require("discord-api-types/v9"),at=require("ts-mixer"),pt=require("zod");var B=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(B,"ApplicationCommandNumericOptionMinMaxValueMixin");var it=require("discord-api-types/v9"),$=require("zod");var de=$.z.string().min(1).max(100),nt=$.z.number().gt(-1/0).lt(1/0),rt=$.z.tuple([de,$.z.union([de,nt])]).array(),Kt=$.z.boolean(),y=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoice(e,n){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),Be(this.choices),de.parse(e),this.type===it.ApplicationCommandOptionType.String?de.parse(n):nt.parse(n),this.choices.push({name:e,value:n}),this}addChoices(e){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");rt.parse(e);for(let[n,r]of e)this.addChoice(n,r);return this}setChoices(e){if(e.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");rt.parse(e),Reflect.set(this,"choices",[]);for(let[n,r]of e)this.addChoice(n,r);return this}setAutocomplete(e){if(Kt.parse(e),e&&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",e),this}};o(y,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var lt=pt.z.number().int().nonnegative(),P=class extends p{constructor(){super(...arguments);i(this,"type",st.ApplicationCommandOptionType.Integer)}setMaxValue(e){return lt.parse(e),Reflect.set(this,"max_value",e),this}setMinValue(e){return lt.parse(e),Reflect.set(this,"min_value",e),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(P,"SlashCommandIntegerOption"),P=m([(0,at.mix)(B,y)],P);var mt=require("discord-api-types/v9");var Z=class extends p{constructor(){super(...arguments);i(this,"type",mt.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Z,"SlashCommandMentionableOption");var dt=require("discord-api-types/v9"),ut=require("ts-mixer"),ct=require("zod");var ht=ct.z.number().nonnegative(),I=class extends p{constructor(){super(...arguments);i(this,"type",dt.ApplicationCommandOptionType.Number)}setMaxValue(e){return ht.parse(e),Reflect.set(this,"max_value",e),this}setMinValue(e){return ht.parse(e),Reflect.set(this,"min_value",e),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(I,"SlashCommandNumberOption"),I=m([(0,ut.mix)(B,y)],I);var bt=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",bt.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandRoleOption");var ft=require("discord-api-types/v9"),Ct=require("ts-mixer");var T=class extends p{constructor(){super(...arguments);i(this,"type",ft.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(T,"SlashCommandStringOption"),T=m([(0,Ct.mix)(y)],T);var xt=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",xt.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandUserOption");var V=class{constructor(){i(this,"options")}addBooleanOption(e){return this._sharedAddOptionMethod(e,W)}addUserOption(e){return this._sharedAddOptionMethod(e,Q)}addChannelOption(e){return this._sharedAddOptionMethod(e,S)}addRoleOption(e){return this._sharedAddOptionMethod(e,K)}addMentionableOption(e){return this._sharedAddOptionMethod(e,Z)}addStringOption(e){return this._sharedAddOptionMethod(e,T)}addIntegerOption(e){return this._sharedAddOptionMethod(e,P)}addNumberOption(e){return this._sharedAddOptionMethod(e,I)}_sharedAddOptionMethod(e,n){let{options:r}=this;h(r);let a=typeof e=="function"?e(new n):e;return A(a,n),r.push(a),this}};o(V,"SharedSlashCommandOptions");var _e=require("discord-api-types/v9"),Le=require("ts-mixer");var g=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(e){let{options:n}=this;h(n);let r=typeof e=="function"?e(new c):e;return A(r,c),n.push(r),this}toJSON(){return x(this.name,this.description,this.options),{type:_e.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};o(g,"SlashCommandSubcommandGroupBuilder"),g=m([(0,Le.mix)(b)],g);var c=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return x(this.name,this.description,this.options),{type:_e.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};o(c,"SlashCommandSubcommandBuilder"),c=m([(0,Le.mix)(b,V)],c);var H=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return x(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(e=>e.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(e){return Ee(e),Reflect.set(this,"defaultPermission",e),this}addSubcommandGroup(e){let{options:n}=this;h(n);let r=typeof e=="function"?e(new g):e;return A(r,g),n.push(r),this}addSubcommand(e){let{options:n}=this;h(n);let r=typeof e=="function"?e(new c):e;return A(r,c),n.push(r),this}};o(H,"SlashCommandBuilder"),H=m([(0,At.mix)(V,b)],H);var Fe={};k(Fe,{validateDefaultPermission:()=>De,validateName:()=>ue,validateRequiredParameters:()=>Je,validateType:()=>ce});var _=require("zod"),ke=require("discord-api-types/v9"),Qt=_.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),Ht=_.z.union([_.z.literal(ke.ApplicationCommandType.User),_.z.literal(ke.ApplicationCommandType.Message)]),Xt=_.z.boolean();function De(t){Xt.parse(t)}o(De,"validateDefaultPermission");function ue(t){Qt.parse(t)}o(ue,"validateName");function ce(t){Ht.parse(t)}o(ce,"validateType");function Je(t,e){ue(t),ce(e)}o(Je,"validateRequiredParameters");var je=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(e){return ue(e),Reflect.set(this,"name",e),this}setType(e){return ce(e),Reflect.set(this,"type",e),this}setDefaultPermission(e){return De(e),Reflect.set(this,"defaultPermission",e),this}toJSON(){return Je(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(je,"ContextMenuCommandBuilder");function Yt(t){return t!==null&&typeof t=="object"&&"toJSON"in t}o(Yt,"isJSONEncodable");module.exports=Tt(eo);0&&(module.exports={ActionRow,ButtonComponent,ComponentAssertions,ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SelectMenuComponent,SelectMenuOption,SlashCommandAssertions,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,UnsafeButtonComponent,UnsafeEmbed,UnsafeSelectMenuComponent,UnsafeSelectMenuOption,blockQuote,bold,channelMention,codeBlock,createComponent,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,isJSONEncodable,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
//# sourceMappingURL=index.js.map
{
"name": "@discordjs/builders",
"version": "0.13.0-dev.1644106034.d8184f9",
"version": "0.13.0-dev.1644235495.b936103",
"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