@discordjs/builders 2.0.0-dev.1757808111-126529f46 → 2.0.0-dev.1757851336-b66f52f9a

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.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as discord_api_types_v10 from 'discord-api-types/v10';
2
- import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APISelectMenuComponent, APISelectMenuOption, APIStringSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIUserSelectComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
2
+ import { APIButtonComponent, APIButtonComponentWithSKUId, APIMessageComponentEmoji, APIBaseComponent, ComponentType, APIButtonComponentWithCustomId, APIButtonComponentWithURL, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, ChannelType, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APISelectMenuOption, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APILabelComponent, APIFileComponent, APIMediaGalleryItem, APIMediaGalleryComponent, APITextDisplayComponent, APIThumbnailComponent, APISectionComponent, ButtonStyle, APISeparatorComponent, SeparatorSpacingSize, APIContainerComponent, APIActionRowComponent, APIComponentInMessageActionRow, APIComponentInContainer, APIModalComponent, APIMessageComponent, APISectionAccessoryComponent, APIComponentInActionRow, APIApplicationCommandIntegerOption, APIApplicationCommandChannelOption, APIApplicationCommandNumberOption, APIApplicationCommandStringOption, APIApplicationCommandOptionChoice, RESTPostAPIApplicationCommandsJSONBody, Locale, APIApplicationCommand, APIApplicationCommandBasicOption, APIApplicationCommandOption, ApplicationCommandOptionType, APIApplicationCommandSubcommandOption, APIApplicationCommandSubcommandGroupOption, InteractionContextType, ApplicationIntegrationType, Permissions, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody, APIModalInteractionResponseCallbackData, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbed, PollLayoutType, APIPollMedia, APIPartialEmoji, APIPollAnswer, RESTAPIPoll, APIAllowedMentions, AllowedMentionsTypes, MessageReferenceType, RESTAPIAttachment, RESTAPIMessageReference, RESTPostAPIChannelMessageJSONBody, APIMessageReference, APIMessageTopLevelComponent, APIAttachment, MessageFlags, APIPoll } from 'discord-api-types/v10';
3
3
  import { JSONEncodable } from '@discordjs/util';
4
4
  import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
5
5
  import * as zod from 'zod';
@@ -197,7 +197,7 @@ declare abstract class BaseSelectMenuBuilder<Data extends APISelectMenuComponent
197
197
  /**
198
198
  * @internal
199
199
  */
200
- protected abstract readonly data: Partial<Pick<Data, 'custom_id' | 'disabled' | 'id' | 'max_values' | 'min_values' | 'placeholder'>>;
200
+ protected abstract readonly data: Partial<Pick<Data, 'custom_id' | 'disabled' | 'id' | 'max_values' | 'min_values' | 'placeholder' | 'required'>>;
201
201
  /**
202
202
  * Sets the placeholder for this select menu.
203
203
  *
@@ -232,6 +232,176 @@ declare abstract class BaseSelectMenuBuilder<Data extends APISelectMenuComponent
232
232
  * @param disabled - Whether this select menu is disabled
233
233
  */
234
234
  setDisabled(disabled?: boolean): this;
