@discordjs/builders 0.13.0-dev.1645877056.a8321d8 → 0.13.0-dev.1646611698.b9ff7b0

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 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
@@ -890,18 +1061,12 @@ declare const allowedChannelTypes: readonly [ChannelType.GuildText, ChannelType.
890
1061
  declare type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];
891
1062
  declare class ApplicationCommandOptionChannelTypesMixin {
892
1063
  readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];
893
- /**
894
- * Adds a channel type to this option
895
- *
896
- * @param channelType The type of channel to allow
897
- */
898
- addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes): this;
899
1064
  /**
900
1065
  * Adds channel types to this option
901
1066
  *
902
1067
  * @param channelTypes The channel types to add
903
1068
  */
904
- addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
1069
+ addChannelTypes(...channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
905
1070
  }
906
1071
 
907
1072
  declare class SlashCommandChannelOption extends ApplicationCommandOptionBase {
@@ -930,12 +1095,6 @@ declare class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends
930
1095
  readonly choices?: APIApplicationCommandOptionChoice<T>[];
931
1096
  readonly autocomplete?: boolean;
932
1097
  readonly type: ApplicationCommandOptionType;
933
- /**
934
- * Adds a choice for this option
935
- *
936
- * @param choice The choice to add
937
- */
938
- addChoice(choice: APIApplicationCommandOptionChoice<T>): this;
939
1098
  /**
940
1099
  * Adds multiple choices for this option
941
1100
  *
@@ -1038,19 +1197,19 @@ declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
1038
1197
  *
1039
1198
  * @param input A function that returns an option builder, or an already built builder
1040
1199
  */
1041
- addStringOption(input: SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'> | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoice' | 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1200
+ addStringOption(input: SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'> | ((builder: SlashCommandStringOption) => SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1042
1201
  /**
1043
1202
  * Adds an integer option
1044
1203
  *
1045
1204
  * @param input A function that returns an option builder, or an already built builder
1046
1205
  */
1047
- addIntegerOption(input: SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'> | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoice' | 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1206
+ addIntegerOption(input: SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'> | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1048
1207
  /**
1049
1208
  * Adds a number option
1050
1209
  *
1051
1210
  * @param input A function that returns an option builder, or an already built builder
1052
1211
  */
1053
- addNumberOption(input: SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'> | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoice' | 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1212
+ addNumberOption(input: SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'> | ((builder: SlashCommandNumberOption) => SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, 'addChoices'>)): ShouldOmitSubcommandFunctions extends true ? Omit<this, "addSubcommand" | "addSubcommandGroup"> : this;
1054
1213
  private _sharedAddOptionMethod;
1055
1214
  }
1056
1215
 
@@ -1169,13 +1328,13 @@ declare function validateMaxOptionsLength(options: unknown): asserts options is
1169
1328
  declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
1170
1329
  declare function validateDefaultPermission$1(value: unknown): asserts value is boolean;
1171
1330
  declare function validateRequired(required: unknown): asserts required is boolean;
1172
- declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void;
1331
+ declare function validateChoicesLength(amountAdding: number, choices?: APIApplicationCommandOptionChoice[]): void;
1173
1332
  declare function assertReturnOfBuilder<T extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
1174
1333
 
1175
1334
  declare const Assertions$1_validateDescription: typeof validateDescription;
1176
1335
  declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
1177
1336
  declare const Assertions$1_validateRequired: typeof validateRequired;
1178
- declare const Assertions$1_validateMaxChoicesLength: typeof validateMaxChoicesLength;
1337
+ declare const Assertions$1_validateChoicesLength: typeof validateChoicesLength;
1179
1338
  declare const Assertions$1_assertReturnOfBuilder: typeof assertReturnOfBuilder;
1180
1339
  declare namespace Assertions$1 {
1181
1340
  export {
@@ -1185,7 +1344,7 @@ declare namespace Assertions$1 {
1185
1344
  validateRequiredParameters$1 as validateRequiredParameters,
1186
1345
  validateDefaultPermission$1 as validateDefaultPermission,
1187
1346
  Assertions$1_validateRequired as validateRequired,
1188
- Assertions$1_validateMaxChoicesLength as validateMaxChoicesLength,
1347
+ Assertions$1_validateChoicesLength as validateChoicesLength,
1189
1348
  Assertions$1_assertReturnOfBuilder as assertReturnOfBuilder,
1190
1349
  };
1191
1350
  }
@@ -1254,4 +1413,4 @@ declare namespace Assertions {
1254
1413
  };
1255
1414
  }
1256
1415
 
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 };
1416
+ 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 };