@discordjs/builders 0.13.0-dev.1644969969.c1b27f8 → 0.13.0-dev.1645402064.78aa36f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +43 -32
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_api_types_v9 from 'discord-api-types/v9';
|
|
2
|
-
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APIEmbedVideo, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, APIBaseComponent, ComponentType, APIMessageComponent, APIActionRowComponent, APIButtonComponent, APISelectMenuComponent, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandAttachmentOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
|
|
2
|
+
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APIEmbedVideo, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, APIBaseComponent, ComponentType, APIMessageComponent, APIActionRowComponentTypes, APIActionRowComponent, APIButtonComponent, APISelectMenuComponent, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandAttachmentOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { Snowflake } from 'discord-api-types/globals';
|
|
5
5
|
import { URL } from 'url';
|
|
@@ -37,7 +37,8 @@ declare const fieldLengthPredicate: z.ZodNumber;
|
|
|
37
37
|
declare function validateFieldLength(amountAdding: number, fields?: APIEmbedField[]): void;
|
|
38
38
|
declare const authorNamePredicate: z.ZodNullable<z.ZodString>;
|
|
39
39
|
declare const urlPredicate: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
40
|
-
declare const
|
|
40
|
+
declare const RGBPredicate: z.ZodNumber;
|
|
41
|
+
declare const colorPredicate: z.ZodUnion<[z.ZodNullable<z.ZodNumber>, z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>]>;
|
|
41
42
|
declare const descriptionPredicate: z.ZodNullable<z.ZodString>;
|
|
42
43
|
declare const footerTextPredicate: z.ZodNullable<z.ZodString>;
|
|
43
44
|
declare const timestampPredicate: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
@@ -52,6 +53,7 @@ declare const Assertions$3_fieldLengthPredicate: typeof fieldLengthPredicate;
|
|
|
52
53
|
declare const Assertions$3_validateFieldLength: typeof validateFieldLength;
|
|
53
54
|
declare const Assertions$3_authorNamePredicate: typeof authorNamePredicate;
|
|
54
55
|
declare const Assertions$3_urlPredicate: typeof urlPredicate;
|
|
56
|
+
declare const Assertions$3_RGBPredicate: typeof RGBPredicate;
|
|
55
57
|
declare const Assertions$3_colorPredicate: typeof colorPredicate;
|
|
56
58
|
declare const Assertions$3_descriptionPredicate: typeof descriptionPredicate;
|
|
57
59
|
declare const Assertions$3_footerTextPredicate: typeof footerTextPredicate;
|
|
@@ -68,6 +70,7 @@ declare namespace Assertions$3 {
|
|
|
68
70
|
Assertions$3_validateFieldLength as validateFieldLength,
|
|
69
71
|
Assertions$3_authorNamePredicate as authorNamePredicate,
|
|
70
72
|
Assertions$3_urlPredicate as urlPredicate,
|
|
73
|
+
Assertions$3_RGBPredicate as RGBPredicate,
|
|
71
74
|
Assertions$3_colorPredicate as colorPredicate,
|
|
72
75
|
Assertions$3_descriptionPredicate as descriptionPredicate,
|
|
73
76
|
Assertions$3_footerTextPredicate as footerTextPredicate,
|
|
@@ -76,6 +79,14 @@ declare namespace Assertions$3 {
|
|
|
76
79
|
};
|
|
77
80
|
}
|
|
78
81
|
|
|
82
|
+
interface Equatable<T> {
|
|
83
|
+
/**
|
|
84
|
+
* Whether or not this is equal to another structure
|
|
85
|
+
*/
|
|
86
|
+
equals: (other: T) => boolean;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare type RGBTuple = [red: number, green: number, blue: number];
|
|
79
90
|
interface IconData {
|
|
80
91
|
/**
|
|
81
92
|
* The URL of the icon
|
|
@@ -99,8 +110,8 @@ interface EmbedImageData extends Omit<APIEmbedImage, 'proxy_url'> {
|
|
|
99
110
|
/**
|
|
100
111
|
* Represents a non-validated embed in a message (image/video preview, rich embed, etc.)
|
|
101
112
|
*/
|
|
102
|
-
declare class UnsafeEmbed {
|
|
103
|
-
|
|
113
|
+
declare class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> {
|
|
114
|
+
readonly data: APIEmbed;
|
|
104
115
|
constructor(data?: APIEmbed);
|
|
105
116
|
/**
|
|
106
117
|
* An array of fields of this embed
|
|
@@ -154,6 +165,10 @@ declare class UnsafeEmbed {
|
|
|
154
165
|
* The accumulated length for the embed title, description, fields, footer text, and author name
|
|
155
166
|
*/
|
|
156
167
|
get length(): number;
|
|
168
|
+
/**
|
|
169
|
+
* The hex color of the current color of the embed
|
|
170
|
+
*/
|
|
171
|
+
get hexColor(): string | undefined;
|
|
157
172
|
/**
|
|
158
173
|
* Adds a field to the embed (max 25)
|
|
159
174
|
*
|
|
@@ -190,7 +205,7 @@ declare class UnsafeEmbed {
|
|
|
190
205
|
*
|
|
191
206
|
* @param color The color of the embed
|
|
192
207
|
*/
|
|
193
|
-
setColor(color: number | null): this;
|
|
208
|
+
setColor(color: number | RGBTuple | null): this;
|
|
194
209
|
/**
|
|
195
210
|
* Sets the description of this embed
|
|
196
211
|
*
|
|
@@ -237,12 +252,7 @@ declare class UnsafeEmbed {
|
|
|
237
252
|
* Transforms the embed to a plain object
|
|
238
253
|
*/
|
|
239
254
|
toJSON(): APIEmbed;
|
|
240
|
-
|
|
241
|
-
* Normalizes field input and resolves strings
|
|
242
|
-
*
|
|
243
|
-
* @param fields Fields to normalize
|
|
244
|
-
*/
|
|
245
|
-
static normalizeFields(...fields: APIEmbedField[]): APIEmbedField[];
|
|
255
|
+
equals(other: UnsafeEmbed | APIEmbed): boolean;
|
|
246
256
|
}
|
|
247
257
|
|
|
248
258
|
/**
|
|
@@ -252,7 +262,7 @@ declare class Embed extends UnsafeEmbed {
|
|
|
252
262
|
addFields(...fields: APIEmbedField[]): this;
|
|
253
263
|
spliceFields(index: number, deleteCount: number, ...fields: APIEmbedField[]): this;
|
|
254
264
|
setAuthor(options: EmbedAuthorOptions | null): this;
|
|
255
|
-
setColor(color: number | null): this;
|
|
265
|
+
setColor(color: number | RGBTuple | null): this;
|
|
256
266
|
setDescription(description: string | null): this;
|
|
257
267
|
setFooter(options: EmbedFooterOptions | null): this;
|
|
258
268
|
setImage(url: string | null): this;
|
|
@@ -260,12 +270,6 @@ declare class Embed extends UnsafeEmbed {
|
|
|
260
270
|
setTimestamp(timestamp?: number | Date | null): this;
|
|
261
271
|
setTitle(title: string | null): this;
|
|
262
272
|
setURL(url: string | null): this;
|
|
263
|
-
/**
|
|
264
|
-
* Normalizes field input and resolves strings
|
|
265
|
-
*
|
|
266
|
-
* @param fields Fields to normalize
|
|
267
|
-
*/
|
|
268
|
-
static normalizeFields(...fields: APIEmbedField[]): APIEmbedField[];
|
|
269
273
|
}
|
|
270
274
|
|
|
271
275
|
/**
|
|
@@ -534,7 +538,7 @@ declare class UnsafeSelectMenuOption {
|
|
|
534
538
|
* Sets whether this option is selected by default
|
|
535
539
|
* @param isDefault Whether this option is selected by default
|
|
536
540
|
*/
|
|
537
|
-
setDefault(isDefault
|
|
541
|
+
setDefault(isDefault?: boolean): this;
|
|
538
542
|
/**
|
|
539
543
|
* Sets the emoji to display on this button
|
|
540
544
|
* @param emoji The emoji to display on this button
|
|
@@ -548,7 +552,7 @@ declare class UnsafeSelectMenuOption {
|
|
|
548
552
|
*/
|
|
549
553
|
declare class SelectMenuOption extends UnsafeSelectMenuOption {
|
|
550
554
|
setDescription(description: string): this;
|
|
551
|
-
setDefault(isDefault
|
|
555
|
+
setDefault(isDefault?: boolean): this;
|
|
552
556
|
setEmoji(emoji: APIMessageComponentEmoji): this;
|
|
553
557
|
toJSON(): APISelectMenuOption;
|
|
554
558
|
}
|
|
@@ -630,15 +634,13 @@ declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSO
|
|
|
630
634
|
*/
|
|
631
635
|
declare abstract class Component<DataType extends Partial<APIBaseComponent<ComponentType>> & {
|
|
632
636
|
type: ComponentType;
|
|
633
|
-
} = APIBaseComponent<ComponentType>> implements JSONEncodable<APIMessageComponent> {
|
|
637
|
+
} = APIBaseComponent<ComponentType>> implements JSONEncodable<APIMessageComponent>, Equatable<Component | APIActionRowComponentTypes> {
|
|
634
638
|
/**
|
|
635
639
|
* The API data associated with this component
|
|
636
640
|
*/
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Converts this component to an API-compatible JSON object
|
|
640
|
-
*/
|
|
641
|
+
readonly data: DataType;
|
|
641
642
|
abstract toJSON(): APIMessageComponent;
|
|
643
|
+
abstract equals(other: Component | APIActionRowComponentTypes): boolean;
|
|
642
644
|
constructor(data: DataType);
|
|
643
645
|
/**
|
|
644
646
|
* The type of this component
|
|
@@ -654,6 +656,9 @@ declare type ActionRowComponent = ButtonComponent | SelectMenuComponent;
|
|
|
654
656
|
declare class ActionRow<T extends ActionRowComponent = ActionRowComponent> extends Component<Omit<Partial<APIActionRowComponent<APIMessageComponent>> & {
|
|
655
657
|
type: ComponentType.ActionRow;
|
|
656
658
|
}, 'components'>> {
|
|
659
|
+
/**
|
|
660
|
+
* The components within this action row
|
|
661
|
+
*/
|
|
657
662
|
readonly components: T[];
|
|
658
663
|
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIMessageComponent>>);
|
|
659
664
|
/**
|
|
@@ -668,6 +673,7 @@ declare class ActionRow<T extends ActionRowComponent = ActionRowComponent> exten
|
|
|
668
673
|
*/
|
|
669
674
|
setComponents(...components: T[]): this;
|
|
670
675
|
toJSON(): APIActionRowComponent<APIMessageComponent>;
|
|
676
|
+
equals(other: APIActionRowComponent<APIMessageComponent> | ActionRow): boolean;
|
|
671
677
|
}
|
|
672
678
|
|
|
673
679
|
/**
|
|
@@ -725,13 +731,14 @@ declare class UnsafeButtonComponent extends Component<Partial<APIButtonComponent
|
|
|
725
731
|
* Sets whether this button is disable or not
|
|
726
732
|
* @param disabled Whether or not to disable this button or not
|
|
727
733
|
*/
|
|
728
|
-
setDisabled(disabled
|
|
734
|
+
setDisabled(disabled?: boolean): this;
|
|
729
735
|
/**
|
|
730
736
|
* Sets the label for this button
|
|
731
737
|
* @param label The label to display on this button
|
|
732
738
|
*/
|
|
733
739
|
setLabel(label: string): this;
|
|
734
740
|
toJSON(): APIButtonComponent;
|
|
741
|
+
equals(other: APIButtonComponent | UnsafeButtonComponent): boolean;
|
|
735
742
|
}
|
|
736
743
|
|
|
737
744
|
/**
|
|
@@ -742,7 +749,7 @@ declare class ButtonComponent extends UnsafeButtonComponent {
|
|
|
742
749
|
setURL(url: string): this;
|
|
743
750
|
setCustomId(customId: string): this;
|
|
744
751
|
setEmoji(emoji: APIMessageComponentEmoji): this;
|
|
745
|
-
setDisabled(disabled
|
|
752
|
+
setDisabled(disabled?: boolean): this;
|
|
746
753
|
setLabel(label: string): this;
|
|
747
754
|
toJSON(): APIButtonComponent;
|
|
748
755
|
}
|
|
@@ -767,6 +774,9 @@ declare function createComponent<C extends MessageComponent>(data: C): C;
|
|
|
767
774
|
declare class UnsafeSelectMenuComponent extends Component<Partial<Omit<APISelectMenuComponent, 'options'>> & {
|
|
768
775
|
type: ComponentType.SelectMenu;
|
|
769
776
|
}> {
|
|
777
|
+
/**
|
|
778
|
+
* The options within this select menu
|
|
779
|
+
*/
|
|
770
780
|
readonly options: UnsafeSelectMenuOption[];
|
|
771
781
|
constructor(data?: Partial<APISelectMenuComponent>);
|
|
772
782
|
/**
|
|
@@ -813,19 +823,20 @@ declare class UnsafeSelectMenuComponent extends Component<Partial<Omit<APISelect
|
|
|
813
823
|
* Sets whether or not this select menu is disabled
|
|
814
824
|
* @param disabled Whether or not this select menu is disabled
|
|
815
825
|
*/
|
|
816
|
-
setDisabled(disabled
|
|
826
|
+
setDisabled(disabled?: boolean): this;
|
|
817
827
|
/**
|
|
818
828
|
* Adds options to this select menu
|
|
819
829
|
* @param options The options to add to this select menu
|
|
820
830
|
* @returns
|
|
821
831
|
*/
|
|
822
|
-
addOptions(...options: UnsafeSelectMenuOption[]): this;
|
|
832
|
+
addOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]): this;
|
|
823
833
|
/**
|
|
824
834
|
* Sets the options on this select menu
|
|
825
835
|
* @param options The options to set on this select menu
|
|
826
836
|
*/
|
|
827
|
-
setOptions(...options: UnsafeSelectMenuOption[]): this;
|
|
837
|
+
setOptions(...options: (UnsafeSelectMenuOption | APISelectMenuOption)[]): this;
|
|
828
838
|
toJSON(): APISelectMenuComponent;
|
|
839
|
+
equals(other: APISelectMenuComponent | UnsafeSelectMenuComponent): boolean;
|
|
829
840
|
}
|
|
830
841
|
|
|
831
842
|
/**
|
|
@@ -836,7 +847,7 @@ declare class SelectMenuComponent extends UnsafeSelectMenuComponent {
|
|
|
836
847
|
setMinValues(minValues: number): this;
|
|
837
848
|
setMaxValues(maxValues: number): this;
|
|
838
849
|
setCustomId(customId: string): this;
|
|
839
|
-
setDisabled(disabled
|
|
850
|
+
setDisabled(disabled?: boolean): this;
|
|
840
851
|
toJSON(): APISelectMenuComponent;
|
|
841
852
|
}
|
|
842
853
|
|
|
@@ -1243,4 +1254,4 @@ declare namespace Assertions {
|
|
|
1243
1254
|
};
|
|
1244
1255
|
}
|
|
1245
1256
|
|
|
1246
|
-
export { ActionRow, ActionRowComponent, ButtonComponent, Component, Assertions$2 as ComponentAssertions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$3 as EmbedAssertions, EmbedAuthorData, EmbedAuthorOptions, EmbedFooterData, EmbedFooterOptions, EmbedImageData, Faces, IconData, JSONEncodable, MappedComponentTypes, MessageComponent, SelectMenuComponent, SelectMenuOption, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, 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 };
|
|
1257
|
+
export { ActionRow, ActionRowComponent, ButtonComponent, Component, Assertions$2 as ComponentAssertions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$3 as EmbedAssertions, EmbedAuthorData, EmbedAuthorOptions, EmbedFooterData, EmbedFooterOptions, EmbedImageData, Faces, IconData, JSONEncodable, MappedComponentTypes, MessageComponent, RGBTuple, SelectMenuComponent, SelectMenuOption, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ee=Object.create;var T=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var Ne=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var De=(e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zt=e=>T(e,"__esModule",{value:!0}),o=(e,t)=>T(e,"name",{value:t,configurable:!0});var q=(e,t)=>{for(var n in t)T(e,n,{get:t[n],enumerable:!0})},Kt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Be(t))!$e.call(e,s)&&(n||s!=="default")&&T(e,s,{get:()=>t[s],enumerable:!(r=zt(t,s))||r.enumerable});return e},k=(e,t)=>Kt(Zt(T(e!=null?Ee(Ne(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Le=(e=>(t,n)=>e&&e.get(t)||(n=Kt(Zt({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0),d=(e,t,n,r)=>{for(var s=r>1?void 0:r?zt(t,n):t,A=e.length-1,I;A>=0;A--)(I=e[A])&&(s=(r?I(t,n,s):I(s))||s);return r&&s&&T(t,n,s),s};var i=(e,t,n)=>(De(e,typeof t!="symbol"?t+"":t,n),n);var lo={};q(lo,{ActionRow:()=>y,ButtonComponent:()=>D,Component:()=>b,ComponentAssertions:()=>Bt,ContextMenuCommandAssertions:()=>Gt,ContextMenuCommandBuilder:()=>Wt,Embed:()=>St,EmbedAssertions:()=>Ot,Faces:()=>ee,SelectMenuComponent:()=>L,SelectMenuOption:()=>Dt,SlashCommandAssertions:()=>Vt,SlashCommandAttachmentOption:()=>Q,SlashCommandBooleanOption:()=>z,SlashCommandBuilder:()=>X,SlashCommandChannelOption:()=>w,SlashCommandIntegerOption:()=>E,SlashCommandMentionableOption:()=>Z,SlashCommandNumberOption:()=>B,SlashCommandRoleOption:()=>K,SlashCommandStringOption:()=>N,SlashCommandSubcommandBuilder:()=>h,SlashCommandSubcommandGroupBuilder:()=>P,SlashCommandUserOption:()=>H,TimestampStyles:()=>to,UnsafeButtonComponent:()=>R,UnsafeEmbed:()=>M,UnsafeSelectMenuComponent:()=>v,UnsafeSelectMenuOption:()=>u,blockQuote:()=>Fe,bold:()=>Je,channelMention:()=>Qe,codeBlock:()=>_e,createComponent:()=>Nt,formatEmoji:()=>Xe,hideLinkEmbed:()=>Ge,hyperlink:()=>We,inlineCode:()=>Ve,isJSONEncodable:()=>mo,italic:()=>Ue,memberNicknameMention:()=>Ke,quote:()=>je,roleMention:()=>He,spoiler:()=>ze,strikethrough:()=>ke,time:()=>Ye,underscore:()=>qe,userMention:()=>Ze});var Ot={};q(Ot,{RGBPredicate:()=>ot,authorNamePredicate:()=>Ct,colorPredicate:()=>ft,descriptionPredicate:()=>At,embedFieldPredicate:()=>Xt,embedFieldsArrayPredicate:()=>tt,fieldInlinePredicate:()=>Ht,fieldLengthPredicate:()=>Yt,fieldNamePredicate:()=>Y,fieldValuePredicate:()=>Qt,footerTextPredicate:()=>xt,timestampPredicate:()=>yt,titlePredicate:()=>gt,urlPredicate:()=>x,validateFieldLength:()=>et});var m=require("zod"),Y=m.z.string().min(1).max(256),Qt=m.z.string().min(1).max(1024),Ht=m.z.boolean().optional(),Xt=m.z.object({name:Y,value:Qt,inline:Ht}),tt=Xt.array(),Yt=m.z.number().lte(25);function et(e,t){Yt.parse((t?.length??0)+e)}o(et,"validateFieldLength");var Ct=Y.nullable(),x=m.z.string().url().nullish(),ot=m.z.number().int().gte(0).lte(255),ft=m.z.number().int().gte(0).lte(16777215).nullable().or(m.z.tuple([ot,ot,ot])),At=m.z.string().min(1).max(4096).nullable(),xt=m.z.string().min(1).max(2048).nullable(),yt=m.z.union([m.z.number(),m.z.date()]).nullable(),gt=Y.nullable();var te=k(require("fast-deep-equal")),M=class{constructor(t={}){i(this,"data");this.data={...t},t.timestamp&&(this.data.timestamp=new Date(t.timestamp).toISOString())}get fields(){return this.data.fields}get title(){return this.data.title}get description(){return this.data.description}get url(){return this.data.url}get color(){return this.data.color}get timestamp(){return this.data.timestamp}get thumbnail(){if(!!this.data.thumbnail)return{url:this.data.thumbnail.url,proxyURL:this.data.thumbnail.proxy_url,height:this.data.thumbnail.height,width:this.data.thumbnail.width}}get image(){if(!!this.data.image)return{url:this.data.image.url,proxyURL:this.data.image.proxy_url,height:this.data.image.height,width:this.data.image.width}}get video(){return this.data.video}get author(){if(!!this.data.author)return{name:this.data.author.name,url:this.data.author.url,iconURL:this.data.author.icon_url,proxyIconURL:this.data.author.proxy_icon_url}}get provider(){return this.data.provider}get footer(){if(!!this.data.footer)return{text:this.data.footer.text,iconURL:this.data.footer.icon_url,proxyIconURL:this.data.footer.proxy_icon_url}}get length(){return(this.data.title?.length??0)+(this.data.description?.length??0)+(this.data.fields?.reduce((t,n)=>t+n.name.length+n.value.length,0)??0)+(this.data.footer?.text.length??0)+(this.data.author?.name.length??0)}get hexColor(){return typeof this.data.color=="number"?`#${this.data.color.toString(16).padStart(6,"0")}`:this.data.color}addField(t){return this.addFields(t)}addFields(...t){return this.data.fields?this.data.fields.push(...t):this.data.fields=t,this}spliceFields(t,n,...r){return this.data.fields?this.data.fields.splice(t,n,...r):this.data.fields=r,this}setFields(...t){return this.spliceFields(0,this.fields?.length??0,...t),this}setAuthor(t){return t===null?(this.data.author=void 0,this):(this.data.author={name:t.name,url:t.url,icon_url:t.iconURL},this)}setColor(t){if(Array.isArray(t)){let[n,r,s]=t;return this.data.color=(n<<16)+(r<<8)+s,this}return this.data.color=t??void 0,this}setDescription(t){return this.data.description=t??void 0,this}setFooter(t){return t===null?(this.data.footer=void 0,this):(this.data.footer={text:t.text,icon_url:t.iconURL},this)}setImage(t){return this.data.image=t?{url:t}:void 0,this}setThumbnail(t){return this.data.thumbnail=t?{url:t}:void 0,this}setTimestamp(t=Date.now()){return this.data.timestamp=t?new Date(t).toISOString():void 0,this}setTitle(t){return this.data.title=t??void 0,this}setURL(t){return this.data.url=t??void 0,this}toJSON(){return{...this.data}}equals(t){let{image:n,thumbnail:r,...s}=this.data,A=t instanceof M?t.data:t,{image:I,thumbnail:ve,...we}=A;return(0,te.default)(we,s)&&I?.url===n?.url&&ve?.url===r?.url}};o(M,"UnsafeEmbed");var St=class extends M{addFields(...t){return et(t.length,this.fields),super.addFields(...tt.parse(t))}spliceFields(t,n,...r){return et(r.length-n,this.fields),super.spliceFields(t,n,...tt.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(Ct.parse(t.name),x.parse(t.iconURL),x.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(ft.parse(t))}setDescription(t){return super.setDescription(At.parse(t))}setFooter(t){return t===null?super.setFooter(null):(xt.parse(t.text),x.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(x.parse(t))}setThumbnail(t){return super.setThumbnail(x.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(yt.parse(t))}setTitle(t){return super.setTitle(gt.parse(t))}setURL(t){return super.setURL(x.parse(t))}};o(St,"Embed");function _e(e,t){return typeof t=="undefined"?`\`\`\`
|
|
2
2
|
${e}\`\`\``:`\`\`\`${e}
|
|
3
|
-
${t}\`\`\``}o(we,"codeBlock");function Ee(e){return`\`${e}\``}o(Ee,"inlineCode");function Be(e){return`_${e}_`}o(Be,"italic");function Ne(e){return`**${e}**`}o(Ne,"bold");function $e(e){return`__${e}__`}o($e,"underscore");function _e(e){return`~~${e}~~`}o(_e,"strikethrough");function Le(e){return`> ${e}`}o(Le,"quote");function Ve(e){return`>>> ${e}`}o(Ve,"blockQuote");function De(e){return`<${e}>`}o(De,"hideLinkEmbed");function Ue(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(Ue,"hyperlink");function Fe(e){return`||${e}||`}o(Fe,"spoiler");function Je(e){return`<@${e}>`}o(Je,"userMention");function ke(e){return`<@!${e}>`}o(ke,"memberNicknameMention");function je(e){return`<#${e}>`}o(je,"channelMention");function qe(e){return`<@&${e}>`}o(qe,"roleMention");function Ge(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Ge,"formatEmoji");function ze(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(ze,"time");var We={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Kt=(r=>(r.Shrug="\xAF\\_(\u30C4)\\_/\xAF",r.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",r.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",r))(Kt||{});var wt={};F(wt,{buttonLabelValidator:()=>Ot,buttonStyleValidator:()=>St,customIdValidator:()=>E,defaultValidator:()=>Tt,disabledValidator:()=>k,emojiValidator:()=>J,labelValueValidator:()=>j,minMaxValidator:()=>it,optionsValidator:()=>Qt,placeholderValidator:()=>Pt,urlValidator:()=>vt,validateRequiredButtonParameters:()=>Rt,validateRequiredSelectMenuOptionParameters:()=>Mt,validateRequiredSelectMenuParameters:()=>It});var nt=require("discord-api-types/v9"),m=require("zod"),E=m.z.string().min(1).max(100),J=m.z.object({id:m.z.string(),name:m.z.string(),animated:m.z.boolean()}).partial().strict(),k=m.z.boolean(),Ot=m.z.string().nonempty().max(80),St=m.z.number().int().min(nt.ButtonStyle.Primary).max(nt.ButtonStyle.Link),Pt=m.z.string().max(100),it=m.z.number().int().min(0).max(25),Qt=m.z.object({}).array().nonempty();function It(e,t){E.parse(t),Qt.parse(e)}o(It,"validateRequiredSelectMenuParameters");var j=m.z.string().min(1).max(100),Tt=m.z.boolean();function Mt(e,t){j.parse(e),j.parse(t)}o(Mt,"validateRequiredSelectMenuOptionParameters");var vt=m.z.string().url();function Rt(e,t,n,r,s){if(s&&r)throw new RangeError("URL and custom id are mutually exclusive");if(!t&&!n)throw new RangeError("Buttons must have a label and/or an emoji");if(e===nt.ButtonStyle.Link){if(!s)throw new RangeError("Link buttons must have a url")}else if(s)throw new RangeError("Non-link buttons cannot have a url")}o(Rt,"validateRequiredButtonParameters");var Ht=require("discord-api-types/v9");var h=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(h,"Component");var rt=require("discord-api-types/v9");function Et(e){switch(e.type){case rt.ComponentType.ActionRow:return e instanceof B?e:new B(e);case rt.ComponentType.Button:return e instanceof N?e:new N(e);case rt.ComponentType.SelectMenu:return e instanceof $?e:new $(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Et,"createComponent");var B=class extends h{constructor({components:t,...n}={}){super({type:Ht.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Et(r))??[]}addComponents(...t){return this.components.push(...t),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(B,"ActionRow");var Xt=require("discord-api-types/v9");var q=class extends h{constructor(t){super({type:Xt.ComponentType.Button,...t})}get style(){return this.data.style}get label(){return this.data.label}get emoji(){return this.data.emoji}get disabled(){return this.data.disabled}get customId(){return this.data.custom_id}get url(){return this.data.url}setStyle(t){return this.data.style=t,this}setURL(t){return this.data.url=t,this}setCustomId(t){return this.data.custom_id=t,this}setEmoji(t){return this.data.emoji=t,this}setDisabled(t){return this.data.disabled=t,this}setLabel(t){return this.data.label=t,this}toJSON(){return{...this.data}}};o(q,"UnsafeButtonComponent");var N=class extends q{setStyle(t){return super.setStyle(St.parse(t))}setURL(t){return super.setURL(vt.parse(t))}setCustomId(t){return super.setCustomId(E.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}setDisabled(t){return super.setDisabled(k.parse(t))}setLabel(t){return super.setLabel(Ot.parse(t))}toJSON(){return Rt(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(N,"ButtonComponent");var Yt=require("discord-api-types/v9");var P=class{constructor(t={}){this.data=t}get label(){return this.data.label}get value(){return this.data.value}get description(){return this.data.description}get emoji(){return this.data.emoji}get default(){return this.data.default}setLabel(t){return this.data.label=t,this}setValue(t){return this.data.value=t,this}setDescription(t){return this.data.description=t,this}setDefault(t){return this.data.default=t,this}setEmoji(t){return this.data.emoji=t,this}toJSON(){return{...this.data}}};o(P,"UnsafeSelectMenuOption");var G=class extends h{constructor(t){let{options:n,...r}=t??{};super({type:Yt.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new P(s))??[]}get placeholder(){return this.data.placeholder}get maxValues(){return this.data.max_values}get minValues(){return this.data.min_values}get customId(){return this.data.custom_id}get disabled(){return this.data.disabled}setPlaceholder(t){return this.data.placeholder=t,this}setMinValues(t){return this.data.min_values=t,this}setMaxValues(t){return this.data.max_values=t,this}setCustomId(t){return this.data.custom_id=t,this}setDisabled(t){return this.data.disabled=t,this}addOptions(...t){return this.options.push(...t),this}setOptions(...t){return this.options.splice(0,this.options.length,...t),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}};o(G,"UnsafeSelectMenuComponent");var $=class extends G{setPlaceholder(t){return super.setPlaceholder(Pt.parse(t))}setMinValues(t){return super.setMinValues(it.parse(t))}setMaxValues(t){return super.setMaxValues(it.parse(t))}setCustomId(t){return super.setCustomId(E.parse(t))}setDisabled(t){return super.setDisabled(k.parse(t))}toJSON(){return It(this.options,this.customId),super.toJSON()}};o($,"SelectMenuComponent");var Bt=class extends P{setDescription(t){return super.setDescription(j.parse(t))}setDefault(t){return super.setDefault(Tt.parse(t))}setEmoji(t){return super.setEmoji(J.parse(t))}toJSON(){return Mt(this.label,this.value),super.toJSON()}};o(Bt,"SelectMenuOption");var _t={};F(_t,{assertReturnOfBuilder:()=>y,validateDefaultPermission:()=>Nt,validateDescription:()=>pt,validateMaxChoicesLength:()=>$t,validateMaxOptionsLength:()=>b,validateName:()=>st,validateRequired:()=>mt,validateRequiredParameters:()=>A});var at=ve(require("@sindresorhus/is")),z=require("zod"),Ze=z.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function st(e){Ze.parse(e)}o(st,"validateName");var Ke=z.z.string().min(1).max(100);function pt(e){Ke.parse(e)}o(pt,"validateDescription");var te=z.z.unknown().array().max(25);function b(e){te.parse(e)}o(b,"validateMaxOptionsLength");function A(e,t,n){st(e),pt(t),b(n)}o(A,"validateRequiredParameters");var ee=z.z.boolean();function Nt(e){ee.parse(e)}o(Nt,"validateDefaultPermission");function mt(e){ee.parse(e)}o(mt,"validateRequired");function $t(e){te.parse(e)}o($t,"validateMaxChoicesLength");function y(e,t){let n=t.name;if(at.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(at.default.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,s=at.default.function_(e)?e.name:r.constructor.name,R=Reflect.get(r,Symbol.toStringTag),U=R?`${s} [${R}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${U} instead.`)}}o(y,"assertReturnOfBuilder");var Oe=require("ts-mixer");var oe=require("discord-api-types/v9");var C=class{constructor(){i(this,"name");i(this,"description")}setName(t){return st(t),Reflect.set(this,"name",t),this}setDescription(t){return pt(t),Reflect.set(this,"description",t),this}};o(C,"SharedNameAndDescription");var p=class extends C{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return mt(t),Reflect.set(this,"required",t),this}runRequiredValidations(){A(this.name,this.description,[]),mt(this.required)}};o(p,"ApplicationCommandOptionBase");var W=class extends p{constructor(){super(...arguments);i(this,"type",oe.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(W,"SlashCommandBooleanOption");var ne=require("discord-api-types/v9"),ie=require("ts-mixer");var u=require("discord-api-types/v9"),Lt=require("zod"),Qe=[u.ChannelType.GuildText,u.ChannelType.GuildVoice,u.ChannelType.GuildCategory,u.ChannelType.GuildNews,u.ChannelType.GuildStore,u.ChannelType.GuildNewsThread,u.ChannelType.GuildPublicThread,u.ChannelType.GuildPrivateThread,u.ChannelType.GuildStageVoice],He=Lt.z.union(Qe.map(e=>Lt.z.literal(e))),lt=class{constructor(){i(this,"channel_types")}addChannelType(t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),He.parse(t),this.channel_types.push(t),this}addChannelTypes(t){return t.forEach(n=>this.addChannelType(n)),this}};o(lt,"ApplicationCommandOptionChannelTypesMixin");var I=class extends p{constructor(){super(...arguments);i(this,"type",ne.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(I,"SlashCommandChannelOption"),I=l([(0,ie.mix)(lt)],I);var pe=require("discord-api-types/v9"),me=require("ts-mixer"),le=require("zod");var _=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(_,"ApplicationCommandNumericOptionMinMaxValueMixin");var re=require("discord-api-types/v9"),L=require("zod");var dt=L.z.string().min(1).max(100),ae=L.z.number().gt(-1/0).lt(1/0),se=L.z.object({name:dt,value:L.z.union([dt,ae])}).array(),Xe=L.z.boolean(),g=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoice(t){let{name:n,value:r}=t;if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),$t(this.choices),dt.parse(n),this.type===re.ApplicationCommandOptionType.String?dt.parse(r):ae.parse(r),this.choices.push({name:n,value:r}),this}addChoices(...t){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");se.parse(t);for(let n of t)this.addChoice(n);return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");se.parse(t),Reflect.set(this,"choices",[]);for(let n of t)this.addChoice(n);return this}setAutocomplete(t){if(Xe.parse(t),t&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return Reflect.set(this,"autocomplete",t),this}};o(g,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var de=le.z.number().int().nonnegative(),T=class extends p{constructor(){super(...arguments);i(this,"type",pe.ApplicationCommandOptionType.Integer)}setMaxValue(t){return de.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return de.parse(t),Reflect.set(this,"min_value",t),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};o(T,"SlashCommandIntegerOption"),T=l([(0,me.mix)(_,g)],T);var ue=require("discord-api-types/v9");var Z=class extends p{constructor(){super(...arguments);i(this,"type",ue.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Z,"SlashCommandMentionableOption");var ce=require("discord-api-types/v9"),he=require("ts-mixer"),be=require("zod");var Ce=be.z.number().nonnegative(),M=class extends p{constructor(){super(...arguments);i(this,"type",ce.ApplicationCommandOptionType.Number)}setMaxValue(t){return Ce.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return Ce.parse(t),Reflect.set(this,"min_value",t),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};o(M,"SlashCommandNumberOption"),M=l([(0,he.mix)(_,g)],M);var fe=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",fe.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandRoleOption");var xe=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",xe.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandAttachmentOption");var Ae=require("discord-api-types/v9"),ye=require("ts-mixer");var v=class extends p{constructor(){super(...arguments);i(this,"type",Ae.ApplicationCommandOptionType.String)}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};o(v,"SlashCommandStringOption"),v=l([(0,ye.mix)(g)],v);var ge=require("discord-api-types/v9");var H=class extends p{constructor(){super(...arguments);i(this,"type",ge.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(H,"SlashCommandUserOption");var V=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,W)}addUserOption(t){return this._sharedAddOptionMethod(t,H)}addChannelOption(t){return this._sharedAddOptionMethod(t,I)}addRoleOption(t){return this._sharedAddOptionMethod(t,K)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,Q)}addMentionableOption(t){return this._sharedAddOptionMethod(t,Z)}addStringOption(t){return this._sharedAddOptionMethod(t,v)}addIntegerOption(t){return this._sharedAddOptionMethod(t,T)}addNumberOption(t){return this._sharedAddOptionMethod(t,M)}_sharedAddOptionMethod(t,n){let{options:r}=this;b(r);let s=typeof t=="function"?t(new n):t;return y(s,n),r.push(s),this}};o(V,"SharedSlashCommandOptions");var Vt=require("discord-api-types/v9"),Dt=require("ts-mixer");var O=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new c):t;return y(r,c),n.push(r),this}toJSON(){return A(this.name,this.description,this.options),{type:Vt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(O,"SlashCommandSubcommandGroupBuilder"),O=l([(0,Dt.mix)(C)],O);var c=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return A(this.name,this.description,this.options),{type:Vt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(c,"SlashCommandSubcommandBuilder"),c=l([(0,Dt.mix)(C,V)],c);var X=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return A(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(t=>t.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(t){return Nt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new O):t;return y(r,O),n.push(r),this}addSubcommand(t){let{options:n}=this;b(n);let r=typeof t=="function"?t(new c):t;return y(r,c),n.push(r),this}};o(X,"SlashCommandBuilder"),X=l([(0,Oe.mix)(V,C)],X);var kt={};F(kt,{validateDefaultPermission:()=>Ft,validateName:()=>ut,validateRequiredParameters:()=>Jt,validateType:()=>ct});var D=require("zod"),Ut=require("discord-api-types/v9"),Ye=D.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),to=D.z.union([D.z.literal(Ut.ApplicationCommandType.User),D.z.literal(Ut.ApplicationCommandType.Message)]),eo=D.z.boolean();function Ft(e){eo.parse(e)}o(Ft,"validateDefaultPermission");function ut(e){Ye.parse(e)}o(ut,"validateName");function ct(e){to.parse(e)}o(ct,"validateType");function Jt(e,t){ut(e),ct(t)}o(Jt,"validateRequiredParameters");var jt=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return ut(t),Reflect.set(this,"name",t),this}setType(t){return ct(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return Ft(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Jt(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(jt,"ContextMenuCommandBuilder");function oo(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(oo,"isJSONEncodable");module.exports=Re(no);0&&(module.exports={ActionRow,ButtonComponent,Component,ComponentAssertions,ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SelectMenuComponent,SelectMenuOption,SlashCommandAssertions,SlashCommandAttachmentOption,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,UnsafeButtonComponent,UnsafeEmbed,UnsafeSelectMenuComponent,UnsafeSelectMenuOption,blockQuote,bold,channelMention,codeBlock,createComponent,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,isJSONEncodable,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
|
|
3
|
+
${t}\`\`\``}o(_e,"codeBlock");function Ve(e){return`\`${e}\``}o(Ve,"inlineCode");function Ue(e){return`_${e}_`}o(Ue,"italic");function Je(e){return`**${e}**`}o(Je,"bold");function qe(e){return`__${e}__`}o(qe,"underscore");function ke(e){return`~~${e}~~`}o(ke,"strikethrough");function je(e){return`> ${e}`}o(je,"quote");function Fe(e){return`>>> ${e}`}o(Fe,"blockQuote");function Ge(e){return`<${e}>`}o(Ge,"hideLinkEmbed");function We(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(We,"hyperlink");function ze(e){return`||${e}||`}o(ze,"spoiler");function Ze(e){return`<@${e}>`}o(Ze,"userMention");function Ke(e){return`<@!${e}>`}o(Ke,"memberNicknameMention");function Qe(e){return`<#${e}>`}o(Qe,"channelMention");function He(e){return`<@&${e}>`}o(He,"roleMention");function Xe(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(Xe,"formatEmoji");function Ye(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(Ye,"time");var to={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},ee=(r=>(r.Shrug="\xAF\\_(\u30C4)\\_/\xAF",r.Tableflip="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B",r.Unflip="\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)",r))(ee||{});var Bt={};q(Bt,{buttonLabelValidator:()=>Pt,buttonStyleValidator:()=>It,customIdValidator:()=>$,defaultValidator:()=>Rt,disabledValidator:()=>F,emojiValidator:()=>j,labelValueValidator:()=>G,minMaxValidator:()=>it,optionsValidator:()=>oe,placeholderValidator:()=>Tt,urlValidator:()=>wt,validateRequiredButtonParameters:()=>Et,validateRequiredSelectMenuOptionParameters:()=>vt,validateRequiredSelectMenuParameters:()=>Mt});var nt=require("discord-api-types/v9"),l=require("zod"),$=l.z.string().min(1).max(100),j=l.z.object({id:l.z.string(),name:l.z.string(),animated:l.z.boolean()}).partial().strict(),F=l.z.boolean(),Pt=l.z.string().nonempty().max(80),It=l.z.number().int().min(nt.ButtonStyle.Primary).max(nt.ButtonStyle.Link),Tt=l.z.string().max(100),it=l.z.number().int().min(0).max(25),oe=l.z.object({}).array().nonempty();function Mt(e,t){$.parse(t),oe.parse(e)}o(Mt,"validateRequiredSelectMenuParameters");var G=l.z.string().min(1).max(100),Rt=l.z.boolean();function vt(e,t){G.parse(e),G.parse(t)}o(vt,"validateRequiredSelectMenuOptionParameters");var wt=l.z.string().url();function Et(e,t,n,r,s){if(s&&r)throw new RangeError("URL and custom id are mutually exclusive");if(!t&&!n)throw new RangeError("Buttons must have a label and/or an emoji");if(e===nt.ButtonStyle.Link){if(!s)throw new RangeError("Link buttons must have a url")}else if(s)throw new RangeError("Non-link buttons cannot have a url")}o(Et,"validateRequiredButtonParameters");var ne=require("discord-api-types/v9");var b=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(b,"Component");var rt=require("discord-api-types/v9");function Nt(e){switch(e.type){case rt.ComponentType.ActionRow:return e instanceof y?e:new y(e);case rt.ComponentType.Button:return e instanceof D?e:new D(e);case rt.ComponentType.SelectMenu:return e instanceof L?e:new L(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(Nt,"createComponent");var at=k(require("fast-deep-equal")),y=class extends b{constructor({components:t,...n}={}){super({type:ne.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>Nt(r))??[]}addComponents(...t){return this.components.push(...t),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}equals(t){return t instanceof y?(0,at.default)(t.data,this.data)&&(0,at.default)(t.components,this.components):(0,at.default)(t,{...this.data,components:this.components.map(n=>n.toJSON())})}};o(y,"ActionRow");var ie=require("discord-api-types/v9");var $t=k(require("fast-deep-equal")),R=class extends b{constructor(t){super({type:ie.ComponentType.Button,...t})}get style(){return this.data.style}get label(){return this.data.label}get emoji(){return this.data.emoji}get disabled(){return this.data.disabled}get customId(){return this.data.custom_id}get url(){return this.data.url}setStyle(t){return this.data.style=t,this}setURL(t){return this.data.url=t,this}setCustomId(t){return this.data.custom_id=t,this}setEmoji(t){return this.data.emoji=t,this}setDisabled(t=!0){return this.data.disabled=t,this}setLabel(t){return this.data.label=t,this}toJSON(){return{...this.data}}equals(t){return t instanceof R?(0,$t.default)(t.data,this.data):(0,$t.default)(t,this.data)}};o(R,"UnsafeButtonComponent");var D=class extends R{setStyle(t){return super.setStyle(It.parse(t))}setURL(t){return super.setURL(wt.parse(t))}setCustomId(t){return super.setCustomId($.parse(t))}setEmoji(t){return super.setEmoji(j.parse(t))}setDisabled(t=!0){return super.setDisabled(F.parse(t))}setLabel(t){return super.setLabel(Pt.parse(t))}toJSON(){return Et(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(D,"ButtonComponent");var re=require("discord-api-types/v9");var u=class{constructor(t={}){this.data=t}get label(){return this.data.label}get value(){return this.data.value}get description(){return this.data.description}get emoji(){return this.data.emoji}get default(){return this.data.default}setLabel(t){return this.data.label=t,this}setValue(t){return this.data.value=t,this}setDescription(t){return this.data.description=t,this}setDefault(t=!0){return this.data.default=t,this}setEmoji(t){return this.data.emoji=t,this}toJSON(){return{...this.data}}};o(u,"UnsafeSelectMenuOption");var st=k(require("fast-deep-equal")),v=class extends b{constructor(t){let{options:n,...r}=t??{};super({type:re.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new u(s))??[]}get placeholder(){return this.data.placeholder}get maxValues(){return this.data.max_values}get minValues(){return this.data.min_values}get customId(){return this.data.custom_id}get disabled(){return this.data.disabled}setPlaceholder(t){return this.data.placeholder=t,this}setMinValues(t){return this.data.min_values=t,this}setMaxValues(t){return this.data.max_values=t,this}setCustomId(t){return this.data.custom_id=t,this}setDisabled(t=!0){return this.data.disabled=t,this}addOptions(...t){return this.options.push(...t.map(n=>n instanceof u?n:new u(n))),this}setOptions(...t){return this.options.splice(0,this.options.length,...t.map(n=>n instanceof u?n:new u(n))),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}equals(t){return t instanceof v?(0,st.default)(t.data,this.data)&&(0,st.default)(t.options,this.options):(0,st.default)(t,{...this.data,options:this.options.map(n=>n.toJSON())})}};o(v,"UnsafeSelectMenuComponent");var L=class extends v{setPlaceholder(t){return super.setPlaceholder(Tt.parse(t))}setMinValues(t){return super.setMinValues(it.parse(t))}setMaxValues(t){return super.setMaxValues(it.parse(t))}setCustomId(t){return super.setCustomId($.parse(t))}setDisabled(t=!0){return super.setDisabled(F.parse(t))}toJSON(){return Mt(this.options,this.customId),super.toJSON()}};o(L,"SelectMenuComponent");var Dt=class extends u{setDescription(t){return super.setDescription(G.parse(t))}setDefault(t=!0){return super.setDefault(Rt.parse(t))}setEmoji(t){return super.setEmoji(j.parse(t))}toJSON(){return vt(this.label,this.value),super.toJSON()}};o(Dt,"SelectMenuOption");var Vt={};q(Vt,{assertReturnOfBuilder:()=>O,validateDefaultPermission:()=>Lt,validateDescription:()=>lt,validateMaxChoicesLength:()=>_t,validateMaxOptionsLength:()=>C,validateName:()=>mt,validateRequired:()=>dt,validateRequiredParameters:()=>g});var pt=k(require("@sindresorhus/is")),W=require("zod"),eo=W.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function mt(e){eo.parse(e)}o(mt,"validateName");var oo=W.z.string().min(1).max(100);function lt(e){oo.parse(e)}o(lt,"validateDescription");var ae=W.z.unknown().array().max(25);function C(e){ae.parse(e)}o(C,"validateMaxOptionsLength");function g(e,t,n){mt(e),lt(t),C(n)}o(g,"validateRequiredParameters");var se=W.z.boolean();function Lt(e){se.parse(e)}o(Lt,"validateDefaultPermission");function dt(e){se.parse(e)}o(dt,"validateRequired");function _t(e){ae.parse(e)}o(_t,"validateMaxChoicesLength");function O(e,t){let n=t.name;if(pt.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(pt.default.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,s=pt.default.function_(e)?e.name:r.constructor.name,A=Reflect.get(r,Symbol.toStringTag),I=A?`${s} [${A}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${I} instead.`)}}o(O,"assertReturnOfBuilder");var Re=require("ts-mixer");var pe=require("discord-api-types/v9");var f=class{constructor(){i(this,"name");i(this,"description")}setName(t){return mt(t),Reflect.set(this,"name",t),this}setDescription(t){return lt(t),Reflect.set(this,"description",t),this}};o(f,"SharedNameAndDescription");var p=class extends f{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return dt(t),Reflect.set(this,"required",t),this}runRequiredValidations(){g(this.name,this.description,[]),dt(this.required)}};o(p,"ApplicationCommandOptionBase");var z=class extends p{constructor(){super(...arguments);i(this,"type",pe.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(z,"SlashCommandBooleanOption");var me=require("discord-api-types/v9"),le=require("ts-mixer");var c=require("discord-api-types/v9"),Ut=require("zod"),no=[c.ChannelType.GuildText,c.ChannelType.GuildVoice,c.ChannelType.GuildCategory,c.ChannelType.GuildNews,c.ChannelType.GuildStore,c.ChannelType.GuildNewsThread,c.ChannelType.GuildPublicThread,c.ChannelType.GuildPrivateThread,c.ChannelType.GuildStageVoice],io=Ut.z.union(no.map(e=>Ut.z.literal(e))),ut=class{constructor(){i(this,"channel_types")}addChannelType(t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),io.parse(t),this.channel_types.push(t),this}addChannelTypes(t){return t.forEach(n=>this.addChannelType(n)),this}};o(ut,"ApplicationCommandOptionChannelTypesMixin");var w=class extends p{constructor(){super(...arguments);i(this,"type",me.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(w,"SlashCommandChannelOption"),w=d([(0,le.mix)(ut)],w);var he=require("discord-api-types/v9"),be=require("ts-mixer"),Ce=require("zod");var _=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(_,"ApplicationCommandNumericOptionMinMaxValueMixin");var de=require("discord-api-types/v9"),V=require("zod");var ct=V.z.string().min(1).max(100),ue=V.z.number().gt(-1/0).lt(1/0),ce=V.z.object({name:ct,value:V.z.union([ct,ue])}).array(),ro=V.z.boolean(),S=class{constructor(){i(this,"choices");i(this,"autocomplete");i(this,"type")}addChoice(t){let{name:n,value:r}=t;if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return this.choices===void 0&&Reflect.set(this,"choices",[]),_t(this.choices),ct.parse(n),this.type===de.ApplicationCommandOptionType.String?ct.parse(r):ue.parse(r),this.choices.push({name:n,value:r}),this}addChoices(...t){if(this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");ce.parse(t);for(let n of t)this.addChoice(n);return this}setChoices(...t){if(t.length>0&&this.autocomplete)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");ce.parse(t),Reflect.set(this,"choices",[]);for(let n of t)this.addChoice(n);return this}setAutocomplete(t){if(ro.parse(t),t&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return Reflect.set(this,"autocomplete",t),this}};o(S,"ApplicationCommandOptionWithChoicesAndAutocompleteMixin");var fe=Ce.z.number().int(),E=class extends p{constructor(){super(...arguments);i(this,"type",he.ApplicationCommandOptionType.Integer)}setMaxValue(t){return fe.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return fe.parse(t),Reflect.set(this,"min_value",t),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};o(E,"SlashCommandIntegerOption"),E=d([(0,be.mix)(_,S)],E);var Ae=require("discord-api-types/v9");var Z=class extends p{constructor(){super(...arguments);i(this,"type",Ae.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Z,"SlashCommandMentionableOption");var xe=require("discord-api-types/v9"),ye=require("ts-mixer"),ge=require("zod");var Oe=ge.z.number(),B=class extends p{constructor(){super(...arguments);i(this,"type",xe.ApplicationCommandOptionType.Number)}setMaxValue(t){return Oe.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return Oe.parse(t),Reflect.set(this,"min_value",t),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};o(B,"SlashCommandNumberOption"),B=d([(0,ye.mix)(_,S)],B);var Se=require("discord-api-types/v9");var K=class extends p{constructor(){super(...arguments);i(this,"type",Se.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(K,"SlashCommandRoleOption");var Pe=require("discord-api-types/v9");var Q=class extends p{constructor(){super(...arguments);i(this,"type",Pe.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Q,"SlashCommandAttachmentOption");var Ie=require("discord-api-types/v9"),Te=require("ts-mixer");var N=class extends p{constructor(){super(...arguments);i(this,"type",Ie.ApplicationCommandOptionType.String)}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};o(N,"SlashCommandStringOption"),N=d([(0,Te.mix)(S)],N);var Me=require("discord-api-types/v9");var H=class extends p{constructor(){super(...arguments);i(this,"type",Me.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(H,"SlashCommandUserOption");var U=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,z)}addUserOption(t){return this._sharedAddOptionMethod(t,H)}addChannelOption(t){return this._sharedAddOptionMethod(t,w)}addRoleOption(t){return this._sharedAddOptionMethod(t,K)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,Q)}addMentionableOption(t){return this._sharedAddOptionMethod(t,Z)}addStringOption(t){return this._sharedAddOptionMethod(t,N)}addIntegerOption(t){return this._sharedAddOptionMethod(t,E)}addNumberOption(t){return this._sharedAddOptionMethod(t,B)}_sharedAddOptionMethod(t,n){let{options:r}=this;C(r);let s=typeof t=="function"?t(new n):t;return O(s,n),r.push(s),this}};o(U,"SharedSlashCommandOptions");var Jt=require("discord-api-types/v9"),qt=require("ts-mixer");var P=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;C(n);let r=typeof t=="function"?t(new h):t;return O(r,h),n.push(r),this}toJSON(){return g(this.name,this.description,this.options),{type:Jt.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(P,"SlashCommandSubcommandGroupBuilder"),P=d([(0,qt.mix)(f)],P);var h=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return g(this.name,this.description,this.options),{type:Jt.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(h,"SlashCommandSubcommandBuilder"),h=d([(0,qt.mix)(f,U)],h);var X=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return g(this.name,this.description,this.options),{name:this.name,description:this.description,options:this.options.map(t=>t.toJSON()),default_permission:this.defaultPermission}}setDefaultPermission(t){return Lt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;C(n);let r=typeof t=="function"?t(new P):t;return O(r,P),n.push(r),this}addSubcommand(t){let{options:n}=this;C(n);let r=typeof t=="function"?t(new h):t;return O(r,h),n.push(r),this}};o(X,"SlashCommandBuilder"),X=d([(0,Re.mix)(U,f)],X);var Gt={};q(Gt,{validateDefaultPermission:()=>jt,validateName:()=>ht,validateRequiredParameters:()=>Ft,validateType:()=>bt});var J=require("zod"),kt=require("discord-api-types/v9"),ao=J.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),so=J.z.union([J.z.literal(kt.ApplicationCommandType.User),J.z.literal(kt.ApplicationCommandType.Message)]),po=J.z.boolean();function jt(e){po.parse(e)}o(jt,"validateDefaultPermission");function ht(e){ao.parse(e)}o(ht,"validateName");function bt(e){so.parse(e)}o(bt,"validateType");function Ft(e,t){ht(e),bt(t)}o(Ft,"validateRequiredParameters");var Wt=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return ht(t),Reflect.set(this,"name",t),this}setType(t){return bt(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return jt(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return Ft(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(Wt,"ContextMenuCommandBuilder");function mo(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(mo,"isJSONEncodable");module.exports=Le(lo);0&&(module.exports={ActionRow,ButtonComponent,Component,ComponentAssertions,ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,SelectMenuComponent,SelectMenuOption,SlashCommandAssertions,SlashCommandAttachmentOption,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TimestampStyles,UnsafeButtonComponent,UnsafeEmbed,UnsafeSelectMenuComponent,UnsafeSelectMenuOption,blockQuote,bold,channelMention,codeBlock,createComponent,formatEmoji,hideLinkEmbed,hyperlink,inlineCode,isJSONEncodable,italic,memberNicknameMention,quote,roleMention,spoiler,strikethrough,time,underscore,userMention});
|
|
4
4
|
//# sourceMappingURL=index.js.map
|