235
+ /**
236
+ * Sets whether this select menu is required.
237
+ *
238
+ * @remarks Only for use in modals.
239
+ * @param required - Whether this string select menu is required
240
+ */
241
+ setRequired(required?: boolean): this;
242
+ }
243
+
244
+ /**
245
+ * A builder that creates API-compatible JSON data for channel select menus.
246
+ */
247
+ declare class ChannelSelectMenuBuilder extends BaseSelectMenuBuilder<APIChannelSelectComponent> {
248
+ protected readonly data: Partial<APIChannelSelectComponent>;
249
+ /**
250
+ * Creates a new channel select menu.
251
+ *
252
+ * @param data - The API data to create this channel select menu with
253
+ * @example
254
+ * Creating a select menu from an API data object:
255
+ * ```ts
256
+ * const selectMenu = new ChannelSelectMenuBuilder({
257
+ * custom_id: 'a cool select menu',
258
+ * placeholder: 'select an option',
259
+ * max_values: 2,
260
+ * });
261
+ * ```
262
+ * @example
263
+ * Creating a select menu using setters and API data:
264
+ * ```ts
265
+ * const selectMenu = new ChannelSelectMenuBuilder({
266
+ * custom_id: 'a cool select menu',
267
+ * })
268
+ * .addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
269
+ * .setMinValues(2);
270
+ * ```
271
+ */
272
+ constructor(data?: Partial<APIChannelSelectComponent>);
273
+ /**
274
+ * Adds channel types to this select menu.
275
+ *
276
+ * @param types - The channel types to use
277
+ */
278
+ addChannelTypes(...types: RestOrArray<ChannelType>): this;
279
+ /**
280
+ * Sets channel types for this select menu.
281
+ *
282
+ * @param types - The channel types to use
283
+ */
284
+ setChannelTypes(...types: RestOrArray<ChannelType>): this;
285
+ /**
286
+ * Adds default channels to this auto populated select menu.
287
+ *
288
+ * @param channels - The channels to add
289
+ */
290
+ addDefaultChannels(...channels: RestOrArray<Snowflake>): this;
291
+ /**
292
+ * Sets default channels for this auto populated select menu.
293
+ *
294
+ * @param channels - The channels to set
295
+ */
296
+ setDefaultChannels(...channels: RestOrArray<Snowflake>): this;
297
+ /**
298
+ * {@inheritDoc ComponentBuilder.toJSON}
299
+ */
300
+ toJSON(validationOverride?: boolean): APIChannelSelectComponent;
301
+ }
302
+
303
+ /**
304
+ * A builder that creates API-compatible JSON data for mentionable select menus.
305
+ */
306
+ declare class MentionableSelectMenuBuilder extends BaseSelectMenuBuilder<APIMentionableSelectComponent> {
307
+ protected readonly data: Partial<APIMentionableSelectComponent>;
308
+ /**
309
+ * Creates a new mentionable select menu.
310
+ *
311
+ * @param data - The API data to create this mentionable select menu with
312
+ * @example
313
+ * Creating a select menu from an API data object:
314
+ * ```ts
315
+ * const selectMenu = new MentionableSelectMenuBuilder({
316
+ * custom_id: 'a cool select menu',
317
+ * placeholder: 'select an option',
318
+ * max_values: 2,
319
+ * });
320
+ * ```
321
+ * @example
322
+ * Creating a select menu using setters and API data:
323
+ * ```ts
324
+ * const selectMenu = new MentionableSelectMenuBuilder({
325
+ * custom_id: 'a cool select menu',
326
+ * })
327
+ * .setMinValues(1);
328
+ * ```
329
+ */
330
+ constructor(data?: Partial<APIMentionableSelectComponent>);
331
+ /**
332
+ * Adds default roles to this auto populated select menu.
333
+ *
334
+ * @param roles - The roles to add
335
+ */
336
+ addDefaultRoles(...roles: RestOrArray<Snowflake>): this;
337
+ /**
338
+ * Adds default users to this auto populated select menu.
339
+ *
340
+ * @param users - The users to add
341
+ */
342
+ addDefaultUsers(...users: RestOrArray<Snowflake>): this;
343
+ /**
344
+ * Adds default values to this auto populated select menu.
345
+ *
346
+ * @param values - The values to add
347
+ */
348
+ addDefaultValues(...values: RestOrArray<APISelectMenuDefaultValue<SelectMenuDefaultValueType.Role> | APISelectMenuDefaultValue<SelectMenuDefaultValueType.User>>): this;
349
+ /**
350
+ * Sets default values for this auto populated select menu.
351
+ *
352
+ * @param values - The values to set
353
+ */
354
+ setDefaultValues(...values: RestOrArray<APISelectMenuDefaultValue<SelectMenuDefaultValueType.Role> | APISelectMenuDefaultValue<SelectMenuDefaultValueType.User>>): this;
355
+ /**
356
+ * {@inheritDoc ComponentBuilder.toJSON}
357
+ */
358
+ toJSON(validationOverride?: boolean): APIMentionableSelectComponent;
359
+ }
360
+
361
+ /**
362
+ * A builder that creates API-compatible JSON data for role select menus.
363
+ */
364
+ declare class RoleSelectMenuBuilder extends BaseSelectMenuBuilder<APIRoleSelectComponent> {
365
+ protected readonly data: Partial<APIRoleSelectComponent>;
366
+ /**
367
+ * Creates a new role select menu.
368
+ *
369
+ * @param data - The API data to create this role select menu with
370
+ * @example
371
+ * Creating a select menu from an API data object:
372
+ * ```ts
373
+ * const selectMenu = new RoleSelectMenuBuilder({
374
+ * custom_id: 'a cool select menu',
375
+ * placeholder: 'select an option',
376
+ * max_values: 2,
377
+ * });
378
+ * ```
379
+ * @example
380
+ * Creating a select menu using setters and API data:
381
+ * ```ts
382
+ * const selectMenu = new RoleSelectMenuBuilder({
383
+ * custom_id: 'a cool select menu',
384
+ * })
385
+ * .setMinValues(1);
386
+ * ```
387
+ */
388
+ constructor(data?: Partial<APIRoleSelectComponent>);
389
+ /**
390
+ * Adds default roles to this auto populated select menu.
391
+ *
392
+ * @param roles - The roles to add
393
+ */
394
+ addDefaultRoles(...roles: RestOrArray<Snowflake>): this;
395
+ /**
396
+ * Sets default roles for this auto populated select menu.
397
+ *
398
+ * @param roles - The roles to set
399
+ */
400
+ setDefaultRoles(...roles: RestOrArray<Snowflake>): this;
401
+ /**
402
+ * {@inheritDoc ComponentBuilder.toJSON}
403
+ */
404
+ toJSON(validationOverride?: boolean): APIRoleSelectComponent;
235
405
  }
