@discordjs/builders 0.13.0-dev.1646222605.53defb8 → 0.13.0-dev.1646654924.b162f27
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 +258 -93
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
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,
|
|
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$
|
|
48
|
-
declare const Assertions$
|
|
49
|
-
declare const Assertions$
|
|
50
|
-
declare const Assertions$
|
|
51
|
-
declare const Assertions$
|
|
52
|
-
declare const Assertions$
|
|
53
|
-
declare const Assertions$
|
|
54
|
-
declare const Assertions$
|
|
55
|
-
declare const Assertions$
|
|
56
|
-
declare const Assertions$
|
|
57
|
-
declare const Assertions$
|
|
58
|
-
declare const Assertions$
|
|
59
|
-
declare const Assertions$
|
|
60
|
-
declare const Assertions$
|
|
61
|
-
declare const Assertions$
|
|
62
|
-
declare namespace Assertions$
|
|
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$
|
|
65
|
-
Assertions$
|
|
66
|
-
Assertions$
|
|
67
|
-
Assertions$
|
|
68
|
-
Assertions$
|
|
69
|
-
Assertions$
|
|
70
|
-
Assertions$
|
|
71
|
-
Assertions$
|
|
72
|
-
Assertions$
|
|
73
|
-
Assertions$
|
|
74
|
-
Assertions$
|
|
75
|
-
Assertions$
|
|
76
|
-
Assertions$
|
|
77
|
-
Assertions$
|
|
78
|
-
Assertions$
|
|
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
|
|
|
@@ -568,7 +568,7 @@ declare const emojiValidator: z.ZodObject<{
|
|
|
568
568
|
declare const disabledValidator: z.ZodBoolean;
|
|
569
569
|
declare const buttonLabelValidator: z.ZodString;
|
|
570
570
|
declare const buttonStyleValidator: z.ZodNumber;
|
|
571
|
-
declare const placeholderValidator: z.ZodString;
|
|
571
|
+
declare const placeholderValidator$1: z.ZodString;
|
|
572
572
|
declare const minMaxValidator: z.ZodNumber;
|
|
573
573
|
declare const optionsValidator: z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "atleastone">;
|
|
574
574
|
declare function validateRequiredSelectMenuParameters(options: SelectMenuOption[], customId?: string): void;
|
|
@@ -578,36 +578,35 @@ declare function validateRequiredSelectMenuOptionParameters(label?: string, valu
|
|
|
578
578
|
declare const urlValidator: z.ZodString;
|
|
579
579
|
declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, url?: string): void;
|
|
580
580
|
|
|
581
|
-
declare const Assertions$
|
|
582
|
-
declare const Assertions$
|
|
583
|
-
declare const Assertions$
|
|
584
|
-
declare const Assertions$
|
|
585
|
-
declare const Assertions$
|
|
586
|
-
declare const Assertions$
|
|
587
|
-
declare const Assertions$
|
|
588
|
-
declare const Assertions$
|
|
589
|
-
declare const Assertions$
|
|
590
|
-
declare const Assertions$
|
|
591
|
-
declare const Assertions$
|
|
592
|
-
declare const Assertions$
|
|
593
|
-
declare const Assertions$
|
|
594
|
-
declare
|
|
595
|
-
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 {
|
|
596
595
|
export {
|
|
597
|
-
Assertions$
|
|
598
|
-
Assertions$
|
|
599
|
-
Assertions$
|
|
600
|
-
Assertions$
|
|
601
|
-
Assertions$
|
|
602
|
-
|
|
603
|
-
Assertions$
|
|
604
|
-
Assertions$
|
|
605
|
-
Assertions$
|
|
606
|
-
Assertions$
|
|
607
|
-
Assertions$
|
|
608
|
-
Assertions$
|
|
609
|
-
Assertions$
|
|
610
|
-
Assertions$
|
|
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,
|
|
611
610
|
};
|
|
612
611
|
}
|
|
613
612
|
|
|
@@ -628,13 +627,13 @@ declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSO
|
|
|
628
627
|
*/
|
|
629
628
|
declare abstract class Component<DataType extends Partial<APIBaseComponent<ComponentType>> & {
|
|
630
629
|
type: ComponentType;
|
|
631
|
-
} = APIBaseComponent<ComponentType>> implements JSONEncodable<APIMessageComponent
|
|
630
|
+
} = APIBaseComponent<ComponentType>> implements JSONEncodable<APIModalComponent | APIMessageComponent | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>>, Equatable<Component | APIActionRowComponentTypes | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>> {
|
|
632
631
|
/**
|
|
633
632
|
* The API data associated with this component
|
|
634
633
|
*/
|
|
635
634
|
readonly data: DataType;
|
|
636
|
-
abstract toJSON():
|
|
637
|
-
abstract equals(other: Component | APIActionRowComponentTypes): boolean;
|
|
635
|
+
abstract toJSON(): APIActionRowComponentTypes | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>;
|
|
636
|
+
abstract equals(other: Component | APIActionRowComponentTypes | APIActionRowComponent<APIModalActionRowComponent | APIMessageActionRowComponent>): boolean;
|
|
638
637
|
constructor(data: DataType);
|
|
639
638
|
/**
|
|
640
639
|
* The type of this component
|
|
@@ -642,19 +641,21 @@ declare abstract class Component<DataType extends Partial<APIBaseComponent<Compo
|
|
|
642
641
|
get type(): DataType['type'];
|
|
643
642
|
}
|
|
644
643
|
|
|
645
|
-
declare type MessageComponent =
|
|
646
|
-
declare type
|
|
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;
|
|
647
648
|
/**
|
|
648
649
|
* Represents an action row component
|
|
649
650
|
*/
|
|
650
|
-
declare class ActionRow<T extends
|
|
651
|
+
declare class ActionRow<T extends ModalActionRowComponent | MessageActionRowComponent = ModalActionRowComponent | MessageActionRowComponent> extends Component<Omit<Partial<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>> & {
|
|
651
652
|
type: ComponentType.ActionRow;
|
|
652
653
|
}, 'components'>> {
|
|
653
654
|
/**
|
|
654
655
|
* The components within this action row
|
|
655
656
|
*/
|
|
656
657
|
readonly components: T[];
|
|
657
|
-
constructor({ components, ...data }?: Partial<APIActionRowComponent<
|
|
658
|
+
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>>);
|
|
658
659
|
/**
|
|
659
660
|
* Adds components to this action row.
|
|
660
661
|
* @param components The components to add to this action row.
|
|
@@ -666,8 +667,8 @@ declare class ActionRow<T extends ActionRowComponent = ActionRowComponent> exten
|
|
|
666
667
|
* @param components The components to set this row to
|
|
667
668
|
*/
|
|
668
669
|
setComponents(...components: T[]): this;
|
|
669
|
-
toJSON(): APIActionRowComponent<
|
|
670
|
-
equals(other: APIActionRowComponent<
|
|
670
|
+
toJSON(): APIActionRowComponent<ReturnType<T['toJSON']>>;
|
|
671
|
+
equals(other: APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent> | ActionRow): boolean;
|
|
671
672
|
}
|
|
672
673
|
|
|
673
674
|
/**
|
|
@@ -752,15 +753,191 @@ interface MappedComponentTypes {
|
|
|
752
753
|
[ComponentType.ActionRow]: ActionRow;
|
|
753
754
|
[ComponentType.Button]: ButtonComponent;
|
|
754
755
|
[ComponentType.SelectMenu]: SelectMenuComponent;
|
|
756
|
+
[ComponentType.TextInput]: TextInputComponent;
|
|
755
757
|
}
|
|
756
758
|
/**
|
|
757
759
|
* Factory for creating components from API data
|
|
758
760
|
* @param data The api data to transform to a component class
|
|
759
761
|
*/
|
|
760
|
-
declare function createComponent<T extends keyof MappedComponentTypes>(data: APIMessageComponent & {
|
|
762
|
+
declare function createComponent<T extends keyof MappedComponentTypes>(data: (APIMessageComponent | APIModalComponent) & {
|
|
761
763
|
type: T;
|
|
762
764
|
}): MappedComponentTypes[T];
|
|
763
|
-
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
|
+
}
|
|
764
941
|
|
|
765
942
|
/**
|
|
766
943
|
* Represents a non-validated select menu component
|
|
@@ -884,18 +1061,12 @@ declare const allowedChannelTypes: readonly [ChannelType.GuildText, ChannelType.
|
|
|
884
1061
|
declare type ApplicationCommandOptionAllowedChannelTypes = typeof allowedChannelTypes[number];
|
|
885
1062
|
declare class ApplicationCommandOptionChannelTypesMixin {
|
|
886
1063
|
readonly channel_types?: ApplicationCommandOptionAllowedChannelTypes[];
|
|
887
|
-
/**
|
|
888
|
-
* Adds a channel type to this option
|
|
889
|
-
*
|
|
890
|
-
* @param channelType The type of channel to allow
|
|
891
|
-
*/
|
|
892
|
-
addChannelType(channelType: ApplicationCommandOptionAllowedChannelTypes): this;
|
|
893
1064
|
/**
|
|
894
1065
|
* Adds channel types to this option
|
|
895
1066
|
*
|
|
896
1067
|
* @param channelTypes The channel types to add
|
|
897
1068
|
*/
|
|
898
|
-
addChannelTypes(channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
|
|
1069
|
+
addChannelTypes(...channelTypes: ApplicationCommandOptionAllowedChannelTypes[]): this;
|
|
899
1070
|
}
|
|
900
1071
|
|
|
901
1072
|
declare class SlashCommandChannelOption extends ApplicationCommandOptionBase {
|
|
@@ -924,12 +1095,6 @@ declare class ApplicationCommandOptionWithChoicesAndAutocompleteMixin<T extends
|
|
|
924
1095
|
readonly choices?: APIApplicationCommandOptionChoice<T>[];
|
|
925
1096
|
readonly autocomplete?: boolean;
|
|
926
1097
|
readonly type: ApplicationCommandOptionType;
|
|
927
|
-
/**
|
|
928
|
-
* Adds a choice for this option
|
|
929
|
-
*
|
|
930
|
-
* @param choice The choice to add
|
|
931
|
-
*/
|
|
932
|
-
addChoice(choice: APIApplicationCommandOptionChoice<T>): this;
|
|
933
1098
|
/**
|
|
934
1099
|
* Adds multiple choices for this option
|
|
935
1100
|
*
|
|
@@ -1032,19 +1197,19 @@ declare class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
|
|
|
1032
1197
|
*
|
|
1033
1198
|
* @param input A function that returns an option builder, or an already built builder
|
|
1034
1199
|
*/
|
|
1035
|
-
addStringOption(input: SlashCommandStringOption | Omit<SlashCommandStringOption, 'setAutocomplete'> | Omit<SlashCommandStringOption, '
|
|
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;
|
|
1036
1201
|
/**
|
|
1037
1202
|
* Adds an integer option
|
|
1038
1203
|
*
|
|
1039
1204
|
* @param input A function that returns an option builder, or an already built builder
|
|
1040
1205
|
*/
|
|
1041
|
-
addIntegerOption(input: SlashCommandIntegerOption | Omit<SlashCommandIntegerOption, 'setAutocomplete'> | Omit<SlashCommandIntegerOption, '
|
|
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;
|
|
1042
1207
|
/**
|
|
1043
1208
|
* Adds a number option
|
|
1044
1209
|
*
|
|
1045
1210
|
* @param input A function that returns an option builder, or an already built builder
|
|
1046
1211
|
*/
|
|
1047
|
-
addNumberOption(input: SlashCommandNumberOption | Omit<SlashCommandNumberOption, 'setAutocomplete'> | Omit<SlashCommandNumberOption, '
|
|
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;
|
|
1048
1213
|
private _sharedAddOptionMethod;
|
|
1049
1214
|
}
|
|
1050
1215
|
|
|
@@ -1163,13 +1328,13 @@ declare function validateMaxOptionsLength(options: unknown): asserts options is
|
|
|
1163
1328
|
declare function validateRequiredParameters$1(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void;
|
|
1164
1329
|
declare function validateDefaultPermission$1(value: unknown): asserts value is boolean;
|
|
1165
1330
|
declare function validateRequired(required: unknown): asserts required is boolean;
|
|
1166
|
-
declare function
|
|
1331
|
+
declare function validateChoicesLength(amountAdding: number, choices?: APIApplicationCommandOptionChoice[]): void;
|
|
1167
1332
|
declare function assertReturnOfBuilder<T extends ApplicationCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T;
|
|
1168
1333
|
|
|
1169
1334
|
declare const Assertions$1_validateDescription: typeof validateDescription;
|
|
1170
1335
|
declare const Assertions$1_validateMaxOptionsLength: typeof validateMaxOptionsLength;
|
|
1171
1336
|
declare const Assertions$1_validateRequired: typeof validateRequired;
|
|
1172
|
-
declare const Assertions$
|
|
1337
|
+
declare const Assertions$1_validateChoicesLength: typeof validateChoicesLength;
|
|
1173
1338
|
declare const Assertions$1_assertReturnOfBuilder: typeof assertReturnOfBuilder;
|
|
1174
1339
|
declare namespace Assertions$1 {
|
|
1175
1340
|
export {
|
|
@@ -1179,7 +1344,7 @@ declare namespace Assertions$1 {
|
|
|
1179
1344
|
validateRequiredParameters$1 as validateRequiredParameters,
|
|
1180
1345
|
validateDefaultPermission$1 as validateDefaultPermission,
|
|
1181
1346
|
Assertions$1_validateRequired as validateRequired,
|
|
1182
|
-
Assertions$
|
|
1347
|
+
Assertions$1_validateChoicesLength as validateChoicesLength,
|
|
1183
1348
|
Assertions$1_assertReturnOfBuilder as assertReturnOfBuilder,
|
|
1184
1349
|
};
|
|
1185
1350
|
}
|
|
@@ -1248,4 +1413,4 @@ declare namespace Assertions {
|
|
|
1248
1413
|
};
|
|
1249
1414
|
}
|
|
1250
1415
|
|
|
1251
|
-
export { ActionRow,
|
|
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 };
|