@discordjs/builders 0.13.0-dev.1645661240.8203c5d → 0.13.0-dev.1646395406.6f7a366

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/README.md CHANGED
@@ -27,7 +27,7 @@ pnpm add @discordjs/builders
27
27
 
28
28
  Here are some examples for the builders and utilities you can find in this package:
29
29
 
30
- - [Slash Command Builders](./docs/examples/Slash%20Command%20Builders.md)
30
+ - [Slash Command Builders](https://github.com/discordjs/discord.js/blob/main/packages/builders/docs/examples/Slash%20Command%20Builders.md)
31
31
 
32
32
  ## Links
33
33
 
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, 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';
2
+ import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APIEmbedVideo, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, APIBaseComponent, ComponentType, APIModalComponent, APIMessageComponent, APIActionRowComponent, APIModalActionRowComponent, APIMessageActionRowComponent, APIActionRowComponentTypes, APIButtonComponent, APITextInputComponent, TextInputStyle, APIModalInteractionResponseCallbackData, APISelectMenuComponent, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandBooleanOption, ChannelType, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandAttachmentOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, RESTPostAPIApplicationCommandsJSONBody, APIApplicationCommandOption, ApplicationCommandType } from 'discord-api-types/v9';
3
3
  import { z } from 'zod';
4
4
  import { Snowflake } from 'discord-api-types/globals';
5
5
  import { URL } from 'url';
@@ -44,38 +44,38 @@ declare const footerTextPredicate: z.ZodNullable<z.ZodString>;
44
44
  declare const timestampPredicate: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
45
45
  declare const titlePredicate: z.ZodNullable<z.ZodString>;
46
46
 