236
406
 
237
407
  /**
@@ -392,16 +562,55 @@ declare class StringSelectMenuBuilder extends BaseSelectMenuBuilder<APIStringSel
392
562
  */
393
563
  spliceOptions(index: number, deleteCount: number, ...options: (APISelectMenuOption | StringSelectMenuOptionBuilder | ((builder: StringSelectMenuOptionBuilder) => StringSelectMenuOptionBuilder))[]): this;
394
564
  /**
395
- * Sets whether this string select menu is required.
565
+ * {@inheritDoc ComponentBuilder.toJSON}
566
+ */
567
+ toJSON(validationOverride?: boolean): APIStringSelectComponent;
568
+ }
569
+
570
+ /**
571
+ * A builder that creates API-compatible JSON data for user select menus.
572
+ */
573
+ declare class UserSelectMenuBuilder extends BaseSelectMenuBuilder<APIUserSelectComponent> {
574
+ protected readonly data: Partial<APIUserSelectComponent>;
575
+ /**
576
+ * Creates a new user select menu.
396
577
  *
397
- * @remarks Only for use in modals.
398
- * @param required - Whether this string select menu is required
578
+ * @param data - The API data to create this user select menu with
579
+ * @example
580
+ * Creating a select menu from an API data object:
581
+ * ```ts
582
+ * const selectMenu = new UserSelectMenuBuilder({
583
+ * custom_id: 'a cool select menu',
584
+ * placeholder: 'select an option',
585
+ * max_values: 2,
586
+ * });
587
+ * ```
588
+ * @example
589
+ * Creating a select menu using setters and API data:
590
+ * ```ts
591
+ * const selectMenu = new UserSelectMenuBuilder({
592
+ * custom_id: 'a cool select menu',
593
+ * })
594
+ * .setMinValues(1);
595
+ * ```
399
596
  */
400
- setRequired(required?: boolean): this;
597
+ constructor(data?: Partial<APIUserSelectComponent>);
598
+ /**
599
+ * Adds default users to this auto populated select menu.
600
+ *
601
+ * @param users - The users to add
602
+ */
603
+ addDefaultUsers(...users: RestOrArray<Snowflake>): this;
604
+ /**
605
+ * Sets default users for this auto populated select menu.
606
+ *
607
+ * @param users - The users to set
608
+ */
609
+ setDefaultUsers(...users: RestOrArray<Snowflake>): this;
401
610
  /**
402
611
  * {@inheritDoc ComponentBuilder.toJSON}
403
612
  */
404
- toJSON(validationOverride?: boolean): APIStringSelectComponent;
613
+ toJSON(validationOverride?: boolean): APIUserSelectComponent;
405
614
  }
406
615
 
407
616
  /**
@@ -501,7 +710,7 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> {
501
710
  }
502
711
 
503
712
  interface LabelBuilderData extends Partial<Omit<APILabelComponent, 'component'>> {
504
- component?: StringSelectMenuBuilder | TextInputBuilder;
713
+ component?: ChannelSelectMenuBuilder | MentionableSelectMenuBuilder | RoleSelectMenuBuilder | StringSelectMenuBuilder | TextInputBuilder | UserSelectMenuBuilder;
505
714
  }
506
715
  /**
507
716
  * A builder that creates API-compatible JSON data for labels.
@@ -555,6 +764,30 @@ declare class LabelBuilder extends ComponentBuilder<APILabelComponent> {
555
764
  * @param input - A function that returns a component builder or an already built builder
556
765
  */
557
766
  setStringSelectMenuComponent(input: APIStringSelectComponent | StringSelectMenuBuilder | ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder)): this;
