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
1206
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.11.0 to 0.12.0

CHANGELOG.md

336

dist/index.d.ts

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

import { APIEmbedField, APIEmbed, APIEmbedThumbnail, APIEmbedImage, APIEmbedVideo, APIEmbedAuthor, APIEmbedProvider, APIEmbedFooter, 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, 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 { z } from 'zod';

@@ -45,32 +45,32 @@ import { Snowflake } from 'discord-api-types/globals';

declare const Assertions$2_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$2_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$2_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$2_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$2_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$2_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$2_validateFieldLength: typeof validateFieldLength;
declare const Assertions$2_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$2_urlPredicate: typeof urlPredicate;
declare const Assertions$2_colorPredicate: typeof colorPredicate;
declare const Assertions$2_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$2_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$2_timestampPredicate: typeof timestampPredicate;
declare const Assertions$2_titlePredicate: typeof titlePredicate;
declare namespace Assertions$2 {
declare const Assertions$3_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$3_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$3_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$3_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$3_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$3_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$3_validateFieldLength: typeof validateFieldLength;
declare const Assertions$3_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$3_urlPredicate: typeof urlPredicate;
declare const Assertions$3_colorPredicate: typeof colorPredicate;
declare const Assertions$3_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$3_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$3_timestampPredicate: typeof timestampPredicate;
declare const Assertions$3_titlePredicate: typeof titlePredicate;
declare namespace Assertions$3 {
export {
Assertions$2_fieldNamePredicate as fieldNamePredicate,
Assertions$2_fieldValuePredicate as fieldValuePredicate,
Assertions$2_fieldInlinePredicate as fieldInlinePredicate,
Assertions$2_embedFieldPredicate as embedFieldPredicate,
Assertions$2_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
Assertions$2_fieldLengthPredicate as fieldLengthPredicate,
Assertions$2_validateFieldLength as validateFieldLength,
Assertions$2_authorNamePredicate as authorNamePredicate,
Assertions$2_urlPredicate as urlPredicate,
Assertions$2_colorPredicate as colorPredicate,
Assertions$2_descriptionPredicate as descriptionPredicate,
Assertions$2_footerTextPredicate as footerTextPredicate,
Assertions$2_timestampPredicate as timestampPredicate,
Assertions$2_titlePredicate as titlePredicate,
Assertions$3_fieldNamePredicate as fieldNamePredicate,
Assertions$3_fieldValuePredicate as fieldValuePredicate,
Assertions$3_fieldInlinePredicate as fieldInlinePredicate,
Assertions$3_embedFieldPredicate as embedFieldPredicate,
Assertions$3_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
Assertions$3_fieldLengthPredicate as fieldLengthPredicate,
Assertions$3_validateFieldLength as validateFieldLength,
Assertions$3_authorNamePredicate as authorNamePredicate,
Assertions$3_urlPredicate as urlPredicate,
Assertions$3_colorPredicate as colorPredicate,
Assertions$3_descriptionPredicate as descriptionPredicate,
Assertions$3_footerTextPredicate as footerTextPredicate,
Assertions$3_timestampPredicate as timestampPredicate,
Assertions$3_titlePredicate as titlePredicate,
};

@@ -452,2 +452,242 @@ }

/**
* Represents an option within a select menu component
*/
declare class SelectMenuOption {
readonly label: string;
readonly value: string;
readonly description?: string;
readonly emoji?: APIMessageComponentEmoji;
readonly default?: boolean;
constructor(data?: APISelectMenuOption);
/**
* Sets the label of this option
* @param label The label to show on this option
*/
setLabel(label: string): this;
/**
* Sets the value of this option
* @param value The value of this option
*/
setValue(value: string): this;
/**
* Sets the description of this option.
* @param description The description of this option
*/
setDescription(description: string): this;
/**
* Sets whether this option is selected by default
* @param isDefault Whether or not this option is selected by default
*/
setDefault(isDefault: boolean): this;
/**
* Sets the emoji to display on this button
* @param emoji The emoji to display on this button
*/
setEmoji(emoji: APIMessageComponentEmoji): this;
toJSON(): APISelectMenuOption;
}
declare const customIdValidator: z.ZodString;
declare const emojiValidator: 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;
}>;
declare const disabledValidator: z.ZodBoolean;
declare const buttonLabelValidator: z.ZodString;
declare const buttonStyleValidator: z.ZodNumber;
declare const placeholderValidator: z.ZodString;
declare const minMaxValidator: z.ZodNumber;
declare const optionsValidator: z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "atleastone">;
declare function validateRequiredSelectMenuParameters(options: SelectMenuOption[], customId?: string): void;
declare const labelValueValidator: z.ZodString;
declare const defaultValidator: z.ZodBoolean;
declare function validateRequiredSelectMenuOptionParameters(label?: string, value?: string): void;
declare const urlValidator: z.ZodString;
declare function validateRequiredButtonParameters(style: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, url?: string): void;
declare const Assertions$2_customIdValidator: typeof customIdValidator;
declare const Assertions$2_emojiValidator: typeof emojiValidator;
declare const Assertions$2_disabledValidator: typeof disabledValidator;
declare const Assertions$2_buttonLabelValidator: typeof buttonLabelValidator;
declare const Assertions$2_buttonStyleValidator: typeof buttonStyleValidator;
declare const Assertions$2_placeholderValidator: typeof placeholderValidator;
declare const Assertions$2_minMaxValidator: typeof minMaxValidator;
declare const Assertions$2_optionsValidator: typeof optionsValidator;
declare const Assertions$2_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
declare const Assertions$2_labelValueValidator: typeof labelValueValidator;
declare const Assertions$2_defaultValidator: typeof defaultValidator;
declare const Assertions$2_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
declare const Assertions$2_urlValidator: typeof urlValidator;
declare const Assertions$2_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
declare namespace Assertions$2 {
export {
Assertions$2_customIdValidator as customIdValidator,
Assertions$2_emojiValidator as emojiValidator,
Assertions$2_disabledValidator as disabledValidator,
Assertions$2_buttonLabelValidator as buttonLabelValidator,
Assertions$2_buttonStyleValidator as buttonStyleValidator,
Assertions$2_placeholderValidator as placeholderValidator,
Assertions$2_minMaxValidator as minMaxValidator,
Assertions$2_optionsValidator as optionsValidator,
Assertions$2_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters,
Assertions$2_labelValueValidator as labelValueValidator,
Assertions$2_defaultValidator as defaultValidator,
Assertions$2_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters,
Assertions$2_urlValidator as urlValidator,
Assertions$2_validateRequiredButtonParameters as validateRequiredButtonParameters,
};
}
/**
* Represents a discord component
*/
interface Component {
/**
* The type of this component
*/
readonly type: ComponentType;
/**
* Converts this component to an API-compatible JSON object
*/
toJSON: () => APIMessageComponent;
}
declare type ActionRowComponent = ButtonComponent | SelectMenuComponent;
/**
* Represents an action row component
*/
declare class ActionRow<T extends ActionRowComponent> implements Component {
readonly components: T[];
readonly type = ComponentType.ActionRow;
constructor(data?: APIActionRowComponent);
/**
* Adds components to this action row.
* @param components The components to add to this action row.
* @returns
*/
addComponents(...components: T[]): this;
/**
* Sets the components in this action row
* @param components The components to set this row to
*/
setComponents(components: T[]): this;
toJSON(): APIActionRowComponent;
}
declare class ButtonComponent implements Component {
readonly type: ComponentType.Button;
readonly style: ButtonStyle;
readonly label?: string;
readonly emoji?: APIMessageComponentEmoji;
readonly disabled?: boolean;
readonly custom_id: string;
readonly url: string;
constructor(data?: APIButtonComponent);
/**
* Sets the style of this button
* @param style The style of the button
*/
setStyle(style: ButtonStyle): this;
/**
* Sets the URL for this button
* @param url The URL to open when this button is clicked
*/
setURL(url: string): this;
/**
* Sets the custom Id for this button
* @param customId The custom ID to use for this button
*/
setCustomId(customId: string): this;
/**
* Sets the emoji to display on this button
* @param emoji The emoji to display on this button
*/
setEmoji(emoji: APIMessageComponentEmoji): this;
/**
* Sets whether this button is disable or not
* @param disabled Whether or not to disable this button or not
*/
setDisabled(disabled: boolean): this;
/**
* Sets the label for this button
* @param label The label to display on this button
*/
setLabel(label: string): this;
toJSON(): APIButtonComponent;
}
interface MappedComponentTypes {
[ComponentType.ActionRow]: ActionRow<ActionRowComponent>;
[ComponentType.Button]: ButtonComponent;
[ComponentType.SelectMenu]: SelectMenuComponent;
}
/**
* Factory for creating components from API data
* @param data The api data to transform to a component class
*/
declare function createComponent<T extends keyof MappedComponentTypes>(data: APIMessageComponent & {
type: T;
}): MappedComponentTypes[T];
/**
* Represents a select menu component
*/
declare class SelectMenuComponent implements Component {
readonly type: ComponentType.SelectMenu;
readonly options: SelectMenuOption[];
readonly placeholder?: string;
readonly min_values?: number;
readonly max_values?: number;
readonly custom_id: string;
readonly disabled?: boolean;
constructor(data?: APISelectMenuComponent);
/**
* Sets the placeholder for this select menu
* @param placeholder The placeholder to use for this select menu
*/
setPlaceholder(placeholder: string): this;
/**
* Sets thes minimum values that must be selected in the select menu
* @param minValues The minimum values that must be selected
*/
setMinValues(minValues: number): this;
/**
* Sets thes maximum values that must be selected in the select menu
* @param minValues The maximum values that must be selected
*/
setMaxValues(maxValues: number): this;
/**
* Sets the custom Id for this select menu
* @param customId The custom ID to use for this select menu
*/
setCustomId(customId: string): this;
/**
* Sets whether or not this select menu is disabled
* @param disabled Whether or not this select menu is disabled
*/
setDisabled(disabled: boolean): this;
/**
* Adds options to this select menu
* @param options The options to add to this select menu
* @returns
*/
addOptions(...options: SelectMenuOption[]): this;
/**
* Sets the options on this select menu
* @param options The options to set on this select menu
*/
setOptions(options: SelectMenuOption[]): this;
toJSON(): APISelectMenuComponent;
}
declare class SharedNameAndDescription {

@@ -472,3 +712,3 @@ readonly name: string;

abstract readonly type: ApplicationCommandOptionType;
readonly required = false;
readonly required: boolean;
/**

@@ -515,4 +755,4 @@ * Marks the option as required

declare abstract class ApplicationCommandNumericOptionMinMaxValueMixin {
protected readonly maxValue?: number;
protected readonly minValue?: number;
readonly max_value?: number;
readonly min_value?: number;
/**

@@ -651,3 +891,3 @@ * Sets the maximum number value of this option

*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
* For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups
*/

@@ -680,3 +920,3 @@ declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {

*
* For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups
* For more information, go to https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups
*/

@@ -756,11 +996,11 @@ declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {

interface ToAPIApplicationCommandOptions {
toJSON(): APIApplicationCommandOption;
toJSON: () => APIApplicationCommandOption;
}
declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
declare function validateName$1(name: unknown): asserts name is string;
declare function validateDescription(description: unknown): asserts description is string;
declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
declare function validateDefaultPermission$1(value: unknown): asserts value is boolean;
declare function validateRequired(required: unknown): asserts required is boolean;
declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[];
declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void;

@@ -770,4 +1010,4 @@ declare function assertReturnOfBuilder<T extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;

declare const Assertions$1_validateDescription: typeof validateDescription;
declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
declare const Assertions$1_validateRequired: typeof validateRequired;
declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
declare const Assertions$1_validateMaxChoicesLength: typeof validateMaxChoicesLength;

@@ -777,8 +1017,8 @@ declare const Assertions$1_assertReturnOfBuilder: typeof assertReturnOfBuilder;

export {
validateRequiredParameters$1 as validateRequiredParameters,
validateName$1 as validateName,
Assertions$1_validateDescription as validateDescription,
Assertions$1_validateMaxOptionsLength as validateMaxOptionsLength,
validateRequiredParameters$1 as validateRequiredParameters,
validateDefaultPermission$1 as validateDefaultPermission,
Assertions$1_validateRequired as validateRequired,
Assertions$1_validateMaxOptionsLength as validateMaxOptionsLength,
Assertions$1_validateMaxChoicesLength as validateMaxChoicesLength,

@@ -835,20 +1075,20 @@ Assertions$1_assertReturnOfBuilder as assertReturnOfBuilder,

declare function validateRequiredParameters(name: string, type: number): void;
declare function validateDefaultPermission(value: unknown): asserts value is boolean;
declare function validateName(name: unknown): asserts name is string;
declare function validateType(type: unknown): asserts type is ContextMenuCommandType;
declare function validateDefaultPermission(value: unknown): asserts value is boolean;
declare function validateRequiredParameters(name: string, type: number): void;
declare const Assertions_validateRequiredParameters: typeof validateRequiredParameters;
declare const Assertions_validateDefaultPermission: typeof validateDefaultPermission;
declare const Assertions_validateName: typeof validateName;
declare const Assertions_validateType: typeof validateType;
declare const Assertions_validateDefaultPermission: typeof validateDefaultPermission;
declare const Assertions_validateRequiredParameters: typeof validateRequiredParameters;
declare namespace Assertions {
export {
Assertions_validateRequiredParameters as validateRequiredParameters,
Assertions_validateDefaultPermission as validateDefaultPermission,
Assertions_validateName as validateName,
Assertions_validateType as validateType,
Assertions_validateDefaultPermission as validateDefaultPermission,
Assertions_validateRequiredParameters as validateRequiredParameters,
};
}
export { AuthorOptions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$2 as EmbedAssertions, Faces, FooterOptions, Assertions$1 as SlashCommandAssertions, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, blockQuote, bold, channelMention, codeBlock, 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, MappedComponentTypes, SelectMenuComponent, SelectMenuOption, Assertions$1 as SlashCommandAssertions, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, blockQuote, bold, channelMention, codeBlock, createComponent, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, italic, memberNicknameMention, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };

4

dist/index.js

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

var Ge=Object.create;var O=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var ze=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var je=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ce=t=>O(t,"__esModule",{value:!0});var w=(t,e)=>{for(var i in e)O(t,i,{get:e[i],enumerable:!0})},fe=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qe(e))!We.call(t,r)&&(i||r!=="default")&&O(t,r,{get:()=>e[r],enumerable:!(o=he(e,r))||o.enumerable});return t},Ze=(t,e)=>fe(Ce(O(t!=null?Ge(ze(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Ke=(t=>(e,i)=>t&&t.get(e)||(i=fe(Ce({}),e,1),t&&t.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0),p=(t,e,i,o)=>{for(var r=o>1?void 0:o?he(e,i):e,A=t.length-1,R;A>=0;A--)(R=t[A])&&(r=(o?R(e,i,r):R(r))||r);return o&&r&&O(e,i,r),r};var n=(t,e,i)=>(je(t,typeof e!="symbol"?e+"":e,i),i);var yt={};w(yt,{ContextMenuCommandAssertions:()=>ue,ContextMenuCommandBuilder:()=>Je,Embed:()=>M,EmbedAssertions:()=>ie,Faces:()=>Ae,SlashCommandAssertions:()=>re,SlashCommandBooleanOption:()=>J,SlashCommandBuilder:()=>j,SlashCommandChannelOption:()=>y,SlashCommandIntegerOption:()=>P,SlashCommandMentionableOption:()=>q,SlashCommandNumberOption:()=>T,SlashCommandRoleOption:()=>z,SlashCommandStringOption:()=>I,SlashCommandSubcommandBuilder:()=>c,SlashCommandSubcommandGroupBuilder:()=>x,SlashCommandUserOption:()=>W,TimestampStyles:()=>ut,blockQuote:()=>nt,bold:()=>Ye,channelMention:()=>mt,codeBlock:()=>Qe,formatEmoji:()=>dt,hideLinkEmbed:()=>ot,hyperlink:()=>rt,inlineCode:()=>He,italic:()=>Xe,memberNicknameMention:()=>pt,quote:()=>it,roleMention:()=>lt,spoiler:()=>at,strikethrough:()=>tt,time:()=>ct,underscore:()=>et,userMention:()=>st});var ie={};w(ie,{authorNamePredicate:()=>Q,colorPredicate:()=>H,descriptionPredicate:()=>X,embedFieldPredicate:()=>be,embedFieldsArrayPredicate:()=>_,fieldInlinePredicate:()=>k,fieldLengthPredicate:()=>xe,fieldNamePredicate:()=>S,fieldValuePredicate:()=>E,footerTextPredicate:()=>Y,timestampPredicate:()=>ee,titlePredicate:()=>te,urlPredicate:()=>u,validateFieldLength:()=>L});var m=require("zod"),S=m.z.string().min(1).max(256),E=m.z.string().min(1).max(1024),k=m.z.boolean().optional(),be=m.z.object({name:S,value:E,inline:k}),_=be.array(),xe=m.z.number().lte(25);function L(t,e){xe.parse(t.length+e)}var Q=S.nullable(),u=m.z.string().url().nullish(),H=m.z.number().gte(0).lte(16777215).nullable(),X=m.z.string().min(1).max(4096).nullable(),Y=m.z.string().min(1).max(2048).nullable(),ee=m.z.union([m.z.number(),m.z.date()]).nullable(),te=S.nullable();var M=class{constructor(e={}){n(this,"fields");n(this,"title");n(this,"description");n(this,"url");n(this,"color");n(this,"timestamp");n(this,"thumbnail");n(this,"image");n(this,"video");n(this,"author");n(this,"provider");n(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,i)=>e+i.name.length+i.value.length,0)+(this.footer?.text.length??0)+(this.author?.name.length??0)}addField(e){return this.addFields(e)}addFields(...e){return _.parse(e),L(this.fields,e.length),this.fields.push(...M.normalizeFields(...e)),this}spliceFields(e,i,...o){return _.parse(o),L(this.fields,o.length-i),this.fields.splice(e,i,...M.normalizeFields(...o)),this}setAuthor(e){if(e===null)return this.author=void 0,this;let{name:i,iconURL:o,url:r}=e;return Q.parse(i),u.parse(o),u.parse(r),this.author={name:i,url:r,icon_url:o},this}setColor(e){return H.parse(e),this.color=e??void 0,this}setDescription(e){return X.parse(e),this.description=e??void 0,this}setFooter(e){if(e===null)return this.footer=void 0,this;let{text:i,iconURL:o}=e;return Y.parse(i),u.parse(o),this.footer={text:i,icon_url:o},this}setImage(e){return u.parse(e),this.image=e?{url:e}:void 0,this}setThumbnail(e){return u.parse(e),this.thumbnail=e?{url:e}:void 0,this}setTimestamp(e=Date.now()){return ee.parse(e),this.timestamp=e?new Date(e).toISOString():void 0,this}setTitle(e){return te.parse(e),this.title=e??void 0,this}setURL(e){return u.parse(e),this.url=e??void 0,this}toJSON(){return{...this}}static normalizeFields(...e){return e.flat(1/0).map(i=>(S.parse(i.name),E.parse(i.value),k.parse(i.inline),{name:i.name,value:i.value,inline:i.inline??void 0}))}};function Qe(t,e){return typeof e=="undefined"?`\`\`\`
var bt=Object.create;var O=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var ft=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var At=(t,e,i)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var ke=t=>O(t,"__esModule",{value:!0});var B=(t,e)=>{for(var i in e)O(t,i,{get:e[i],enumerable:!0})},De=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ct(e))!xt.call(t,a)&&(i||a!=="default")&&O(t,a,{get:()=>e[a],enumerable:!(n=Le(e,a))||n.enumerable});return t},yt=(t,e)=>De(ke(O(t!=null?bt(ft(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Ot=(t=>(e,i)=>t&&t.get(e)||(i=De(ke({}),e,1),t&&t.set(e,i),i))(typeof WeakMap!="undefined"?new WeakMap:0),m=(t,e,i,n)=>{for(var a=n>1?void 0:n?Le(e,i):e,y=t.length-1,w;y>=0;y--)(w=t[y])&&(a=(n?w(e,i,a):w(a))||a);return n&&a&&O(e,i,a),a};var o=(t,e,i)=>(At(t,typeof e!="symbol"?e+"":e,i),i);var Zt={};B(Zt,{ActionRow:()=>z,ButtonComponent:()=>W,ComponentAssertions:()=>Pe,ContextMenuCommandAssertions:()=>Ve,ContextMenuCommandBuilder:()=>ht,Embed:()=>N,EmbedAssertions:()=>be,Faces:()=>je,SelectMenuComponent:()=>Z,SelectMenuOption:()=>Q,SlashCommandAssertions:()=>Re,SlashCommandBooleanOption:()=>te,SlashCommandBuilder:()=>ae,SlashCommandChannelOption:()=>P,SlashCommandIntegerOption:()=>I,SlashCommandMentionableOption:()=>ie,SlashCommandNumberOption:()=>M,SlashCommandRoleOption:()=>ne,SlashCommandStringOption:()=>R,SlashCommandSubcommandBuilder:()=>u,SlashCommandSubcommandGroupBuilder:()=>A,SlashCommandUserOption:()=>re,TimestampStyles:()=>Dt,blockQuote:()=>vt,bold:()=>Tt,channelMention:()=>_t,codeBlock:()=>St,createComponent:()=>Te,formatEmoji:()=>Lt,hideLinkEmbed:()=>wt,hyperlink:()=>Bt,inlineCode:()=>gt,italic:()=>Pt,memberNicknameMention:()=>Et,quote:()=>Rt,roleMention:()=>Vt,spoiler:()=>Nt,strikethrough:()=>Mt,time:()=>kt,underscore:()=>It,userMention:()=>$t});var be={};B(be,{authorNamePredicate:()=>me,colorPredicate:()=>le,descriptionPredicate:()=>de,embedFieldPredicate:()=>Ue,embedFieldsArrayPredicate:()=>J,fieldInlinePredicate:()=>U,fieldLengthPredicate:()=>Je,fieldNamePredicate:()=>S,fieldValuePredicate:()=>D,footerTextPredicate:()=>ce,timestampPredicate:()=>ue,titlePredicate:()=>he,urlPredicate:()=>h,validateFieldLength:()=>j});var l=require("zod"),S=l.z.string().min(1).max(256),D=l.z.string().min(1).max(1024),U=l.z.boolean().optional(),Ue=l.z.object({name:S,value:D,inline:U}),J=Ue.array(),Je=l.z.number().lte(25);function j(t,e){Je.parse(t.length+e)}var me=S.nullable(),h=l.z.string().url().nullish(),le=l.z.number().gte(0).lte(16777215).nullable(),de=l.z.string().min(1).max(4096).nullable(),ce=l.z.string().min(1).max(2048).nullable(),ue=l.z.union([l.z.number(),l.z.date()]).nullable(),he=S.nullable();var N=class{constructor(e={}){o(this,"fields");o(this,"title");o(this,"description");o(this,"url");o(this,"color");o(this,"timestamp");o(this,"thumbnail");o(this,"image");o(this,"video");o(this,"author");o(this,"provider");o(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,i)=>e+i.name.length+i.value.length,0)+(this.footer?.text.length??0)+(this.author?.name.length??0)}addField(e){return this.addFields(e)}addFields(...e){return J.parse(e),j(this.fields,e.length),this.fields.push(...N.normalizeFields(...e)),this}spliceFields(e,i,...n){return J.parse(n),j(this.fields,n.length-i),this.fields.splice(e,i,...N.normalizeFields(...n)),this}setAuthor(e){if(e===null)return this.author=void 0,this;let{name:i,iconURL:n,url:a}=e;return me.parse(i),h.parse(n),h.parse(a),this.author={name:i,url:a,icon_url:n},this}setColor(e){return le.parse(e),this.color=e??void 0,this}setDescription(e){return de.parse(e),this.description=e??void 0,this}setFooter(e){if(e===null)return this.footer=void 0,this;let{text:i,iconURL:n}=e;return ce.parse(i),h.parse(n),this.footer={text:i,icon_url:n},this}setImage(e){return h.parse(e),this.image=e?{url:e}:void 0,this}setThumbnail(e){return h.parse(e),this.thumbnail=e?{url:e}:void 0,this}setTimestamp(e=Date.now()){return ue.parse(e),this.timestamp=e?new Date(e).toISOString():void 0,this}setTitle(e){return he.parse(e),this.title=e??void 0,this}setURL(e){return h.parse(e),this.url=e??void 0,this}toJSON(){return{...this}}static normalizeFields(...e){return e.flat(1/0).map(i=>(S.parse(i.name),D.parse(i.value),U.parse(i.inline),{name:i.name,value:i.value,inline:i.inline??void 0}))}};function St(t,e){return typeof e=="undefined"?`\`\`\`
${t}\`\`\``:`\`\`\`${t}
${e}\`\`\``}function He(t){return`\`${t}\``}function Xe(t){return`_${t}_`}function Ye(t){return`**${t}**`}function et(t){return`__${t}__`}function tt(t){return`~~${t}~~`}function it(t){return`> ${t}`}function nt(t){return`>>> ${t}`}function ot(t){return`<${t}>`}function rt(t,e,i){return i?`[${t}](${e} "${i}")`:`[${t}](${e})`}function at(t){return`||${t}||`}function st(t){return`<@${t}>`}function pt(t){return`<@!${t}>`}function mt(t){return`<#${t}>`}function lt(t){return`<@&${t}>`}function dt(t,e=!1){return`<${e?"a":""}:_:${t}>`}function ct(t,e){return typeof t!="number"&&(t=Math.floor((t?.getTime()??Date.now())/1e3)),typeof e=="string"?`<t:${t}:${e}>`:`<t:${t}>`}var ut={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Ae=(o=>(o.Shrug="\xAF\\_(\u30C4)\\_/\xAF",o.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",o.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",o))(Ae||{});var re={};w(re,{assertReturnOfBuilder:()=>C,validateDefaultPermission:()=>ne,validateDescription:()=>D,validateMaxChoicesLength:()=>oe,validateMaxOptionsLength:()=>d,validateName:()=>U,validateRequired:()=>F,validateRequiredParameters:()=>h});var V=Ze(require("@sindresorhus/is")),v=require("zod");function h(t,e,i){U(t),D(e),d(i)}var ht=v.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function U(t){ht.parse(t)}var Ct=v.z.string().min(1).max(100);function D(t){Ct.parse(t)}var Oe=v.z.boolean();function ne(t){Oe.parse(t)}function F(t){Oe.parse(t)}var Se=v.z.unknown().array().max(25);function d(t){Se.parse(t)}function oe(t){Se.parse(t)}function C(t,e){let i=e.name;if(V.default.nullOrUndefined(t))throw new TypeError(`Expected to receive a ${i} builder, got ${t===null?"null":"undefined"} instead.`);if(V.default.primitive(t))throw new TypeError(`Expected to receive a ${i} builder, got a primitive (${typeof t}) instead.`);if(!(t instanceof e)){let o=t,r=V.default.function_(t)?t.name:o.constructor.name,A=Reflect.get(o,Symbol.toStringTag),R=A?`${r} [${A}]`:r;throw new TypeError(`Expected to receive a ${i} builder, got ${R} instead.`)}}var Fe=require("ts-mixer");var ye=require("discord-api-types/v9");var f=class{constructor(){n(this,"name");n(this,"description")}setName(e){return U(e),Reflect.set(this,"name",e),this}setDescription(e){return D(e),Reflect.set(this,"description",e),this}};var s=class extends f{constructor(){super(...arguments);n(this,"required",!1)}setRequired(e){return F(e),Reflect.set(this,"required",e),this}runRequiredValidations(){h(this.name,this.description,[]),F(this.required)}};var J=class extends s{constructor(){super(...arguments);n(this,"type",ye.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};var ge=require("discord-api-types/v9"),Pe=require("ts-mixer");var l=require("discord-api-types/v9"),ae=require("zod"),ft=[l.ChannelType.GuildText,l.ChannelType.GuildVoice,l.ChannelType.GuildCategory,l.ChannelType.GuildNews,l.ChannelType.GuildStore,l.ChannelType.GuildNewsThread,l.ChannelType.GuildPublicThread,l.ChannelType.GuildPrivateThread,l.ChannelType.GuildStageVoice],bt=ae.z.union(ft.map(t=>ae.z.literal(t))),se=class{constructor(){n(this,"channel_types")}addChannelType(e){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),bt.parse(e),this.channel_types.push(e),this}addChannelTypes(e){return e.forEach(i=>this.addChannelType(i)),this}};var y=class extends s{constructor(){super(...arguments);n(this,"type",ge.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};y=p([(0,Pe.mix)(se)],y);var Re=require("discord-api-types/v9"),Me=require("ts-mixer"),ve=require("zod");var N=class{constructor(){n(this,"maxValue");n(this,"minValue")}};var Te=require("discord-api-types/v9"),g=require("zod");var G=g.z.string().min(1).max(100),Ie=g.z.number().gt(-1/0).lt(1/0),$e=g.z.tuple([G,g.z.union([G,Ie])]).array(),xt=g.z.boolean(),b=class{constructor(){n(this,"choices");n(this,"autocomplete");n(this,"type")}addChoice(e,i){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),oe(this.choices),G.parse(e),this.type===Te.ApplicationCommandOptionType.String?G.parse(i):Ie.parse(i),this.choices.push({name:e,value:i}),this}addChoices(e){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");$e.parse(e);for(let[i,o]of e)this.addChoice(i,o);return this}setChoices(e){if(e.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");$e.parse(e),Reflect.set(this,"choices",[]);for(let[i,o]of e)this.addChoice(i,o);return this}setAutocomplete(e){if(xt.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}};var Ne=ve.z.number().int().nonnegative(),P=class extends s{constructor(){super(...arguments);n(this,"type",Re.ApplicationCommandOptionType.Integer)}setMaxValue(e){return Ne.parse(e),Reflect.set(this,"maxValue",e),this}setMinValue(e){return Ne.parse(e),Reflect.set(this,"minValue",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}}};P=p([(0,Me.mix)(N,b)],P);var Be=require("discord-api-types/v9");var q=class extends s{constructor(){super(...arguments);n(this,"type",Be.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};var we=require("discord-api-types/v9"),Ee=require("ts-mixer"),ke=require("zod");var _e=ke.z.number().nonnegative(),T=class extends s{constructor(){super(...arguments);n(this,"type",we.ApplicationCommandOptionType.Number)}setMaxValue(e){return _e.parse(e),Reflect.set(this,"maxValue",e),this}setMinValue(e){return _e.parse(e),Reflect.set(this,"minValue",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}}};T=p([(0,Ee.mix)(N,b)],T);var Le=require("discord-api-types/v9");var z=class extends s{constructor(){super(...arguments);n(this,"type",Le.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};var Ve=require("discord-api-types/v9"),Ue=require("ts-mixer");var I=class extends s{constructor(){super(...arguments);n(this,"type",Ve.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}}};I=p([(0,Ue.mix)(b)],I);var De=require("discord-api-types/v9");var W=class extends s{constructor(){super(...arguments);n(this,"type",De.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};var B=class{constructor(){n(this,"options")}addBooleanOption(e){return this._sharedAddOptionMethod(e,J)}addUserOption(e){return this._sharedAddOptionMethod(e,W)}addChannelOption(e){return this._sharedAddOptionMethod(e,y)}addRoleOption(e){return this._sharedAddOptionMethod(e,z)}addMentionableOption(e){return this._sharedAddOptionMethod(e,q)}addStringOption(e){return this._sharedAddOptionMethod(e,I)}addIntegerOption(e){return this._sharedAddOptionMethod(e,P)}addNumberOption(e){return this._sharedAddOptionMethod(e,T)}_sharedAddOptionMethod(e,i){let{options:o}=this;d(o);let r=typeof e=="function"?e(new i):e;return C(r,i),o.push(r),this}};var pe=require("discord-api-types/v9"),me=require("ts-mixer");var x=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[])}addSubcommand(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new c):e;return C(o,c),i.push(o),this}toJSON(){return h(this.name,this.description,this.options),{type:pe.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};x=p([(0,me.mix)(f)],x);var c=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[])}toJSON(){return h(this.name,this.description,this.options),{type:pe.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};c=p([(0,me.mix)(f,B)],c);var j=class{constructor(){n(this,"name");n(this,"description");n(this,"options",[]);n(this,"defaultPermission")}toJSON(){return h(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 ne(e),Reflect.set(this,"defaultPermission",e),this}addSubcommandGroup(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new x):e;return C(o,x),i.push(o),this}addSubcommand(e){let{options:i}=this;d(i);let o=typeof e=="function"?e(new c):e;return C(o,c),i.push(o),this}};j=p([(0,Fe.mix)(B,f)],j);var ue={};w(ue,{validateDefaultPermission:()=>ce,validateName:()=>Z,validateRequiredParameters:()=>de,validateType:()=>K});var $=require("zod"),le=require("discord-api-types/v9");function de(t,e){Z(t),K(e)}var At=$.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u);function Z(t){At.parse(t)}var Ot=$.z.union([$.z.literal(le.ApplicationCommandType.User),$.z.literal(le.ApplicationCommandType.Message)]);function K(t){Ot.parse(t)}var St=$.z.boolean();function ce(t){St.parse(t)}var Je=class{constructor(){n(this,"name");n(this,"type");n(this,"defaultPermission")}setName(e){return Z(e),Reflect.set(this,"name",e),this}setType(e){return K(e),Reflect.set(this,"type",e),this}setDefaultPermission(e){return ce(e),Reflect.set(this,"defaultPermission",e),this}toJSON(){return de(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};module.exports=Ke(yt);0&&(module.exports={ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SlashCommandAssertions,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,blockQuote,bold,channelMention,codeBlock,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
${e}\`\`\``}function gt(t){return`\`${t}\``}function Pt(t){return`_${t}_`}function Tt(t){return`**${t}**`}function It(t){return`__${t}__`}function Mt(t){return`~~${t}~~`}function Rt(t){return`> ${t}`}function vt(t){return`>>> ${t}`}function wt(t){return`<${t}>`}function Bt(t,e,i){return i?`[${t}](${e} "${i}")`:`[${t}](${e})`}function Nt(t){return`||${t}||`}function $t(t){return`<@${t}>`}function Et(t){return`<@!${t}>`}function _t(t){return`<#${t}>`}function Vt(t){return`<@&${t}>`}function Lt(t,e=!1){return`<${e?"a":""}:_:${t}>`}function kt(t,e){return typeof t!="number"&&(t=Math.floor((t?.getTime()??Date.now())/1e3)),typeof e=="string"?`<t:${t}:${e}>`:`<t:${t}>`}var Dt={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},je=(n=>(n.Shrug="\xAF\\_(\u30C4)\\_/\xAF",n.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",n.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",n))(je||{});var Pe={};B(Pe,{buttonLabelValidator:()=>Ce,buttonStyleValidator:()=>fe,customIdValidator:()=>g,defaultValidator:()=>ye,disabledValidator:()=>E,emojiValidator:()=>$,labelValueValidator:()=>_,minMaxValidator:()=>F,optionsValidator:()=>qe,placeholderValidator:()=>xe,urlValidator:()=>Se,validateRequiredButtonParameters:()=>ge,validateRequiredSelectMenuOptionParameters:()=>Oe,validateRequiredSelectMenuParameters:()=>Ae});var q=require("discord-api-types/v9"),p=require("zod"),g=p.z.string().min(1).max(100),$=p.z.object({id:p.z.string(),name:p.z.string(),animated:p.z.boolean()}).partial().strict(),E=p.z.boolean(),Ce=p.z.string().nonempty().max(80),fe=p.z.number().int().min(q.ButtonStyle.Primary).max(q.ButtonStyle.Link),xe=p.z.string().max(100),F=p.z.number().int().min(0).max(25),qe=p.z.object({}).array().nonempty();function Ae(t,e){g.parse(e),qe.parse(t)}var _=p.z.string().min(1).max(100),ye=p.z.boolean();function Oe(t,e){_.parse(t),_.parse(e)}var Se=p.z.string().url();function ge(t,e,i,n,a){if(a&&n)throw new RangeError("URL and custom id are mutually exclusive");if(!e&&!i)throw new RangeError("Buttons must have a label and/or an emoji");if(t===q.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")}var Fe=require("discord-api-types/v9");var G=require("discord-api-types/v9");function Te(t){switch(t.type){case G.ComponentType.ActionRow:return new z(t);case G.ComponentType.Button:return new W(t);case G.ComponentType.SelectMenu:return new Z(t);default:throw new Error(`Cannot serialize component type: ${t.type}`)}}var z=class{constructor(e){o(this,"components",[]);o(this,"type",Fe.ComponentType.ActionRow);this.components=e?.components.map(Te)??[]}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())}}};var K=require("discord-api-types/v9");var W=class{constructor(e){o(this,"type",K.ComponentType.Button);o(this,"style");o(this,"label");o(this,"emoji");o(this,"disabled");o(this,"custom_id");o(this,"url");this.style=e?.style,this.label=e?.label,this.emoji=e?.emoji,this.disabled=e?.disabled,e?.style===K.ButtonStyle.Link?this.url=e.url:this.custom_id=e?.custom_id}setStyle(e){return fe.parse(e),Reflect.set(this,"style",e),this}setURL(e){return Se.parse(e),Reflect.set(this,"url",e),this}setCustomId(e){return g.parse(e),Reflect.set(this,"custom_id",e),this}setEmoji(e){return $.parse(e),Reflect.set(this,"emoji",e),this}setDisabled(e){return E.parse(e),Reflect.set(this,"disabled",e),this}setLabel(e){return Ce.parse(e),Reflect.set(this,"label",e),this}toJSON(){return ge(this.style,this.label,this.emoji,this.custom_id,this.url),{...this}}};var Ge=require("discord-api-types/v9");var Q=class{constructor(e){o(this,"label");o(this,"value");o(this,"description");o(this,"emoji");o(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 _.parse(e),Reflect.set(this,"description",e),this}setDefault(e){return ye.parse(e),Reflect.set(this,"default",e),this}setEmoji(e){return $.parse(e),Reflect.set(this,"emoji",e),this}toJSON(){return Oe(this.label,this.value),{...this}}};var Z=class{constructor(e){o(this,"type",Ge.ComponentType.SelectMenu);o(this,"options");o(this,"placeholder");o(this,"min_values");o(this,"max_values");o(this,"custom_id");o(this,"disabled");this.options=e?.options.map(i=>new Q(i))??[],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 xe.parse(e),Reflect.set(this,"placeholder",e),this}setMinValues(e){return F.parse(e),Reflect.set(this,"min_values",e),this}setMaxValues(e){return F.parse(e),Reflect.set(this,"max_values",e),this}setCustomId(e){return g.parse(e),Reflect.set(this,"custom_id",e),this}setDisabled(e){return E.parse(e),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 Ae(this.options,this.custom_id),{...this,options:this.options.map(e=>e.toJSON())}}};var Re={};B(Re,{assertReturnOfBuilder:()=>C,validateDefaultPermission:()=>Ie,validateDescription:()=>Y,validateMaxChoicesLength:()=>Me,validateMaxOptionsLength:()=>c,validateName:()=>X,validateRequired:()=>ee,validateRequiredParameters:()=>b});var H=yt(require("@sindresorhus/is")),V=require("zod"),Ut=V.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function X(t){Ut.parse(t)}var Jt=V.z.string().min(1).max(100);function Y(t){Jt.parse(t)}var ze=V.z.unknown().array().max(25);function c(t){ze.parse(t)}function b(t,e,i){X(t),Y(e),c(i)}var We=V.z.boolean();function Ie(t){We.parse(t)}function ee(t){We.parse(t)}function Me(t){ze.parse(t)}function C(t,e){let i=e.name;if(H.default.nullOrUndefined(t))throw new TypeError(`Expected to receive a ${i} builder, got ${t===null?"null":"undefined"} instead.`);if(H.default.primitive(t))throw new TypeError(`Expected to receive a ${i} builder, got a primitive (${typeof t}) instead.`);if(!(t instanceof e)){let n=t,a=H.default.function_(t)?t.name:n.constructor.name,y=Reflect.get(n,Symbol.toStringTag),w=y?`${a} [${y}]`:a;throw new TypeError(`Expected to receive a ${i} builder, got ${w} instead.`)}}var ut=require("ts-mixer");var Ze=require("discord-api-types/v9");var f=class{constructor(){o(this,"name");o(this,"description")}setName(e){return X(e),Reflect.set(this,"name",e),this}setDescription(e){return Y(e),Reflect.set(this,"description",e),this}};var s=class extends f{constructor(){super(...arguments);o(this,"required",!1)}setRequired(e){return ee(e),Reflect.set(this,"required",e),this}runRequiredValidations(){b(this.name,this.description,[]),ee(this.required)}};var te=class extends s{constructor(){super(...arguments);o(this,"type",Ze.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};var Ke=require("discord-api-types/v9"),Qe=require("ts-mixer");var d=require("discord-api-types/v9"),ve=require("zod"),jt=[d.ChannelType.GuildText,d.ChannelType.GuildVoice,d.ChannelType.GuildCategory,d.ChannelType.GuildNews,d.ChannelType.GuildStore,d.ChannelType.GuildNewsThread,d.ChannelType.GuildPublicThread,d.ChannelType.GuildPrivateThread,d.ChannelType.GuildStageVoice],qt=ve.z.union(jt.map(t=>ve.z.literal(t))),we=class{constructor(){o(this,"channel_types")}addChannelType(e){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),qt.parse(e),this.channel_types.push(e),this}addChannelTypes(e){return e.forEach(i=>this.addChannelType(i)),this}};var P=class extends s{constructor(){super(...arguments);o(this,"type",Ke.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};P=m([(0,Qe.mix)(we)],P);var et=require("discord-api-types/v9"),tt=require("ts-mixer"),ot=require("zod");var L=class{constructor(){o(this,"max_value");o(this,"min_value")}};var He=require("discord-api-types/v9"),T=require("zod");var oe=T.z.string().min(1).max(100),Xe=T.z.number().gt(-1/0).lt(1/0),Ye=T.z.tuple([oe,T.z.union([oe,Xe])]).array(),Ft=T.z.boolean(),x=class{constructor(){o(this,"choices");o(this,"autocomplete");o(this,"type")}addChoice(e,i){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),Me(this.choices),oe.parse(e),this.type===He.ApplicationCommandOptionType.String?oe.parse(i):Xe.parse(i),this.choices.push({name:e,value:i}),this}addChoices(e){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");Ye.parse(e);for(let[i,n]of e)this.addChoice(i,n);return this}setChoices(e){if(e.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");Ye.parse(e),Reflect.set(this,"choices",[]);for(let[i,n]of e)this.addChoice(i,n);return this}setAutocomplete(e){if(Ft.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}};var it=ot.z.number().int().nonnegative(),I=class extends s{constructor(){super(...arguments);o(this,"type",et.ApplicationCommandOptionType.Integer)}setMaxValue(e){return it.parse(e),Reflect.set(this,"max_value",e),this}setMinValue(e){return it.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}}};I=m([(0,tt.mix)(L,x)],I);var nt=require("discord-api-types/v9");var ie=class extends s{constructor(){super(...arguments);o(this,"type",nt.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};var rt=require("discord-api-types/v9"),at=require("ts-mixer"),st=require("zod");var pt=st.z.number().nonnegative(),M=class extends s{constructor(){super(...arguments);o(this,"type",rt.ApplicationCommandOptionType.Number)}setMaxValue(e){return pt.parse(e),Reflect.set(this,"max_value",e),this}setMinValue(e){return pt.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}}};M=m([(0,at.mix)(L,x)],M);var mt=require("discord-api-types/v9");var ne=class extends s{constructor(){super(...arguments);o(this,"type",mt.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};var lt=require("discord-api-types/v9"),dt=require("ts-mixer");var R=class extends s{constructor(){super(...arguments);o(this,"type",lt.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}}};R=m([(0,dt.mix)(x)],R);var ct=require("discord-api-types/v9");var re=class extends s{constructor(){super(...arguments);o(this,"type",ct.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};var k=class{constructor(){o(this,"options")}addBooleanOption(e){return this._sharedAddOptionMethod(e,te)}addUserOption(e){return this._sharedAddOptionMethod(e,re)}addChannelOption(e){return this._sharedAddOptionMethod(e,P)}addRoleOption(e){return this._sharedAddOptionMethod(e,ne)}addMentionableOption(e){return this._sharedAddOptionMethod(e,ie)}addStringOption(e){return this._sharedAddOptionMethod(e,R)}addIntegerOption(e){return this._sharedAddOptionMethod(e,I)}addNumberOption(e){return this._sharedAddOptionMethod(e,M)}_sharedAddOptionMethod(e,i){let{options:n}=this;c(n);let a=typeof e=="function"?e(new i):e;return C(a,i),n.push(a),this}};var Be=require("discord-api-types/v9"),Ne=require("ts-mixer");var A=class{constructor(){o(this,"name");o(this,"description");o(this,"options",[])}addSubcommand(e){let{options:i}=this;c(i);let n=typeof e=="function"?e(new u):e;return C(n,u),i.push(n),this}toJSON(){return b(this.name,this.description,this.options),{type:Be.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};A=m([(0,Ne.mix)(f)],A);var u=class{constructor(){o(this,"name");o(this,"description");o(this,"options",[])}toJSON(){return b(this.name,this.description,this.options),{type:Be.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(e=>e.toJSON())}}};u=m([(0,Ne.mix)(f,k)],u);var ae=class{constructor(){o(this,"name");o(this,"description");o(this,"options",[]);o(this,"defaultPermission")}toJSON(){return b(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 Ie(e),Reflect.set(this,"defaultPermission",e),this}addSubcommandGroup(e){let{options:i}=this;c(i);let n=typeof e=="function"?e(new A):e;return C(n,A),i.push(n),this}addSubcommand(e){let{options:i}=this;c(i);let n=typeof e=="function"?e(new u):e;return C(n,u),i.push(n),this}};ae=m([(0,ut.mix)(k,f)],ae);var Ve={};B(Ve,{validateDefaultPermission:()=>Ee,validateName:()=>se,validateRequiredParameters:()=>_e,validateType:()=>pe});var v=require("zod"),$e=require("discord-api-types/v9"),Gt=v.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),zt=v.z.union([v.z.literal($e.ApplicationCommandType.User),v.z.literal($e.ApplicationCommandType.Message)]),Wt=v.z.boolean();function Ee(t){Wt.parse(t)}function se(t){Gt.parse(t)}function pe(t){zt.parse(t)}function _e(t,e){se(t),pe(e)}var ht=class{constructor(){o(this,"name");o(this,"type");o(this,"defaultPermission")}setName(e){return se(e),Reflect.set(this,"name",e),this}setType(e){return pe(e),Reflect.set(this,"type",e),this}setDefaultPermission(e){return Ee(e),Reflect.set(this,"defaultPermission",e),this}toJSON(){return _e(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};module.exports=Ot(Zt);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,blockQuote,bold,channelMention,codeBlock,createComponent,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
//# sourceMappingURL=index.js.map
{
"name": "@discordjs/builders",
"version": "0.11.0",
"version": "0.12.0",
"description": "A set of builders that you can use when creating your bot",
"scripts": {
"pretest": "npm run build",
"build": "tsup",
"test": "jest --pass-with-no-tests",
"test:ci": "jest --no-stack-trace --verbose --pass-with-no-tests",
"prebuild": "npm run lint",
"build": "tsup",
"lint": "eslint src --ext mjs,js,ts",
"lint:fix": "eslint src --ext mjs,js,ts --fix",
"format": "prettier --write **/*.{ts,js,json,yml,yaml}",
"prepare": "is-ci || husky install",
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
"docs": "typedoc --json docs/typedoc-out.json src/index.ts && node scripts/docs.mjs",
"prepublishOnly": "npm run lint && npm run test",
"release": "standard-version --preset angular"
"prepublishOnly": "yarn build && yarn lint && yarn test",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'"
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"typings": "./dist/index.d.ts",
"types": "./dist/index.d.ts",
"exports": {

@@ -37,3 +32,4 @@ "import": "./dist/index.mjs",

"Amish Shah <amishshah.2k@gmail.com>",
"SpaceEEC <spaceeec@yahoo.com>"
"SpaceEEC <spaceeec@yahoo.com>",
"Antonio Roman <kyradiscord@gmail.com>"
],

@@ -52,11 +48,11 @@ "license": "Apache-2.0",

"type": "git",
"url": "https://github.com/discordjs/builders.git"
"url": "https://github.com/discordjs/discord.js.git"
},
"bugs": {
"url": "https://github.com/discordjs/builders/issues"
"url": "https://github.com/discordjs/discord.js/issues"
},
"homepage": "https://github.com/discordjs/builders",
"homepage": "https://discord.js.org",
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"discord-api-types": "^0.26.0",
"@sindresorhus/is": "^4.3.0",
"discord-api-types": "^0.26.1",
"ts-mixer": "^6.0.0",

@@ -67,31 +63,25 @@ "tslib": "^2.3.1",

"devDependencies": {
"@babel/core": "^7.16.5",
"@babel/core": "^7.16.12",
"@babel/plugin-proposal-decorators": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.5",
"@commitlint/cli": "^15.0.0",
"@commitlint/config-angular": "^15.0.0",
"@discordjs/ts-docgen": "^0.3.4",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.6",
"@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"eslint": "^8.5.0",
"eslint-config-marine": "^9.1.0",
"eslint": "^8.7.0",
"eslint-config-marine": "^9.3.2",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"is-ci": "^3.0.1",
"jest": "^27.4.5",
"lint-staged": "^12.1.4",
"jest": "^27.4.7",
"prettier": "^2.5.1",
"standard-version": "^9.3.2",
"tsup": "^5.11.8",
"typedoc": "^0.22.10",
"typescript": "^4.5.4"
"tsup": "^5.11.11",
"typedoc": "^0.22.11",
"typescript": "^4.5.5"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
"node": ">=16.9.0"
},

@@ -98,0 +88,0 @@ "publishConfig": {

@@ -11,3 +11,3 @@ <div align="center">

<a href="https://www.npmjs.com/package/@discordjs/builders"><img src="https://img.shields.io/npm/dt/@discordjs/builders.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/discordjs/builders/actions"><img src="https://github.com/discordjs/builders/workflows/Tests/badge.svg" alt="Build status" /></a>
<a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/test.yml/badge.svg" alt="Build status" /></a>
<a href="https://codecov.io/gh/discordjs/builders"><img src="https://codecov.io/gh/discordjs/builders/branch/main/graph/badge.svg" alt="Code coverage" /></a>

@@ -19,3 +19,3 @@ </p>

**Node.js 16.6.0 or newer is required.**
**Node.js 16.9.0 or newer is required.**

@@ -42,3 +42,3 @@ ```sh-session

- [Discord API Discord server](https://discord.gg/discord-api)
- [GitHub](https://github.com/discordjs/builders)
- [GitHub](https://github.com/discordjs/discord.js/tree/main/packages/builders)
- [npm](https://www.npmjs.com/package/@discordjs/builders)

@@ -51,3 +51,3 @@ - [Related libraries](https://discord.com/developers/docs/topics/community-resources#libraries)

[documentation](https://discord.js.org/#/docs/builders).
See [the contribution guide](https://github.com/discordjs/builders/blob/main/.github/CONTRIBUTING.md) if you'd like to submit a PR.
See [the contribution guide](https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md) if you'd like to submit a PR.

@@ -54,0 +54,0 @@ ## Help

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