47
- declare const Assertions$3_fieldNamePredicate: typeof fieldNamePredicate;
48
- declare const Assertions$3_fieldValuePredicate: typeof fieldValuePredicate;
49
- declare const Assertions$3_fieldInlinePredicate: typeof fieldInlinePredicate;
50
- declare const Assertions$3_embedFieldPredicate: typeof embedFieldPredicate;
51
- declare const Assertions$3_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
52
- declare const Assertions$3_fieldLengthPredicate: typeof fieldLengthPredicate;
53
- declare const Assertions$3_validateFieldLength: typeof validateFieldLength;
54
- declare const Assertions$3_authorNamePredicate: typeof authorNamePredicate;
55
- declare const Assertions$3_urlPredicate: typeof urlPredicate;
56
- declare const Assertions$3_RGBPredicate: typeof RGBPredicate;
57
- declare const Assertions$3_colorPredicate: typeof colorPredicate;
58
- declare const Assertions$3_descriptionPredicate: typeof descriptionPredicate;
59
- declare const Assertions$3_footerTextPredicate: typeof footerTextPredicate;
60
- declare const Assertions$3_timestampPredicate: typeof timestampPredicate;
61
- declare const Assertions$3_titlePredicate: typeof titlePredicate;
62
- declare namespace Assertions$3 {
47
+ declare const Assertions$5_fieldNamePredicate: typeof fieldNamePredicate;
48
+ declare const Assertions$5_fieldValuePredicate: typeof fieldValuePredicate;
49
+ declare const Assertions$5_fieldInlinePredicate: typeof fieldInlinePredicate;
50
+ declare const Assertions$5_embedFieldPredicate: typeof embedFieldPredicate;
51
+ declare const Assertions$5_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
52
+ declare const Assertions$5_fieldLengthPredicate: typeof fieldLengthPredicate;
53
+ declare const Assertions$5_validateFieldLength: typeof validateFieldLength;
54
+ declare const Assertions$5_authorNamePredicate: typeof authorNamePredicate;
55
+ declare const Assertions$5_urlPredicate: typeof urlPredicate;
56
+ declare const Assertions$5_RGBPredicate: typeof RGBPredicate;
57
+ declare const Assertions$5_colorPredicate: typeof colorPredicate;
58
+ declare const Assertions$5_descriptionPredicate: typeof descriptionPredicate;
59
+ declare const Assertions$5_footerTextPredicate: typeof footerTextPredicate;
60
+ declare const Assertions$5_timestampPredicate: typeof timestampPredicate;
61
+ declare const Assertions$5_titlePredicate: typeof titlePredicate;
62
+ declare namespace Assertions$5 {
63
63
  export {
64
- Assertions$3_fieldNamePredicate as fieldNamePredicate,
65
- Assertions$3_fieldValuePredicate as fieldValuePredicate,
66
- Assertions$3_fieldInlinePredicate as fieldInlinePredicate,
67
- Assertions$3_embedFieldPredicate as embedFieldPredicate,
68
- Assertions$3_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
69
- Assertions$3_fieldLengthPredicate as fieldLengthPredicate,
70
- Assertions$3_validateFieldLength as validateFieldLength,
71
- Assertions$3_authorNamePredicate as authorNamePredicate,
72
- Assertions$3_urlPredicate as urlPredicate,
73
- Assertions$3_RGBPredicate as RGBPredicate,
74
- Assertions$3_colorPredicate as colorPredicate,
75
- Assertions$3_descriptionPredicate as descriptionPredicate,
76
- Assertions$3_footerTextPredicate as footerTextPredicate,
77
- Assertions$3_timestampPredicate as timestampPredicate,
78
- Assertions$3_titlePredicate as titlePredicate,
64
+ Assertions$5_fieldNamePredicate as fieldNamePredicate,
65
+ Assertions$5_fieldValuePredicate as fieldValuePredicate,
66
+ Assertions$5_fieldInlinePredicate as fieldInlinePredicate,
67
+ Assertions$5_embedFieldPredicate as embedFieldPredicate,
68
+ Assertions$5_embedFieldsArrayPredicate as embedFieldsArrayPredicate,
69
+ Assertions$5_fieldLengthPredicate as fieldLengthPredicate,
70
+ Assertions$5_validateFieldLength as validateFieldLength,
71
+ Assertions$5_authorNamePredicate as authorNamePredicate,
72
+ Assertions$5_urlPredicate as urlPredicate,
73
+ Assertions$5_RGBPredicate as RGBPredicate,
74
+ Assertions$5_colorPredicate as colorPredicate,
75
+ Assertions$5_descriptionPredicate as descriptionPredicate,
76
+ Assertions$5_footerTextPredicate as footerTextPredicate,
77
+ Assertions$5_timestampPredicate as timestampPredicate,
78
+ Assertions$5_titlePredicate as titlePredicate,
79
79
  };
80
80
  }
81
81
 
@@ -169,12 +169,6 @@ declare class UnsafeEmbed implements Equatable<APIEmbed | UnsafeEmbed> {
169
169
  * The hex color of the current color of the embed
170
170
  */
171
171
  get hexColor(): string | undefined;
172
- /**
173
- * Adds a field to the embed (max 25)
174
- *
175
- * @param field The field to add.
176
- */
177
- addField(field: APIEmbedField): this;
178
172
  /**
179
173
  * Adds fields to the embed (max 25)
180
174
  *
@@ -574,7 +568,7 @@ declare const emojiValidator: z.ZodObject<{
574
568
  declare const disabledValidator: z.ZodBoolean;
575
569
  declare const buttonLabelValidator: z.ZodString;
576
570
  declare const buttonStyleValidator: z.ZodNumber;
577
- declare const placeholderValidator: z.ZodString;
571
+ declare const placeholderValidator$1: z.ZodString;
578
572
  declare const minMaxValidator: z.ZodNumber;
579
573
  declare const optionsValidator: z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "atleastone">;
580
574
  declare function validateRequiredSelectMenuParameters(options: SelectMenuOption[], customId?: string): void;
@@ -584,36 +578,35 @@ declare function validateRequiredSelectMenuOptionParameters(label?: string, valu
584
578
  declare const urlValidator: z.ZodString;
585
579
  declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, url?: string): void;
586
580
 
587
- declare const Assertions$2_customIdValidator: typeof customIdValidator;
588
- declare const Assertions$2_emojiValidator: typeof emojiValidator;
589
- declare const Assertions$2_disabledValidator: typeof disabledValidator;
590
- declare const Assertions$2_buttonLabelValidator: typeof buttonLabelValidator;
591
- declare const Assertions$2_buttonStyleValidator: typeof buttonStyleValidator;
592
- declare const Assertions$2_placeholderValidator: typeof placeholderValidator;
593
- declare const Assertions$2_minMaxValidator: typeof minMaxValidator;
594
- declare const Assertions$2_optionsValidator: typeof optionsValidator;
595
- declare const Assertions$2_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
596
- declare const Assertions$2_labelValueValidator: typeof labelValueValidator;
597
- declare const Assertions$2_defaultValidator: typeof defaultValidator;
598
- declare const Assertions$2_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
599
- declare const Assertions$2_urlValidator: typeof urlValidator;
600
- declare const Assertions$2_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
601
- declare namespace Assertions$2 {
581
+ declare const Assertions$4_customIdValidator: typeof customIdValidator;
582
+ declare const Assertions$4_emojiValidator: typeof emojiValidator;
583
+ declare const Assertions$4_disabledValidator: typeof disabledValidator;
584
+ declare const Assertions$4_buttonLabelValidator: typeof buttonLabelValidator;
585
+ declare const Assertions$4_buttonStyleValidator: typeof buttonStyleValidator;
586
+ declare const Assertions$4_minMaxValidator: typeof minMaxValidator;
587
+ declare const Assertions$4_optionsValidator: typeof optionsValidator;
588
+ declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
589
+ declare const Assertions$4_labelValueValidator: typeof labelValueValidator;
590
+ declare const Assertions$4_defaultValidator: typeof defaultValidator;
591
+ declare const Assertions$4_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
592
+ declare const Assertions$4_urlValidator: typeof urlValidator;
593
+ declare const Assertions$4_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
594
+ declare namespace Assertions$4 {
602
595
  export {
603
- Assertions$2_customIdValidator as customIdValidator,
604
- Assertions$2_emojiValidator as emojiValidator,
605
- Assertions$2_disabledValidator as disabledValidator,
606
- Assertions$2_buttonLabelValidator as buttonLabelValidator,
607
- Assertions$2_buttonStyleValidator as buttonStyleValidator,
608
- Assertions$2_placeholderValidator as placeholderValidator,
609
- Assertions$2_minMaxValidator as minMaxValidator,
610
- Assertions$2_optionsValidator as optionsValidator,
611
- Assertions$2_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters,
612
- Assertions$2_labelValueValidator as labelValueValidator,
613
- Assertions$2_defaultValidator as defaultValidator,
614
- Assertions$2_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters,
615
- Assertions$2_urlValidator as urlValidator,
616
- Assertions$2_validateRequiredButtonParameters as validateRequiredButtonParameters,
596
+ Assertions$4_customIdValidator as customIdValidator,
597
+ Assertions$4_emojiValidator as emojiValidator,
598
+ Assertions$4_disabledValidator as disabledValidator,
599
+ Assertions$4_buttonLabelValidator as buttonLabelValidator,
600
+ Assertions$4_buttonStyleValidator as buttonStyleValidator,
601
+ placeholderValidator$1 as placeholderValidator,
602
+ Assertions$4_minMaxValidator as minMaxValidator,
603
+ Assertions$4_optionsValidator as optionsValidator,
604
+ Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters,
605
+ Assertions$4_labelValueValidator as labelValueValidator,
606
+ Assertions$4_defaultValidator as defaultValidator,
607
+ Assertions$4_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters,
608
+ Assertions$4_urlValidator as urlValidator,
609
+ Assertions$4_validateRequiredButtonParameters as validateRequiredButtonParameters,
617
610
  };
618
611
  }
619
612
 
@@ -634,13 +627,13 @@ declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSO
634
627
  */
635
628
  declare abstract class Component<DataType extends Partial<APIBaseComponent<ComponentType>> & {
636
629
  type: ComponentType;
637
- } = APIBaseComponent<ComponentType>> implements JSONEncodable<APIMessageComponent>, Equatable<Component | APIActionRowComponentTypes> {
630
+ } = APIBaseComponent<ComponentType>> implements JSONEncodable<APIModalComponent | APIMessageComponent | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>>, Equatable<Component | APIActionRowComponentTypes | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>> {
638
631
  /**
639
632
  * The API data associated with this component
640
633
  */
641
634
  readonly data: DataType;
642
- abstract toJSON(): APIMessageComponent;
643
- abstract equals(other: Component | APIActionRowComponentTypes): boolean;
635
+ abstract toJSON(): APIActionRowComponentTypes | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>;
636
+ abstract equals(other: Component | APIActionRowComponentTypes | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>): boolean;
644
637
  constructor(data: DataType);
645
638
  /**
646
639
  * The type of this component
@@ -648,19 +641,21 @@ declare abstract class Component<DataType extends Partial<APIBaseComponent<Compo
648
641
  get type(): DataType['type'];
649
642
  }
650
643
 
651
- declare type MessageComponent = ActionRowComponent | ActionRow;
652
- declare type ActionRowComponent = ButtonComponent | SelectMenuComponent;
644
+ declare type MessageComponent = MessageActionRowComponent | ActionRow<MessageActionRowComponent>;
645
+ declare type ModalComponent = ModalActionRowComponent | ActionRow<ModalActionRowComponent>;
646
+ declare type MessageActionRowComponent = ButtonComponent | SelectMenuComponent;
647
+ declare type ModalActionRowComponent = TextInputComponent;
653
648
  /**
654
649
  * Represents an action row component
655
650
  */
656
- declare class ActionRow<T extends ActionRowComponent = ActionRowComponent> extends Component<Omit<Partial<APIActionRowComponent<APIMessageComponent>> & {
651
+ declare class ActionRow<T extends ModalActionRowComponent | MessageActionRowComponent = ModalActionRowComponent | MessageActionRowComponent> extends Component<Omit<Partial<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>> & {
657
652
  type: ComponentType.ActionRow;
658
653
  }, 'components'>> {
659
654
  /**
660
655
  * The components within this action row
661
656
  */
662
657
  readonly components: T[];
663
- constructor({ components, ...data }?: Partial<APIActionRowComponent<APIMessageComponent>>);
658
+ constructor({ components, ...data }?: Partial<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>>);
664
659
  /**
665
660
  * Adds components to this action row.
666
661
  * @param components The components to add to this action row.
@@ -672,8 +667,8 @@ declare class ActionRow<T extends ActionRowComponent = ActionRowComponent> exten
672
667
  * @param components The components to set this row to
673
668
  */
674
669
  setComponents(...components: T[]): this;
675
- toJSON(): APIActionRowComponent<APIMessageComponent>;
676
- equals(other: APIActionRowComponent<APIMessageComponent> | ActionRow): boolean;
670
+ toJSON(): APIActionRowComponent<ReturnType<T['toJSON']>>;
671
+ equals(other: APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent> | ActionRow): boolean;
677
672
  }
678
673
 
679
674
  /**
@@ -758,15 +753,191 @@ interface MappedComponentTypes {
758
753
  [ComponentType.ActionRow]: ActionRow;
759
754
  [ComponentType.Button]: ButtonComponent;
760
755
  [ComponentType.SelectMenu]: SelectMenuComponent;
756
+ [ComponentType.TextInput]: TextInputComponent;
761
757
  }
762
758
  /**
763
759
  * Factory for creating components from API data
764
760
  * @param data The api data to transform to a component class
765
761
  */
766
- declare function createComponent<T extends keyof MappedComponentTypes>(data: APIMessageComponent & {
762
+ declare function createComponent<T extends keyof MappedComponentTypes>(data: (APIMessageComponent | APIModalComponent) & {
767
763
  type: T;
768
764
  }): MappedComponentTypes[T];
769
- declare function createComponent<C extends MessageComponent>(data: C): C;
765
+ declare function createComponent<C extends MessageComponent | ModalActionRowComponent>(data: C): C;
766
+
767
+ declare class UnsafeTextInputComponent extends Component<Partial<APITextInputComponent> & {
768
+ type: ComponentType.TextInput;
769
+ }> {
770
+ constructor(data?: APITextInputComponent & {
771
+ type?: ComponentType.TextInput;
772
+ });
773
+ /**
774
+ * The style of this text input
775
+ */
776
+ get style(): TextInputStyle | undefined;
777
+ /**
778
+ * The custom id of this text input
779
+ */
780
+ get customId(): string | undefined;
781
+ /**
782
+ * The label for this text input
783
+ */
784
+ get label(): string | undefined;
785
+ /**
786
+ * The placeholder text for this text input
787
+ */
788
+ get placeholder(): string | undefined;
789
+ /**
790
+ * The default value for this text input
791
+ */
792
+ get value(): string | undefined;
793
+ /**
794
+ * The minimum length of this text input
795
+ */
796
+ get minLength(): number | undefined;
797
+ /**
798
+ * The maximum length of this text input
799
+ */
800
+ get maxLength(): number | undefined;
801
+ /**
802
+ * Whether this text input is required
803
+ */
804
+ get required(): boolean | undefined;
805
+ /**
806
+ * Sets the custom id for this text input
807
+ * @param customId The custom id of this text input
808
+ */
809
+ setCustomId(customId: string): this;
810
+ /**
811
+ * Sets the label for this text input
812
+ * @param label The label for this text input
813
+ */
814
+ setLabel(label: string): this;
815
+ /**
816
+ * Sets the style for this text input
817
+ * @param style The style for this text input
818
+ */
819
+ setStyle(style: TextInputStyle): this;
820
+ /**
821
+ * Sets the minimum length of text for this text input
822
+ * @param minLength The minimum length of text for this text input
823
+ */
824
+ setMinLength(minLength: number): this;
825
+ /**
826
+ * Sets the maximum length of text for this text input
827
+ * @param maxLength The maximum length of text for this text input
828
+ */
829
+ setMaxLength(maxLength: number): this;
830
+ /**
831
+ * Sets the placeholder of this text input
832
+ * @param placeholder The placeholder of this text input
833
+ */
834
+ setPlaceholder(placeholder: string): this;
835
+ /**
836
+ * Sets the value of this text input
837
+ * @param value The value for this text input
838
+ */
839
+ setValue(value: string): this;
840
+ /**
841
+ * Sets whether this text input is required or not
842
+ * @param required Whether this text input is required or not
843
+ */
844
+ setRequired(required?: boolean): this;
845
+ toJSON(): APITextInputComponent;
846
+ equals(other: UnsafeTextInputComponent | APITextInputComponent): boolean;
847
+ }
848
+
849
+ declare class TextInputComponent extends UnsafeTextInputComponent {
850
+ setMinLength(minLength: number): this;
851
+ setMaxLength(maxLength: number): this;
852
+ setRequired(required?: boolean): this;
853
+ setValue(value: string): this;
854
+ setPlaceholder(placeholder: string): this;
855
+ toJSON(): APITextInputComponent;
856
+ }
857
+
858
+ declare const textInputStyleValidator: z.ZodNativeEnum<typeof TextInputStyle>;
859
+ declare const minLengthValidator: z.ZodNumber;
860
+ declare const maxLengthValidator: z.ZodNumber;
861
+ declare const requiredValidator: z.ZodBoolean;
862
+ declare const valueValidator: z.ZodString;
863
+ declare const placeholderValidator: z.ZodString;
864
+ declare const labelValidator: z.ZodString;
865
+ declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void;
866
+
867
+ declare const Assertions$3_textInputStyleValidator: typeof textInputStyleValidator;
868
+ declare const Assertions$3_minLengthValidator: typeof minLengthValidator;
869
+ declare const Assertions$3_maxLengthValidator: typeof maxLengthValidator;
870
+ declare const Assertions$3_requiredValidator: typeof requiredValidator;
871
+ declare const Assertions$3_valueValidator: typeof valueValidator;
872
+ declare const Assertions$3_placeholderValidator: typeof placeholderValidator;
873
+ declare const Assertions$3_labelValidator: typeof labelValidator;
874
+ declare namespace Assertions$3 {
875
+ export {
876
+ Assertions$3_textInputStyleValidator as textInputStyleValidator,
877
+ Assertions$3_minLengthValidator as minLengthValidator,
878
+ Assertions$3_maxLengthValidator as maxLengthValidator,
879
+ Assertions$3_requiredValidator as requiredValidator,
880
+ Assertions$3_valueValidator as valueValidator,
881
+ Assertions$3_placeholderValidator as placeholderValidator,
882
+ Assertions$3_labelValidator as labelValidator,
883
+ validateRequiredParameters$3 as validateRequiredParameters,
884
+ };
885
+ }
886
+
887
+ declare class UnsafeModal implements JSONEncodable<APIModalInteractionResponseCallbackData> {
888
+ protected readonly data: Partial<Omit<APIModalInteractionResponseCallbackData, 'components'>>;
889
+ readonly components: ActionRow<ModalActionRowComponent>[];
890
+ constructor({ components, ...data }?: Partial<APIModalInteractionResponseCallbackData>);
891
+ /**
892
+ * The custom id of this modal
893
+ */
894
+ get customId(): string | undefined;
895
+ /**
896
+ * The title of this modal
897
+ */
898
+ get title(): string | undefined;
899
+ /**
900
+ * Sets the title of the modal
901
+ * @param title The title of the modal
902
+ */
903
+ setTitle(title: string): this;
904
+ /**
905
+ * Sets the custom id of the modal
906
+ * @param customId The custom id of this modal
907
+ */
908
+ setCustomId(customId: string): this;
909
+ /**
910
+ * Adds components to this modal
911
+ * @param components The components to add to this modal
912
+ */
913
+ addComponents(...components: (ActionRow<ModalActionRowComponent> | APIActionRowComponent<APIModalActionRowComponent>)[]): this;
914
+ /**
915
+ * Sets the components in this modal
916
+ * @param components The components to set this modal to
917
+ */
918
+ setComponents(...components: ActionRow<ModalActionRowComponent>[]): this;
919
+ toJSON(): APIModalInteractionResponseCallbackData;
920
+ }
921
+
922
+ declare class Modal extends UnsafeModal {
923
+ setCustomId(customId: string): this;
924
+ setTitle(title: string): this;
925
+ toJSON(): APIModalInteractionResponseCallbackData;
926
+ }
927
+
928
+ declare const titleValidator: z.ZodString;
929
+ declare const componentsValidator: z.ZodArray<z.ZodType<ActionRow<TextInputComponent | MessageActionRowComponent>, z.ZodTypeDef, ActionRow<TextInputComponent | MessageActionRowComponent>>, "many">;
930
+ declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRow<ModalActionRowComponent>[]): void;
931
+
932
+ declare const Assertions$2_titleValidator: typeof titleValidator;
933
+ declare const Assertions$2_componentsValidator: typeof componentsValidator;
934
+ declare namespace Assertions$2 {
935
+ export {
936
+ Assertions$2_titleValidator as titleValidator,
937
+ Assertions$2_componentsValidator as componentsValidator,
938
+ validateRequiredParameters$2 as validateRequiredParameters,
939
+ };
940
+ }
770
941
 
771
942
  /**
772
943
  * Represents a non-validated select menu component
@@ -1254,4 +1425,4 @@ declare namespace Assertions {
1254
1425
  };
1255
1426
  }
1256
1427
 
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 };
1428
+ export { ActionRow, ButtonComponent, Component, Assertions$4 as ComponentAssertions, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, ContextMenuCommandType, Embed, Assertions$5 as EmbedAssertions, EmbedAuthorData, EmbedAuthorOptions, EmbedFooterData, EmbedFooterOptions, EmbedImageData, Faces, IconData, JSONEncodable, MappedComponentTypes, MessageActionRowComponent, MessageComponent, Modal, ModalActionRowComponent, Assertions$2 as ModalAssertions, ModalComponent, RGBTuple, SelectMenuComponent, SelectMenuOption, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, Assertions$3 as TextInputAssertions, TextInputComponent, TimestampStyles, TimestampStylesString, ToAPIApplicationCommandOptions, UnsafeButtonComponent, UnsafeEmbed, UnsafeModal, UnsafeSelectMenuComponent, UnsafeSelectMenuOption, UnsafeTextInputComponent, 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 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"?`\`\`\`
1
+ var Ye=Object.create;var T=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var to=Object.getOwnPropertyNames;var eo=Object.getPrototypeOf,oo=Object.prototype.hasOwnProperty;var no=(e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var de=e=>T(e,"__esModule",{value:!0}),o=(e,t)=>T(e,"name",{value:t,configurable:!0});var w=(e,t)=>{for(var n in t)T(e,n,{get:t[n],enumerable:!0})},ue=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of to(t))!oo.call(e,s)&&(n||s!=="default")&&T(e,s,{get:()=>t[s],enumerable:!(r=le(t,s))||r.enumerable});return e},D=(e,t)=>ue(de(T(e!=null?Ye(eo(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),io=(e=>(t,n)=>e&&e.get(t)||(n=ue(de({}),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?le(t,n):t,y=e.length-1,M;y>=0;y--)(M=e[y])&&(s=(r?M(t,n,s):M(s))||s);return r&&s&&T(t,n,s),s};var i=(e,t,n)=>(no(e,typeof t!="symbol"?t+"":t,n),n);var Bo={};w(Bo,{ActionRow:()=>h,ButtonComponent:()=>Z,Component:()=>u,ComponentAssertions:()=>qt,ContextMenuCommandAssertions:()=>pe,ContextMenuCommandBuilder:()=>me,Embed:()=>vt,EmbedAssertions:()=>wt,Faces:()=>Ae,Modal:()=>Ht,ModalAssertions:()=>Qt,SelectMenuComponent:()=>Q,SelectMenuOption:()=>Xt,SlashCommandAssertions:()=>ee,SlashCommandAttachmentOption:()=>ot,SlashCommandBooleanOption:()=>Y,SlashCommandBuilder:()=>it,SlashCommandChannelOption:()=>V,SlashCommandIntegerOption:()=>L,SlashCommandMentionableOption:()=>tt,SlashCommandNumberOption:()=>$,SlashCommandRoleOption:()=>et,SlashCommandStringOption:()=>_,SlashCommandSubcommandBuilder:()=>f,SlashCommandSubcommandGroupBuilder:()=>R,SlashCommandUserOption:()=>nt,TextInputAssertions:()=>Wt,TextInputComponent:()=>K,TimestampStyles:()=>Po,UnsafeButtonComponent:()=>E,UnsafeEmbed:()=>v,UnsafeModal:()=>H,UnsafeSelectMenuComponent:()=>B,UnsafeSelectMenuOption:()=>b,UnsafeTextInputComponent:()=>N,blockQuote:()=>co,bold:()=>po,channelMention:()=>xo,codeBlock:()=>ro,createComponent:()=>W,formatEmoji:()=>go,hideLinkEmbed:()=>ho,hyperlink:()=>bo,inlineCode:()=>ao,isJSONEncodable:()=>No,italic:()=>so,memberNicknameMention:()=>Ao,quote:()=>uo,roleMention:()=>yo,spoiler:()=>Co,strikethrough:()=>lo,time:()=>Oo,underscore:()=>mo,userMention:()=>fo});var wt={};w(wt,{RGBPredicate:()=>pt,authorNamePredicate:()=>Pt,colorPredicate:()=>It,descriptionPredicate:()=>St,embedFieldPredicate:()=>be,embedFieldsArrayPredicate:()=>at,fieldInlinePredicate:()=>he,fieldLengthPredicate:()=>Ce,fieldNamePredicate:()=>rt,fieldValuePredicate:()=>ce,footerTextPredicate:()=>Rt,timestampPredicate:()=>Mt,titlePredicate:()=>Tt,urlPredicate:()=>g,validateFieldLength:()=>st});var m=require("zod"),rt=m.z.string().min(1).max(256),ce=m.z.string().min(1).max(1024),he=m.z.boolean().optional(),be=m.z.object({name:rt,value:ce,inline:he}),at=be.array(),Ce=m.z.number().lte(25);function st(e,t){Ce.parse((t?.length??0)+e)}o(st,"validateFieldLength");var Pt=rt.nullable(),g=m.z.string().url().nullish(),pt=m.z.number().int().gte(0).lte(255),It=m.z.number().int().gte(0).lte(16777215).nullable().or(m.z.tuple([pt,pt,pt])),St=m.z.string().min(1).max(4096).nullable(),Rt=m.z.string().min(1).max(2048).nullable(),Mt=m.z.union([m.z.number(),m.z.date()]).nullable(),Tt=rt.nullable();var fe=D(require("fast-deep-equal")),v=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}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,y=t instanceof v?t.data:t,{image:M,thumbnail:He,...Xe}=y;return(0,fe.default)(Xe,s)&&M?.url===n?.url&&He?.url===r?.url}};o(v,"UnsafeEmbed");var vt=class extends v{addFields(...t){return st(t.length,this.fields),super.addFields(...at.parse(t))}spliceFields(t,n,...r){return st(r.length-n,this.fields),super.spliceFields(t,n,...at.parse(r))}setAuthor(t){return t===null?super.setAuthor(null):(Pt.parse(t.name),g.parse(t.iconURL),g.parse(t.url),super.setAuthor(t))}setColor(t){return super.setColor(It.parse(t))}setDescription(t){return super.setDescription(St.parse(t))}setFooter(t){return t===null?super.setFooter(null):(Rt.parse(t.text),g.parse(t.iconURL),super.setFooter(t))}setImage(t){return super.setImage(g.parse(t))}setThumbnail(t){return super.setThumbnail(g.parse(t))}setTimestamp(t=Date.now()){return super.setTimestamp(Mt.parse(t))}setTitle(t){return super.setTitle(Tt.parse(t))}setURL(t){return super.setURL(g.parse(t))}};o(vt,"Embed");function ro(e,t){return typeof t=="undefined"?`\`\`\`
2
2
  ${e}\`\`\``:`\`\`\`${e}
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});
3
+ ${t}\`\`\``}o(ro,"codeBlock");function ao(e){return`\`${e}\``}o(ao,"inlineCode");function so(e){return`_${e}_`}o(so,"italic");function po(e){return`**${e}**`}o(po,"bold");function mo(e){return`__${e}__`}o(mo,"underscore");function lo(e){return`~~${e}~~`}o(lo,"strikethrough");function uo(e){return`> ${e}`}o(uo,"quote");function co(e){return`>>> ${e}`}o(co,"blockQuote");function ho(e){return`<${e}>`}o(ho,"hideLinkEmbed");function bo(e,t,n){return n?`[${e}](${t} "${n}")`:`[${e}](${t})`}o(bo,"hyperlink");function Co(e){return`||${e}||`}o(Co,"spoiler");function fo(e){return`<@${e}>`}o(fo,"userMention");function Ao(e){return`<@!${e}>`}o(Ao,"memberNicknameMention");function xo(e){return`<#${e}>`}o(xo,"channelMention");function yo(e){return`<@&${e}>`}o(yo,"roleMention");function go(e,t=!1){return`<${t?"a":""}:_:${e}>`}o(go,"formatEmoji");function Oo(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}o(Oo,"time");var Po={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Ae=(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))(Ae||{});var qt={};w(qt,{buttonLabelValidator:()=>Et,buttonStyleValidator:()=>Nt,customIdValidator:()=>c,defaultValidator:()=>Lt,disabledValidator:()=>F,emojiValidator:()=>j,labelValueValidator:()=>G,minMaxValidator:()=>lt,optionsValidator:()=>xe,placeholderValidator:()=>Bt,urlValidator:()=>_t,validateRequiredButtonParameters:()=>Dt,validateRequiredSelectMenuOptionParameters:()=>$t,validateRequiredSelectMenuParameters:()=>Vt});var mt=require("discord-api-types/v9"),l=require("zod"),c=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(),Et=l.z.string().nonempty().max(80),Nt=l.z.number().int().min(mt.ButtonStyle.Primary).max(mt.ButtonStyle.Link),Bt=l.z.string().max(100),lt=l.z.number().int().min(0).max(25),xe=l.z.object({}).array().nonempty();function Vt(e,t){c.parse(t),xe.parse(e)}o(Vt,"validateRequiredSelectMenuParameters");var G=l.z.string().min(1).max(100),Lt=l.z.boolean();function $t(e,t){G.parse(e),G.parse(t)}o($t,"validateRequiredSelectMenuOptionParameters");var _t=l.z.string().url();function Dt(e,t,n,r,s){if(s&&r)throw new RangeError("URL and custom id are mutually exclusive");if(!t&&!n)throw new RangeError("Buttons must have a label and/or an emoji");if(e===mt.ButtonStyle.Link){if(!s)throw new RangeError("Link buttons must have a url")}else if(s)throw new RangeError("Non-link buttons cannot have a url")}o(Dt,"validateRequiredButtonParameters");var ye=require("discord-api-types/v9");var u=class{constructor(t){i(this,"data");this.data=t}get type(){return this.data.type}};o(u,"Component");var z=require("discord-api-types/v9");function W(e){if(e instanceof u)return e;switch(e.type){case z.ComponentType.ActionRow:return new h(e);case z.ComponentType.Button:return new Z(e);case z.ComponentType.SelectMenu:return new Q(e);case z.ComponentType.TextInput:return new K(e);default:throw new Error(`Cannot serialize component type: ${e.type}`)}}o(W,"createComponent");var dt=D(require("fast-deep-equal")),h=class extends u{constructor({components:t,...n}={}){super({type:ye.ComponentType.ActionRow,...n});i(this,"components");this.components=t?.map(r=>W(r))??[]}addComponents(...t){return this.components.push(...t),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}equals(t){return t instanceof h?(0,dt.default)(t.data,this.data)&&(0,dt.default)(t.components,this.components):(0,dt.default)(t,{...this.data,components:this.components.map(n=>n.toJSON())})}};o(h,"ActionRow");var ge=require("discord-api-types/v9");var Jt=D(require("fast-deep-equal")),E=class extends u{constructor(t){super({type:ge.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 E?(0,Jt.default)(t.data,this.data):(0,Jt.default)(t,this.data)}};o(E,"UnsafeButtonComponent");var Z=class extends E{setStyle(t){return super.setStyle(Nt.parse(t))}setURL(t){return super.setURL(_t.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setEmoji(t){return super.setEmoji(j.parse(t))}setDisabled(t=!0){return super.setDisabled(F.parse(t))}setLabel(t){return super.setLabel(Et.parse(t))}toJSON(){return Dt(this.style,this.label,this.emoji,this.customId,this.url),super.toJSON()}};o(Z,"ButtonComponent");var Wt={};w(Wt,{labelValidator:()=>Ie,maxLengthValidator:()=>kt,minLengthValidator:()=>Ut,placeholderValidator:()=>Gt,requiredValidator:()=>jt,textInputStyleValidator:()=>Pe,validateRequiredParameters:()=>zt,valueValidator:()=>Ft});var Oe=require("discord-api-types/v9"),O=require("zod");var Pe=O.z.nativeEnum(Oe.TextInputStyle),Ut=O.z.number().int().min(0).max(4e3),kt=O.z.number().int().min(1).max(4e3),jt=O.z.boolean(),Ft=O.z.string().max(4e3),Gt=O.z.string().max(100),Ie=O.z.string().min(1).max(45);function zt(e,t,n){c.parse(e),Pe.parse(t),Ie.parse(n)}o(zt,"validateRequiredParameters");var Se=require("discord-api-types/v9");var Zt=D(require("fast-deep-equal")),N=class extends u{constructor(t){super({type:Se.ComponentType.TextInput,...t})}get style(){return this.data.style}get customId(){return this.data.custom_id}get label(){return this.data.label}get placeholder(){return this.data.placeholder}get value(){return this.data.value}get minLength(){return this.data.min_length}get maxLength(){return this.data.max_length}get required(){return this.data.required}setCustomId(t){return this.data.custom_id=t,this}setLabel(t){return this.data.label=t,this}setStyle(t){return this.data.style=t,this}setMinLength(t){return this.data.min_length=t,this}setMaxLength(t){return this.data.max_length=t,this}setPlaceholder(t){return this.data.placeholder=t,this}setValue(t){return this.data.value=t,this}setRequired(t=!0){return this.data.required=t,this}toJSON(){return{...this.data}}equals(t){return t instanceof N?(0,Zt.default)(t.data,this.data):(0,Zt.default)(t,this.data)}};o(N,"UnsafeTextInputComponent");var K=class extends N{setMinLength(t){return super.setMinLength(Ut.parse(t))}setMaxLength(t){return super.setMaxLength(kt.parse(t))}setRequired(t=!0){return super.setRequired(jt.parse(t))}setValue(t){return super.setValue(Ft.parse(t))}setPlaceholder(t){return super.setPlaceholder(Gt.parse(t))}toJSON(){return zt(this.data.custom_id,this.data.style,this.data.label),super.toJSON()}};o(K,"TextInputComponent");var H=class{constructor({components:t,...n}={}){i(this,"data");i(this,"components",[]);this.data={...n},this.components=t?.map(r=>W(r))??[]}get customId(){return this.data.custom_id}get title(){return this.data.title}setTitle(t){return this.data.title=t,this}setCustomId(t){return this.data.custom_id=t,this}addComponents(...t){return this.components.push(...t.map(n=>n instanceof h?n:new h(n))),this}setComponents(...t){return this.components.splice(0,this.components.length,...t),this}toJSON(){return{...this.data,components:this.components.map(t=>t.toJSON())}}};o(H,"UnsafeModal");var Qt={};w(Qt,{componentsValidator:()=>Re,titleValidator:()=>ct,validateRequiredParameters:()=>Kt});var ut=require("zod");var ct=ut.z.string().min(1).max(45),Re=ut.z.array(ut.z.instanceof(h)).min(1);function Kt(e,t,n){c.parse(e),ct.parse(t),Re.parse(n)}o(Kt,"validateRequiredParameters");var Ht=class extends H{setCustomId(t){return super.setCustomId(c.parse(t))}setTitle(t){return super.setTitle(ct.parse(t))}toJSON(){return Kt(this.data.custom_id,this.data.title,this.components),super.toJSON()}};o(Ht,"Modal");var Me=require("discord-api-types/v9");var b=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(b,"UnsafeSelectMenuOption");var ht=D(require("fast-deep-equal")),B=class extends u{constructor(t){let{options:n,...r}=t??{};super({type:Me.ComponentType.SelectMenu,...r});i(this,"options");this.options=n?.map(s=>new b(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 b?n:new b(n))),this}setOptions(...t){return this.options.splice(0,this.options.length,...t.map(n=>n instanceof b?n:new b(n))),this}toJSON(){return{...this.data,options:this.options.map(t=>t.toJSON())}}equals(t){return t instanceof B?(0,ht.default)(t.data,this.data)&&(0,ht.default)(t.options,this.options):(0,ht.default)(t,{...this.data,options:this.options.map(n=>n.toJSON())})}};o(B,"UnsafeSelectMenuComponent");var Q=class extends B{setPlaceholder(t){return super.setPlaceholder(Bt.parse(t))}setMinValues(t){return super.setMinValues(lt.parse(t))}setMaxValues(t){return super.setMaxValues(lt.parse(t))}setCustomId(t){return super.setCustomId(c.parse(t))}setDisabled(t=!0){return super.setDisabled(F.parse(t))}toJSON(){return Vt(this.options,this.customId),super.toJSON()}};o(Q,"SelectMenuComponent");var Xt=class extends b{setDescription(t){return super.setDescription(G.parse(t))}setDefault(t=!0){return super.setDefault(Lt.parse(t))}setEmoji(t){return super.setEmoji(j.parse(t))}toJSON(){return $t(this.label,this.value),super.toJSON()}};o(Xt,"SelectMenuOption");var ee={};w(ee,{assertReturnOfBuilder:()=>I,validateDefaultPermission:()=>Yt,validateDescription:()=>ft,validateMaxChoicesLength:()=>te,validateMaxOptionsLength:()=>A,validateName:()=>Ct,validateRequired:()=>At,validateRequiredParameters:()=>P});var bt=D(require("@sindresorhus/is")),X=require("zod"),Io=X.z.string().min(1).max(32).regex(/^[\P{Lu}\p{N}_-]+$/u);function Ct(e){Io.parse(e)}o(Ct,"validateName");var So=X.z.string().min(1).max(100);function ft(e){So.parse(e)}o(ft,"validateDescription");var Te=X.z.unknown().array().max(25);function A(e){Te.parse(e)}o(A,"validateMaxOptionsLength");function P(e,t,n){Ct(e),ft(t),A(n)}o(P,"validateRequiredParameters");var we=X.z.boolean();function Yt(e){we.parse(e)}o(Yt,"validateDefaultPermission");function At(e){we.parse(e)}o(At,"validateRequired");function te(e){Te.parse(e)}o(te,"validateMaxChoicesLength");function I(e,t){let n=t.name;if(bt.default.nullOrUndefined(e))throw new TypeError(`Expected to receive a ${n} builder, got ${e===null?"null":"undefined"} instead.`);if(bt.default.primitive(e))throw new TypeError(`Expected to receive a ${n} builder, got a primitive (${typeof e}) instead.`);if(!(e instanceof t)){let r=e,s=bt.default.function_(e)?e.name:r.constructor.name,y=Reflect.get(r,Symbol.toStringTag),M=y?`${s} [${y}]`:s;throw new TypeError(`Expected to receive a ${n} builder, got ${M} instead.`)}}o(I,"assertReturnOfBuilder");var Qe=require("ts-mixer");var ve=require("discord-api-types/v9");var x=class{constructor(){i(this,"name");i(this,"description")}setName(t){return Ct(t),Reflect.set(this,"name",t),this}setDescription(t){return ft(t),Reflect.set(this,"description",t),this}};o(x,"SharedNameAndDescription");var p=class extends x{constructor(){super(...arguments);i(this,"required",!1)}setRequired(t){return At(t),Reflect.set(this,"required",t),this}runRequiredValidations(){P(this.name,this.description,[]),At(this.required)}};o(p,"ApplicationCommandOptionBase");var Y=class extends p{constructor(){super(...arguments);i(this,"type",ve.ApplicationCommandOptionType.Boolean)}toJSON(){return this.runRequiredValidations(),{...this}}};o(Y,"SlashCommandBooleanOption");var Ee=require("discord-api-types/v9"),Ne=require("ts-mixer");var C=require("discord-api-types/v9"),oe=require("zod"),Ro=[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],Mo=oe.z.union(Ro.map(e=>oe.z.literal(e))),xt=class{constructor(){i(this,"channel_types")}addChannelType(t){return this.channel_types===void 0&&Reflect.set(this,"channel_types",[]),Mo.parse(t),this.channel_types.push(t),this}addChannelTypes(t){return t.forEach(n=>this.addChannelType(n)),this}};o(xt,"ApplicationCommandOptionChannelTypesMixin");var V=class extends p{constructor(){super(...arguments);i(this,"type",Ee.ApplicationCommandOptionType.Channel)}toJSON(){return this.runRequiredValidations(),{...this}}};o(V,"SlashCommandChannelOption"),V=d([(0,Ne.mix)(xt)],V);var $e=require("discord-api-types/v9"),_e=require("ts-mixer"),De=require("zod");var q=class{constructor(){i(this,"max_value");i(this,"min_value")}};o(q,"ApplicationCommandNumericOptionMinMaxValueMixin");var Be=require("discord-api-types/v9"),J=require("zod");var yt=J.z.string().min(1).max(100),Ve=J.z.number().gt(-1/0).lt(1/0),Le=J.z.object({name:yt,value:J.z.union([yt,Ve])}).array(),To=J.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",[]),te(this.choices),yt.parse(n),this.type===Be.ApplicationCommandOptionType.String?yt.parse(r):Ve.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.");Le.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.");Le.parse(t),Reflect.set(this,"choices",[]);for(let n of t)this.addChoice(n);return this}setAutocomplete(t){if(To.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 qe=De.z.number().int(),L=class extends p{constructor(){super(...arguments);i(this,"type",$e.ApplicationCommandOptionType.Integer)}setMaxValue(t){return qe.parse(t),Reflect.set(this,"max_value",t),this}setMinValue(t){return qe.parse(t),Reflect.set(this,"min_value",t),this}toJSON(){if(this.runRequiredValidations(),this.autocomplete&&Array.isArray(this.choices)&&this.choices.length>0)throw new RangeError("Autocomplete and choices are mutually exclusive to each other.");return{...this}}};o(L,"SlashCommandIntegerOption"),L=d([(0,_e.mix)(q,S)],L);var Je=require("discord-api-types/v9");var tt=class extends p{constructor(){super(...arguments);i(this,"type",Je.ApplicationCommandOptionType.Mentionable)}toJSON(){return this.runRequiredValidations(),{...this}}};o(tt,"SlashCommandMentionableOption");var Ue=require("discord-api-types/v9"),ke=require("ts-mixer"),je=require("zod");var Fe=je.z.number(),$=class extends p{constructor(){super(...arguments);i(this,"type",Ue.ApplicationCommandOptionType.Number)}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($,"SlashCommandNumberOption"),$=d([(0,ke.mix)(q,S)],$);var Ge=require("discord-api-types/v9");var et=class extends p{constructor(){super(...arguments);i(this,"type",Ge.ApplicationCommandOptionType.Role)}toJSON(){return this.runRequiredValidations(),{...this}}};o(et,"SlashCommandRoleOption");var ze=require("discord-api-types/v9");var ot=class extends p{constructor(){super(...arguments);i(this,"type",ze.ApplicationCommandOptionType.Attachment)}toJSON(){return this.runRequiredValidations(),{...this}}};o(ot,"SlashCommandAttachmentOption");var We=require("discord-api-types/v9"),Ze=require("ts-mixer");var _=class extends p{constructor(){super(...arguments);i(this,"type",We.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(_,"SlashCommandStringOption"),_=d([(0,Ze.mix)(S)],_);var Ke=require("discord-api-types/v9");var nt=class extends p{constructor(){super(...arguments);i(this,"type",Ke.ApplicationCommandOptionType.User)}toJSON(){return this.runRequiredValidations(),{...this}}};o(nt,"SlashCommandUserOption");var U=class{constructor(){i(this,"options")}addBooleanOption(t){return this._sharedAddOptionMethod(t,Y)}addUserOption(t){return this._sharedAddOptionMethod(t,nt)}addChannelOption(t){return this._sharedAddOptionMethod(t,V)}addRoleOption(t){return this._sharedAddOptionMethod(t,et)}addAttachmentOption(t){return this._sharedAddOptionMethod(t,ot)}addMentionableOption(t){return this._sharedAddOptionMethod(t,tt)}addStringOption(t){return this._sharedAddOptionMethod(t,_)}addIntegerOption(t){return this._sharedAddOptionMethod(t,L)}addNumberOption(t){return this._sharedAddOptionMethod(t,$)}_sharedAddOptionMethod(t,n){let{options:r}=this;A(r);let s=typeof t=="function"?t(new n):t;return I(s,n),r.push(s),this}};o(U,"SharedSlashCommandOptions");var ne=require("discord-api-types/v9"),ie=require("ts-mixer");var R=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}addSubcommand(t){let{options:n}=this;A(n);let r=typeof t=="function"?t(new f):t;return I(r,f),n.push(r),this}toJSON(){return P(this.name,this.description,this.options),{type:ne.ApplicationCommandOptionType.SubcommandGroup,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(R,"SlashCommandSubcommandGroupBuilder"),R=d([(0,ie.mix)(x)],R);var f=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[])}toJSON(){return P(this.name,this.description,this.options),{type:ne.ApplicationCommandOptionType.Subcommand,name:this.name,description:this.description,options:this.options.map(t=>t.toJSON())}}};o(f,"SlashCommandSubcommandBuilder"),f=d([(0,ie.mix)(x,U)],f);var it=class{constructor(){i(this,"name");i(this,"description");i(this,"options",[]);i(this,"defaultPermission")}toJSON(){return P(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 Yt(t),Reflect.set(this,"defaultPermission",t),this}addSubcommandGroup(t){let{options:n}=this;A(n);let r=typeof t=="function"?t(new R):t;return I(r,R),n.push(r),this}addSubcommand(t){let{options:n}=this;A(n);let r=typeof t=="function"?t(new f):t;return I(r,f),n.push(r),this}};o(it,"SlashCommandBuilder"),it=d([(0,Qe.mix)(U,x)],it);var pe={};w(pe,{validateDefaultPermission:()=>ae,validateName:()=>gt,validateRequiredParameters:()=>se,validateType:()=>Ot});var k=require("zod"),re=require("discord-api-types/v9"),wo=k.z.string().min(1).max(32).regex(/^( *[\p{L}\p{N}_-]+ *)+$/u),vo=k.z.union([k.z.literal(re.ApplicationCommandType.User),k.z.literal(re.ApplicationCommandType.Message)]),Eo=k.z.boolean();function ae(e){Eo.parse(e)}o(ae,"validateDefaultPermission");function gt(e){wo.parse(e)}o(gt,"validateName");function Ot(e){vo.parse(e)}o(Ot,"validateType");function se(e,t){gt(e),Ot(t)}o(se,"validateRequiredParameters");var me=class{constructor(){i(this,"name");i(this,"type");i(this,"defaultPermission")}setName(t){return gt(t),Reflect.set(this,"name",t),this}setType(t){return Ot(t),Reflect.set(this,"type",t),this}setDefaultPermission(t){return ae(t),Reflect.set(this,"defaultPermission",t),this}toJSON(){return se(this.name,this.type),{name:this.name,type:this.type,default_permission:this.defaultPermission}}};o(me,"ContextMenuCommandBuilder");function No(e){return e!==null&&typeof e=="object"&&"toJSON"in e}o(No,"isJSONEncodable");module.exports=io(Bo);0&&(module.exports={ActionRow,ButtonComponent,Component,ComponentAssertions,ContextMenuCommandAssertions,ContextMenuCommandBuilder,Embed,EmbedAssertions,Faces,Modal,ModalAssertions,SelectMenuComponent,SelectMenuOption,SlashCommandAssertions,SlashCommandAttachmentOption,SlashCommandBooleanOption,SlashCommandBuilder,SlashCommandChannelOption,SlashCommandIntegerOption,SlashCommandMentionableOption,SlashCommandNumberOption,SlashCommandRoleOption,SlashCommandStringOption,SlashCommandSubcommandBuilder,SlashCommandSubcommandGroupBuilder,SlashCommandUserOption,TextInputAssertions,TextInputComponent,TimestampStyles,UnsafeButtonComponent,UnsafeEmbed,UnsafeModal,UnsafeSelectMenuComponent,UnsafeSelectMenuOption,UnsafeTextInputComponent,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