767
+ /**
768
+ * Sets a user select menu component to this label.
769
+ *
770
+ * @param input - A function that returns a component builder or an already built builder
771
+ */
772
+ setUserSelectMenuComponent(input: APIUserSelectComponent | UserSelectMenuBuilder | ((builder: UserSelectMenuBuilder) => UserSelectMenuBuilder)): this;
773
+ /**
774
+ * Sets a role select menu component to this label.
775
+ *
776
+ * @param input - A function that returns a component builder or an already built builder
777
+ */
778
+ setRoleSelectMenuComponent(input: APIRoleSelectComponent | RoleSelectMenuBuilder | ((builder: RoleSelectMenuBuilder) => RoleSelectMenuBuilder)): this;
779
+ /**
780
+ * Sets a mentionable select menu component to this label.
781
+ *
782
+ * @param input - A function that returns a component builder or an already built builder
783
+ */
784
+ setMentionableSelectMenuComponent(input: APIMentionableSelectComponent | MentionableSelectMenuBuilder | ((builder: MentionableSelectMenuBuilder) => MentionableSelectMenuBuilder)): this;
785
+ /**
786
+ * Sets a channel select menu component to this label.
787
+ *
788
+ * @param input - A function that returns a component builder or an already built builder
789
+ */
790
+ setChannelSelectMenuComponent(input: APIChannelSelectComponent | ChannelSelectMenuBuilder | ((builder: ChannelSelectMenuBuilder) => ChannelSelectMenuBuilder)): this;
558
791
  /**
559
792
  * Sets a text input component to this label.
560
793
  *
@@ -598,218 +831,54 @@ declare const labelPredicate: z.ZodObject<{
598
831
  placeholder: z.ZodOptional<z.ZodString>;
599
832
  value: z.ZodOptional<z.ZodString>;
600
833
  required: z.ZodOptional<z.ZodBoolean>;
834
+ }, z.core.$strip>, z.ZodObject<{
835
+ placeholder: z.ZodOptional<z.ZodString>;
836
+ min_values: z.ZodOptional<z.ZodNumber>;
837
+ max_values: z.ZodOptional<z.ZodNumber>;
838
+ custom_id: z.ZodString;
839
+ disabled: z.ZodOptional<z.ZodBoolean>;
840
+ type: z.ZodLiteral<ComponentType.UserSelect>;
841
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
842
+ id: z.ZodString;
843
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.User>;
844
+ }, z.core.$strip>>>;
845
+ }, z.core.$strip>, z.ZodObject<{
846
+ placeholder: z.ZodOptional<z.ZodString>;
847
+ min_values: z.ZodOptional<z.ZodNumber>;
848
+ max_values: z.ZodOptional<z.ZodNumber>;
849
+ custom_id: z.ZodString;
850
+ disabled: z.ZodOptional<z.ZodBoolean>;
851
+ type: z.ZodLiteral<ComponentType.RoleSelect>;
852
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
853
+ id: z.ZodString;
854
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Role>;
855
+ }, z.core.$strip>>>;
856
+ }, z.core.$strip>, z.ZodObject<{
857
+ placeholder: z.ZodOptional<z.ZodString>;
858
+ min_values: z.ZodOptional<z.ZodNumber>;
859
+ max_values: z.ZodOptional<z.ZodNumber>;
860
+ custom_id: z.ZodString;
861
+ disabled: z.ZodOptional<z.ZodBoolean>;
862
+ type: z.ZodLiteral<ComponentType.MentionableSelect>;
863
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
864
+ id: z.ZodString;
865
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Role | discord_api_types_v10.SelectMenuDefaultValueType.User>;
866
+ }, z.core.$strip>>>;
867
+ }, z.core.$strip>, z.ZodObject<{
868
+ placeholder: z.ZodOptional<z.ZodString>;
869
+ min_values: z.ZodOptional<z.ZodNumber>;
870
+ max_values: z.ZodOptional<z.ZodNumber>;
871
+ custom_id: z.ZodString;
872
+ disabled: z.ZodOptional<z.ZodBoolean>;
873
+ type: z.ZodLiteral<ComponentType.ChannelSelect>;
874
+ channel_types: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof discord_api_types_v10.ChannelType>>>;
875
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
876
+ id: z.ZodString;
877
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
878
+ }, z.core.$strip>>>;
601
879
  }, z.core.$strip>]>;
602
880
  }, z.core.$strip>;
603
881
 
604
- /**
605
- * A builder that creates API-compatible JSON data for channel select menus.
606
- */
607
- declare class ChannelSelectMenuBuilder extends BaseSelectMenuBuilder<APIChannelSelectComponent> {
608
- protected readonly data: Partial<APIChannelSelectComponent>;
609
- /**
610
- * Creates a new channel select menu.
611
- *
612
- * @param data - The API data to create this channel select menu with
613
- * @example
614
- * Creating a select menu from an API data object:
615
- * ```ts
616
- * const selectMenu = new ChannelSelectMenuBuilder({
617
- * custom_id: 'a cool select menu',
618
- * placeholder: 'select an option',
619
- * max_values: 2,
620
- * });
621
- * ```
622
- * @example
623
- * Creating a select menu using setters and API data:
624
- * ```ts
625
- * const selectMenu = new ChannelSelectMenuBuilder({
626
- * custom_id: 'a cool select menu',
627
- * })
628
- * .addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
629
- * .setMinValues(2);
630
- * ```
631
- */
632
- constructor(data?: Partial<APIChannelSelectComponent>);
633
- /**
634
- * Adds channel types to this select menu.
635
- *
636
- * @param types - The channel types to use
637
- */
638
- addChannelTypes(...types: RestOrArray<ChannelType>): this;
639
- /**
640
- * Sets channel types for this select menu.
641
- *
642
- * @param types - The channel types to use
643
- */
644
- setChannelTypes(...types: RestOrArray<ChannelType>): this;
645
- /**
646
- * Adds default channels to this auto populated select menu.
647
- *
648
- * @param channels - The channels to add
649
- */
650
- addDefaultChannels(...channels: RestOrArray<Snowflake>): this;
651
- /**
652
- * Sets default channels for this auto populated select menu.
653
- *
654
- * @param channels - The channels to set
655
- */
656
- setDefaultChannels(...channels: RestOrArray<Snowflake>): this;
657
- /**
658
- * {@inheritDoc ComponentBuilder.toJSON}
659
- */
660
- toJSON(validationOverride?: boolean): APIChannelSelectComponent;
661
- }
662
-
663
- /**
664
- * A builder that creates API-compatible JSON data for mentionable select menus.
665
- */
666
- declare class MentionableSelectMenuBuilder extends BaseSelectMenuBuilder<APIMentionableSelectComponent> {
667
- protected readonly data: Partial<APIMentionableSelectComponent>;
668
- /**
669
- * Creates a new mentionable select menu.
670
- *
671
- * @param data - The API data to create this mentionable select menu with
672
- * @example
673
- * Creating a select menu from an API data object:
674
- * ```ts
675
- * const selectMenu = new MentionableSelectMenuBuilder({
676
- * custom_id: 'a cool select menu',
677
- * placeholder: 'select an option',
678
- * max_values: 2,
679
- * });
680
- * ```
681
- * @example
682
- * Creating a select menu using setters and API data:
683
- * ```ts
684
- * const selectMenu = new MentionableSelectMenuBuilder({
685
- * custom_id: 'a cool select menu',
686
- * })
687
- * .setMinValues(1);
688
- * ```
689
- */
690
- constructor(data?: Partial<APIMentionableSelectComponent>);
691
- /**
692
- * Adds default roles to this auto populated select menu.
693
- *
694
- * @param roles - The roles to add
695
- */
696
- addDefaultRoles(...roles: RestOrArray<Snowflake>): this;
697
- /**
698
- * Adds default users to this auto populated select menu.
699
- *
700
- * @param users - The users to add
701
- */
702
- addDefaultUsers(...users: RestOrArray<Snowflake>): this;
703
- /**
704
- * Adds default values to this auto populated select menu.
705
- *
706
- * @param values - The values to add
707
- */
708
- addDefaultValues(...values: RestOrArray<APISelectMenuDefaultValue<SelectMenuDefaultValueType.Role> | APISelectMenuDefaultValue<SelectMenuDefaultValueType.User>>): this;
709
- /**
710
- * Sets default values for this auto populated select menu.
711
- *
712
- * @param values - The values to set
713
- */
714
- setDefaultValues(...values: RestOrArray<APISelectMenuDefaultValue<SelectMenuDefaultValueType.Role> | APISelectMenuDefaultValue<SelectMenuDefaultValueType.User>>): this;
715
- /**
716
- * {@inheritDoc ComponentBuilder.toJSON}
717
- */
718
- toJSON(validationOverride?: boolean): APIMentionableSelectComponent;
719
- }
720
-
721
- /**
722
- * A builder that creates API-compatible JSON data for role select menus.
723
- */
724
- declare class RoleSelectMenuBuilder extends BaseSelectMenuBuilder<APIRoleSelectComponent> {
725
- protected readonly data: Partial<APIRoleSelectComponent>;
726
- /**
727
- * Creates a new role select menu.
728
- *
729
- * @param data - The API data to create this role select menu with
730
- * @example
731
- * Creating a select menu from an API data object:
732
- * ```ts
733
- * const selectMenu = new RoleSelectMenuBuilder({
734
- * custom_id: 'a cool select menu',
735
- * placeholder: 'select an option',
736
- * max_values: 2,
737
- * });
738
- * ```
739
- * @example
740
- * Creating a select menu using setters and API data:
741
- * ```ts
742
- * const selectMenu = new RoleSelectMenuBuilder({
743
- * custom_id: 'a cool select menu',
744
- * })
745
- * .setMinValues(1);
746
- * ```
747
- */
748
- constructor(data?: Partial<APIRoleSelectComponent>);
749
- /**
750
- * Adds default roles to this auto populated select menu.
751
- *
752
- * @param roles - The roles to add
753
- */
754
- addDefaultRoles(...roles: RestOrArray<Snowflake>): this;
755
- /**
756
- * Sets default roles for this auto populated select menu.
757
- *
758
- * @param roles - The roles to set
759
- */
760
- setDefaultRoles(...roles: RestOrArray<Snowflake>): this;
761
- /**
762
- * {@inheritDoc ComponentBuilder.toJSON}
763
- */
764
- toJSON(validationOverride?: boolean): APIRoleSelectComponent;
765
- }
766
-
767
- /**
768
- * A builder that creates API-compatible JSON data for user select menus.
769
- */
770
- declare class UserSelectMenuBuilder extends BaseSelectMenuBuilder<APIUserSelectComponent> {
771
- protected readonly data: Partial<APIUserSelectComponent>;
772
- /**
773
- * Creates a new user select menu.
774
- *
775
- * @param data - The API data to create this user select menu with
776
- * @example
777
- * Creating a select menu from an API data object:
778
- * ```ts
779
- * const selectMenu = new UserSelectMenuBuilder({
780
- * custom_id: 'a cool select menu',
781
- * placeholder: 'select an option',
782
- * max_values: 2,
783
- * });
784
- * ```
785
- * @example
786
- * Creating a select menu using setters and API data:
787
- * ```ts
788
- * const selectMenu = new UserSelectMenuBuilder({
789
- * custom_id: 'a cool select menu',
790
- * })
791
- * .setMinValues(1);
792
- * ```
793
- */
794
- constructor(data?: Partial<APIUserSelectComponent>);
795
- /**
796
- * Adds default users to this auto populated select menu.
797
- *
798
- * @param users - The users to add
799
- */
800
- addDefaultUsers(...users: RestOrArray<Snowflake>): this;
801
- /**
802
- * Sets default users for this auto populated select menu.
803
- *
804
- * @param users - The users to set
805
- */
806
- setDefaultUsers(...users: RestOrArray<Snowflake>): this;
807
- /**
808
- * {@inheritDoc ComponentBuilder.toJSON}
809
- */
810
- toJSON(validationOverride?: boolean): APIUserSelectComponent;
811
- }
812
-
813
882
  declare const textInputPredicate: z.ZodObject<{
814
883
  type: z.ZodLiteral<ComponentType.TextInput>;
815
884
  custom_id: z.ZodString;
@@ -1414,6 +1483,10 @@ type ModalActionRowComponentBuilder = TextInputBuilder;
1414
1483
  * Any action row component builder.
1415
1484
  */
1416
1485
  type AnyActionRowComponentBuilder = MessageActionRowComponentBuilder | ModalActionRowComponentBuilder;
1486
+ /**
1487
+ * Any modal component builder.
1488
+ */
1489
+ type AnyModalComponentBuilder = LabelBuilder | TextDisplayBuilder;
1417
1490
  /**
1418
1491
  * Components here are mapped to their respective builder.
1419
1492
  */
@@ -2824,12 +2897,59 @@ declare const modalPredicate: z.ZodObject<{
2824
2897
  placeholder: z.ZodOptional<z.ZodString>;
2825
2898
  value: z.ZodOptional<z.ZodString>;
2826
2899
  required: z.ZodOptional<z.ZodBoolean>;
2900
+ }, z.core.$strip>, z.ZodObject<{
2901
+ placeholder: z.ZodOptional<z.ZodString>;
2902
+ min_values: z.ZodOptional<z.ZodNumber>;
2903
+ max_values: z.ZodOptional<z.ZodNumber>;
2904
+ custom_id: z.ZodString;
2905
+ disabled: z.ZodOptional<z.ZodBoolean>;
2906
+ type: z.ZodLiteral<ComponentType.UserSelect>;
2907
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
2908
+ id: z.ZodString;
2909
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.User>;
2910
+ }, z.core.$strip>>>;
2911
+ }, z.core.$strip>, z.ZodObject<{
2912
+ placeholder: z.ZodOptional<z.ZodString>;
2913
+ min_values: z.ZodOptional<z.ZodNumber>;
2914
+ max_values: z.ZodOptional<z.ZodNumber>;
2915
+ custom_id: z.ZodString;
2916
+ disabled: z.ZodOptional<z.ZodBoolean>;
2917
+ type: z.ZodLiteral<ComponentType.RoleSelect>;
2918
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
2919
+ id: z.ZodString;
2920
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Role>;
2921
+ }, z.core.$strip>>>;
2922
+ }, z.core.$strip>, z.ZodObject<{
2923
+ placeholder: z.ZodOptional<z.ZodString>;
2924
+ min_values: z.ZodOptional<z.ZodNumber>;
2925
+ max_values: z.ZodOptional<z.ZodNumber>;
2926
+ custom_id: z.ZodString;
2927
+ disabled: z.ZodOptional<z.ZodBoolean>;
2928
+ type: z.ZodLiteral<ComponentType.MentionableSelect>;
2929
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
2930
+ id: z.ZodString;
2931
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Role | discord_api_types_v10.SelectMenuDefaultValueType.User>;
2932
+ }, z.core.$strip>>>;
2933
+ }, z.core.$strip>, z.ZodObject<{
2934
+ placeholder: z.ZodOptional<z.ZodString>;
2935
+ min_values: z.ZodOptional<z.ZodNumber>;
2936
+ max_values: z.ZodOptional<z.ZodNumber>;
2937
+ custom_id: z.ZodString;
2938
+ disabled: z.ZodOptional<z.ZodBoolean>;
2939
+ type: z.ZodLiteral<ComponentType.ChannelSelect>;
2940
+ channel_types: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof discord_api_types_v10.ChannelType>>>;
2941
+ default_values: z.ZodOptional<z.ZodArray<z.ZodObject<{
2942
+ id: z.ZodString;
2943
+ type: z.ZodLiteral<discord_api_types_v10.SelectMenuDefaultValueType.Channel>;
2944
+ }, z.core.$strip>>>;
2827
2945
  }, z.core.$strip>]>;
2946
+ }, z.core.$strip>, z.ZodObject<{
2947
+ content: z.ZodString;
2828
2948
  }, z.core.$strip>]>>;
2829
2949
  }, z.core.$strip>;
2830
2950
 
2831
2951
  interface ModalBuilderData extends Partial<Omit<APIModalInteractionResponseCallbackData, 'components'>> {
2832
- components: (ActionRowBuilder | LabelBuilder)[];
2952
+ components: (ActionRowBuilder | AnyModalComponentBuilder)[];
2833
2953
  }
2834
2954
  /**
2835
2955
  * A builder that creates API-compatible JSON data for modals.
@@ -2842,7 +2962,7 @@ declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseC
2842
2962
  /**
2843
2963
  * The components within this modal.
2844
2964
  */
2845
- get components(): readonly (ActionRowBuilder | LabelBuilder)[];
2965
+ get components(): readonly (ActionRowBuilder | AnyModalComponentBuilder)[];
2846
2966
  /**
2847
2967
  * Creates a new modal.
2848
2968
  *
@@ -2868,41 +2988,41 @@ declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseC
2868
2988
  */
2869
2989
  addLabelComponents(...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>): this;
2870
2990
  /**
2871
- * Sets the labels for this modal.
2991
+ * Adds text display components to this modal.
2872
2992
  *
2873
- * @param components - The components to set
2993
+ * @param components - The components to add
2874
2994
  */
2875
- setLabelComponents(...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>): this;
2995
+ addTextDisplayComponents(...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
2876
2996
  /**
2877
- * Removes, replaces, or inserts labels for this modal.
2997
+ * Removes, replaces, or inserts components for this modal.
2878
2998
  *
2879
2999
  * @remarks
2880
3000
  * This method behaves similarly
2881
3001
  * to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
2882
- * The maximum amount of labels that can be added is 5.
3002
+ * The maximum amount of components that can be added is 5.
2883
3003
  *
2884
- * It's useful for modifying and adjusting order of the already-existing labels of a modal.
3004
+ * It's useful for modifying and adjusting order of the already-existing components of a modal.
2885
3005
  * @example
2886
- * Remove the first label:
3006
+ * Remove the first component:
2887
3007
  * ```ts
2888
- * modal.spliceLabelComponents(0, 1);
3008
+ * modal.spliceComponents(0, 1);
2889
3009
  * ```
2890
3010
  * @example
2891
- * Remove the first n labels:
3011
+ * Remove the first n components:
2892
3012
  * ```ts
2893
3013
  * const n = 4;
2894
- * modal.spliceLabelComponents(0, n);
3014
+ * modal.spliceComponents(0, n);
2895
3015
  * ```
2896
3016
  * @example
2897
- * Remove the last label:
3017
+ * Remove the last component:
2898
3018
  * ```ts
2899
- * modal.spliceLabelComponents(-1, 1);
3019
+ * modal.spliceComponents(-1, 1);
2900
3020
  * ```
2901
3021
  * @param index - The index to start at
2902
- * @param deleteCount - The number of labels to remove
2903
- * @param labels - The replacing label objects
3022
+ * @param deleteCount - The number of components to remove
3023
+ * @param components - The replacing components
2904
3024
  */
2905
- spliceLabelComponents(index: number, deleteCount: number, ...labels: (APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder))[]): this;
3025
+ spliceComponents(index: number, deleteCount: number, ...components: AnyModalComponentBuilder[]): this;
2906
3026
  /**
2907
3027
  * Serializes this builder to API-compatible JSON data.
2908
3028
  *
@@ -4399,4 +4519,4 @@ declare const localeMapPredicate: z.ZodObject<Record<Locale, z.ZodOptional<z.Zod
4399
4519
  */
4400
4520
  declare const version: string;
4401
4521
 
4402
- export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };
4522
+ export { ActionRowBuilder, type ActionRowBuilderData, AllowedMentionsBuilder, type AnyActionRowComponentBuilder, type AnyModalComponentBuilder, type ApplicationCommandNumericOptionMinMaxValueData, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelType, ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, type ApplicationCommandOptionBaseData, type ApplicationCommandOptionChannelTypesData, ApplicationCommandOptionChannelTypesMixin, type ApplicationCommandOptionWithAutocompleteData, ApplicationCommandOptionWithAutocompleteMixin, type ApplicationCommandOptionWithChoicesData, ApplicationCommandOptionWithChoicesMixin, AttachmentBuilder, type AutocompletableOptions, BaseButtonBuilder, BaseSelectMenuBuilder, type ButtonBuilder, ChannelSelectMenuBuilder, ChatInputCommandAttachmentOption, ChatInputCommandBooleanOption, ChatInputCommandBuilder, ChatInputCommandChannelOption, ChatInputCommandIntegerOption, ChatInputCommandMentionableOption, ChatInputCommandNumberOption, ChatInputCommandRoleOption, ChatInputCommandStringOption, ChatInputCommandSubcommandBuilder, ChatInputCommandSubcommandGroupBuilder, type ChatInputCommandSubcommandGroupData, ChatInputCommandUserOption, CommandBuilder, type CommandData, ComponentBuilder, type ComponentBuilderBaseData, ContainerBuilder, type ContainerBuilderData, type ContainerComponentBuilders, ContextMenuCommandBuilder, type ContextMenuCommandType, CustomIdButtonBuilder, type CustomIdButtonStyle, DangerButtonBuilder, EmbedAuthorBuilder, EmbedBuilder, type EmbedBuilderData, EmbedFieldBuilder, EmbedFooterBuilder, type EmojiOrLabelButtonData, EmojiOrLabelButtonMixin, FileBuilder, LabelBuilder, type LabelBuilderData, LinkButtonBuilder, type MappedComponentTypes, MediaGalleryBuilder, type MediaGalleryBuilderData, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, MessageBuilder, type MessageBuilderData, type MessageComponentBuilder, MessageContextCommandBuilder, MessageReferenceBuilder, type MessageTopLevelComponentBuilder, type ModalActionRowComponentBuilder, ModalBuilder, type ModalBuilderData, type ModalComponentBuilder, PollAnswerBuilder, type PollAnswerData, PollAnswerMediaBuilder, PollBuilder, type PollData, PollMediaBuilder, PollQuestionBuilder, PremiumButtonBuilder, PrimaryButtonBuilder, type RestOrArray, RoleSelectMenuBuilder, SecondaryButtonBuilder, SectionBuilder, type SectionBuilderAccessory, type SectionBuilderData, SeparatorBuilder, SharedChatInputCommandOptions, type SharedChatInputCommandOptionsData, SharedChatInputCommandSubcommands, type SharedChatInputCommandSubcommandsData, SharedName, SharedNameAndDescription, type SharedNameAndDescriptionData, type SharedNameData, StringSelectMenuBuilder, type StringSelectMenuData, StringSelectMenuOptionBuilder, SuccessButtonBuilder, TextDisplayBuilder, TextInputBuilder, ThumbnailBuilder, UserContextCommandBuilder, UserSelectMenuBuilder, ValidationError, actionRowPredicate, allowedMentionPredicate, attachmentPredicate, basicOptionPredicate, buttonPredicate, channelOptionPredicate, chatInputCommandPredicate, chatInputCommandSubcommandGroupPredicate, chatInputCommandSubcommandPredicate, containerPredicate, createComponentBuilder, customIdPredicate, disableValidators, embedAuthorPredicate, embedFieldPredicate, embedFooterPredicate, embedLength, embedPredicate, emojiPredicate, enableValidators, filePredicate, integerOptionPredicate, isValidationEnabled, labelPredicate, localeMapPredicate, mediaGalleryItemPredicate, mediaGalleryPredicate, memberPermissionsPredicate, messageCommandPredicate, messagePredicate, messageReferencePredicate, modalPredicate, normalizeArray, numberOptionPredicate, pollAnswerMediaPredicate, pollAnswerPredicate, pollPredicate, pollQuestionPredicate, resolveAccessoryComponent, resolveBuilder, sectionPredicate, selectMenuChannelPredicate, selectMenuMentionablePredicate, selectMenuRolePredicate, selectMenuStringOptionPredicate, selectMenuStringPredicate, selectMenuUserPredicate, separatorPredicate, stringOptionPredicate, textDisplayPredicate, textInputPredicate, thumbnailPredicate, userCommandPredicate, version };