@discordjs/builders 2.0.0-dev.1748606728-762bbc652 → 2.0.0-dev.1748909649-d40ceedad

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.js CHANGED
@@ -571,9 +571,9 @@ var ChannelSelectMenuBuilder = class extends BaseSelectMenuBuilder {
571
571
  }
572
572
  data;
573
573
  /**
574
- * Creates a new select menu from API data.
574
+ * Creates a new channel select menu.
575
575
  *
576
- * @param data - The API data to create this select menu with
576
+ * @param data - The API data to create this channel select menu with
577
577
  * @example
578
578
  * Creating a select menu from an API data object:
579
579
  * ```ts
@@ -666,9 +666,9 @@ var MentionableSelectMenuBuilder = class extends BaseSelectMenuBuilder {
666
666
  }
667
667
  data;
668
668
  /**
669
- * Creates a new select menu from API data.
669
+ * Creates a new mentionable select menu.
670
670
  *
671
- * @param data - The API data to create this select menu with
671
+ * @param data - The API data to create this mentionable select menu with
672
672
  * @example
673
673
  * Creating a select menu from an API data object:
674
674
  * ```ts
@@ -762,9 +762,9 @@ var RoleSelectMenuBuilder = class extends BaseSelectMenuBuilder {
762
762
  }
763
763
  data;
764
764
  /**
765
- * Creates a new select menu from API data.
765
+ * Creates a new role select menu.
766
766
  *
767
- * @param data - The API data to create this select menu with
767
+ * @param data - The API data to create this role select menu with
768
768
  * @example
769
769
  * Creating a select menu from an API data object:
770
770
  * ```ts
@@ -852,7 +852,7 @@ var StringSelectMenuOptionBuilder = class {
852
852
  }
853
853
  data;
854
854
  /**
855
- * Creates a new string select menu option from API data.
855
+ * Creates a new string select menu option.
856
856
  *
857
857
  * @param data - The API data to create this string select menu option with
858
858
  * @example
@@ -958,9 +958,9 @@ var StringSelectMenuBuilder = class extends BaseSelectMenuBuilder {
958
958
  return this.data.options;
959
959
  }
960
960
  /**
961
- * Creates a new select menu from API data.
961
+ * Creates a new string select menu.
962
962
  *
963
- * @param data - The API data to create this select menu with
963
+ * @param data - The API data to create this string select menu with
964
964
  * @example
965
965
  * Creating a select menu from an API data object:
966
966
  * ```ts
@@ -988,10 +988,11 @@ var StringSelectMenuBuilder = class extends BaseSelectMenuBuilder {
988
988
  * });
989
989
  * ```
990
990
  */
991
- constructor({ options = [], ...data } = {}) {
991
+ constructor(data = {}) {
992
992
  super();
993
+ const { options = [], ...rest } = data;
993
994
  this.data = {
994
- ...structuredClone(data),
995
+ ...structuredClone(rest),
995
996
  options: options.map((option) => new StringSelectMenuOptionBuilder(option)),
996
997
  type: import_v109.ComponentType.StringSelect
997
998
  };
@@ -1071,9 +1072,9 @@ var UserSelectMenuBuilder = class extends BaseSelectMenuBuilder {
1071
1072
  }
1072
1073
  data;
1073
1074
  /**
1074
- * Creates a new select menu from API data.
1075
+ * Creates a new user select menu.
1075
1076
  *
1076
- * @param data - The API data to create this select menu with
1077
+ * @param data - The API data to create this user select menu with
1077
1078
  * @example
1078
1079
  * Creating a select menu from an API data object:
1079
1080
  * ```ts
@@ -1158,9 +1159,12 @@ var TextInputBuilder = class extends ComponentBuilder {
1158
1159
  static {
1159
1160
  __name(this, "TextInputBuilder");
1160
1161
  }
1162
+ /**
1163
+ * @internal
1164
+ */
1161
1165
  data;
1162
1166
  /**
1163
- * Creates a new text input from API data.
1167
+ * Creates a new text input.
1164
1168
  *
1165
1169
  * @param data - The API data to create this text input with
1166
1170
  * @example
@@ -1370,9 +1374,12 @@ var FileBuilder = class extends ComponentBuilder {
1370
1374
  static {
1371
1375
  __name(this, "FileBuilder");
1372
1376
  }
1377
+ /**
1378
+ * @internal
1379
+ */
1373
1380
  data;
1374
1381
  /**
1375
- * Creates a new file from API data.
1382
+ * Creates a new file.
1376
1383
  *
1377
1384
  * @param data - The API data to create this file with
1378
1385
  * @example
@@ -1398,9 +1405,10 @@ var FileBuilder = class extends ComponentBuilder {
1398
1405
  */
1399
1406
  constructor(data = {}) {
1400
1407
  super();
1408
+ const { file, ...rest } = data;
1401
1409
  this.data = {
1402
- ...structuredClone(data),
1403
- file: data.file ? { url: data.file.url } : void 0,
1410
+ ...structuredClone(rest),
1411
+ file: file && { url: file.url },
1404
1412
  type: import_v1014.ComponentType.File
1405
1413
  };
1406
1414
  }
@@ -1442,7 +1450,7 @@ var MediaGalleryItemBuilder = class {
1442
1450
  }
1443
1451
  data;
1444
1452
  /**
1445
- * Creates a new media gallery item from API data.
1453
+ * Creates a new media gallery item.
1446
1454
  *
1447
1455
  * @param data - The API data to create this media gallery item with
1448
1456
  * @example
@@ -1467,9 +1475,7 @@ var MediaGalleryItemBuilder = class {
1467
1475
  * ```
1468
1476
  */
1469
1477
  constructor(data = {}) {
1470
- this.data = {
1471
- ...structuredClone(data)
1472
- };
1478
+ this.data = structuredClone(data);
1473
1479
  }
1474
1480
  /**
1475
1481
  * Sets the source URL of this media gallery item.
@@ -1520,9 +1526,18 @@ var MediaGalleryBuilder = class extends ComponentBuilder {
1520
1526
  static {
1521
1527
  __name(this, "MediaGalleryBuilder");
1522
1528
  }
1529
+ /**
1530
+ * @internal
1531
+ */
1523
1532
  data;
1524
1533
  /**
1525
- * Creates a new media gallery from API data.
1534
+ * The items in this media gallery.
1535
+ */
1536
+ get items() {
1537
+ return this.data.items;
1538
+ }
1539
+ /**
1540
+ * Creates a new media gallery.
1526
1541
  *
1527
1542
  * @param data - The API data to create this container with
1528
1543
  * @example
@@ -1557,17 +1572,13 @@ var MediaGalleryBuilder = class extends ComponentBuilder {
1557
1572
  */
1558
1573
  constructor(data = {}) {
1559
1574
  super();
1575
+ const { items = [], ...rest } = data;
1560
1576
  this.data = {
1561
- items: data?.items?.map((item) => new MediaGalleryItemBuilder(item)) ?? [],
1577
+ ...structuredClone(rest),
1578
+ items: items.map((item) => new MediaGalleryItemBuilder(item)),
1562
1579
  type: import_v1015.ComponentType.MediaGallery
1563
1580
  };
1564
1581
  }
1565
- /**
1566
- * The items in this media gallery.
1567
- */
1568
- get items() {
1569
- return this.data.items;
1570
- }
1571
1582
  /**
1572
1583
  * Adds a media gallery item to this media gallery.
1573
1584
  *
@@ -1615,9 +1626,12 @@ var TextDisplayBuilder = class extends ComponentBuilder {
1615
1626
  static {
1616
1627
  __name(this, "TextDisplayBuilder");
1617
1628
  }
1629
+ /**
1630
+ * @internal
1631
+ */
1618
1632
  data;
1619
1633
  /**
1620
- * Creates a new text display from API data.
1634
+ * Creates a new text display.
1621
1635
  *
1622
1636
  * @param data - The API data to create this text display with
1623
1637
  * @example
@@ -1668,9 +1682,12 @@ var ThumbnailBuilder = class extends ComponentBuilder {
1668
1682
  static {
1669
1683
  __name(this, "ThumbnailBuilder");
1670
1684
  }
1685
+ /**
1686
+ * @internal
1687
+ */
1671
1688
  data;
1672
1689
  /**
1673
- * Creates a new thumbnail from API data.
1690
+ * Creates a new thumbnail.
1674
1691
  *
1675
1692
  * @param data - The API data to create this thumbnail with
1676
1693
  * @example
@@ -1696,9 +1713,10 @@ var ThumbnailBuilder = class extends ComponentBuilder {
1696
1713
  */
1697
1714
  constructor(data = {}) {
1698
1715
  super();
1716
+ const { media, ...rest } = data;
1699
1717
  this.data = {
1700
- ...structuredClone(data),
1701
- media: data.media ? { url: data.media.url } : void 0,
1718
+ ...structuredClone(rest),
1719
+ media: media && { url: media.url },
1702
1720
  type: import_v1017.ComponentType.Thumbnail
1703
1721
  };
1704
1722
  }
@@ -1751,12 +1769,18 @@ var SectionBuilder = class extends ComponentBuilder {
1751
1769
  static {
1752
1770
  __name(this, "SectionBuilder");
1753
1771
  }
1772
+ /**
1773
+ * @internal
1774
+ */
1754
1775
  data;
1776
+ /**
1777
+ * The components within this section.
1778
+ */
1755
1779
  get components() {
1756
1780
  return this.data.components;
1757
1781
  }
1758
1782
  /**
1759
- * Creates a new section from API data.
1783
+ * Creates a new section.
1760
1784
  *
1761
1785
  * @param data - The API data to create this section with
1762
1786
  * @example
@@ -1795,7 +1819,7 @@ var SectionBuilder = class extends ComponentBuilder {
1795
1819
  const { components = [], accessory, ...rest } = data;
1796
1820
  this.data = {
1797
1821
  ...structuredClone(rest),
1798
- accessory: accessory ? resolveAccessoryComponent(accessory) : void 0,
1822
+ accessory: accessory && resolveAccessoryComponent(accessory),
1799
1823
  components: components.map((component) => new TextDisplayBuilder(component)),
1800
1824
  type: import_v1018.ComponentType.Section
1801
1825
  };
@@ -1915,9 +1939,12 @@ var SeparatorBuilder = class extends ComponentBuilder {
1915
1939
  static {
1916
1940
  __name(this, "SeparatorBuilder");
1917
1941
  }
1942
+ /**
1943
+ * @internal
1944
+ */
1918
1945
  data;
1919
1946
  /**
1920
- * Creates a new separator from API data.
1947
+ * Creates a new separator.
1921
1948
  *
1922
1949
  * @param data - The API data to create this separator with
1923
1950
  * @example
@@ -1984,9 +2011,24 @@ var ContainerBuilder = class extends ComponentBuilder {
1984
2011
  static {
1985
2012
  __name(this, "ContainerBuilder");
1986
2013
  }
2014
+ /**
2015
+ * @internal
2016
+ */
1987
2017
  data;
1988
- constructor({ components = [], ...rest } = {}) {
2018
+ /**
2019
+ * Gets the components within this container.
2020
+ */
2021
+ get components() {
2022
+ return this.data.components;
2023
+ }
2024
+ /**
2025
+ * Creates a new container builder.
2026
+ *
2027
+ * @param data - The API data to create the container with
2028
+ */
2029
+ constructor(data = {}) {
1989
2030
  super();
2031
+ const { components = [], ...rest } = data;
1990
2032
  this.data = {
1991
2033
  ...structuredClone(rest),
1992
2034
  components: components.map((component) => createComponentBuilder(component)),
@@ -2211,6 +2253,9 @@ var ActionRowBuilder = class extends ComponentBuilder {
2211
2253
  static {
2212
2254
  __name(this, "ActionRowBuilder");
2213
2255
  }
2256
+ /**
2257
+ * @internal
2258
+ */
2214
2259
  data;
2215
2260
  /**
2216
2261
  * The components within this action row.
@@ -2219,7 +2264,7 @@ var ActionRowBuilder = class extends ComponentBuilder {
2219
2264
  return this.data.components;
2220
2265
  }
2221
2266
  /**
2222
- * Creates a new action row from API data.
2267
+ * Creates a new action row.
2223
2268
  *
2224
2269
  * @param data - The API data to create this action row with
2225
2270
  * @example
@@ -2252,12 +2297,13 @@ var ActionRowBuilder = class extends ComponentBuilder {
2252
2297
  * .addComponents(button2, button3);
2253
2298
  * ```
2254
2299
  */
2255
- constructor({ components = [], ...data } = {}) {
2300
+ constructor(data = {}) {
2256
2301
  super();
2302
+ const { components = [], ...rest } = data;
2257
2303
  this.data = {
2258
- ...structuredClone(data),
2259
- type: import_v1022.ComponentType.ActionRow,
2260
- components: components.map((component) => createComponentBuilder(component))
2304
+ ...structuredClone(rest),
2305
+ components: components.map((component) => createComponentBuilder(component)),
2306
+ type: import_v1022.ComponentType.ActionRow
2261
2307
  };
2262
2308
  }
2263
2309
  /**
@@ -2561,6 +2607,9 @@ var SharedName = class {
2561
2607
  static {
2562
2608
  __name(this, "SharedName");
2563
2609
  }
2610
+ /**
2611
+ * @internal
2612
+ */
2564
2613
  data = {};
2565
2614
  /**
2566
2615
  * Sets the name of this command.
@@ -2615,6 +2664,9 @@ var SharedNameAndDescription = class extends SharedName {
2615
2664
  static {
2616
2665
  __name(this, "SharedNameAndDescription");
2617
2666
  }
2667
+ /**
2668
+ * @internal
2669
+ */
2618
2670
  data = {};
2619
2671
  /**
2620
2672
  * Sets the description of this command.
@@ -2774,7 +2826,15 @@ var ApplicationCommandOptionBase = class extends SharedNameAndDescription {
2774
2826
  static {
2775
2827
  __name(this, "ApplicationCommandOptionBase");
2776
2828
  }
2829
+ /**
2830
+ * @internal
2831
+ */
2777
2832
  static predicate = basicOptionPredicate;
2833
+ /**
2834
+ * Creates a new application command option builder.
2835
+ *
2836
+ * @param type - The type of the option
2837
+ */
2778
2838
  constructor(type) {
2779
2839
  super();
2780
2840
  this.data.type = type;
@@ -2807,6 +2867,9 @@ var ChatInputCommandAttachmentOption = class extends ApplicationCommandOptionBas
2807
2867
  static {
2808
2868
  __name(this, "ChatInputCommandAttachmentOption");
2809
2869
  }
2870
+ /**
2871
+ * Creates a new attachment option.
2872
+ */
2810
2873
  constructor() {
2811
2874
  super(import_v1025.ApplicationCommandOptionType.Attachment);
2812
2875
  }
@@ -2818,6 +2881,9 @@ var ChatInputCommandBooleanOption = class extends ApplicationCommandOptionBase {
2818
2881
  static {
2819
2882
  __name(this, "ChatInputCommandBooleanOption");
2820
2883
  }
2884
+ /**
2885
+ * Creates a new boolean option.
2886
+ */
2821
2887
  constructor() {
2822
2888
  super(import_v1026.ApplicationCommandOptionType.Boolean);
2823
2889
  }
@@ -2833,7 +2899,13 @@ var ChatInputCommandChannelOption = class extends (0, import_ts_mixer3.Mixin)(
2833
2899
  static {
2834
2900
  __name(this, "ChatInputCommandChannelOption");
2835
2901
  }
2902
+ /**
2903
+ * @internal
2904
+ */
2836
2905
  static predicate = channelOptionPredicate;
2906
+ /**
2907
+ * Creates a new channel option.
2908
+ */
2837
2909
  constructor() {
2838
2910
  super(import_v1027.ApplicationCommandOptionType.Channel);
2839
2911
  }
@@ -2851,7 +2923,13 @@ var ChatInputCommandIntegerOption = class extends (0, import_ts_mixer4.Mixin)(
2851
2923
  static {
2852
2924
  __name(this, "ChatInputCommandIntegerOption");
2853
2925
  }
2926
+ /**
2927
+ * @internal
2928
+ */
2854
2929
  static predicate = integerOptionPredicate;
2930
+ /**
2931
+ * Creates a new integer option.
2932
+ */
2855
2933
  constructor() {
2856
2934
  super(import_v1028.ApplicationCommandOptionType.Integer);
2857
2935
  }
@@ -2863,6 +2941,9 @@ var ChatInputCommandMentionableOption = class extends ApplicationCommandOptionBa
2863
2941
  static {
2864
2942
  __name(this, "ChatInputCommandMentionableOption");
2865
2943
  }
2944
+ /**
2945
+ * Creates a new mentionable option.
2946
+ */
2866
2947
  constructor() {
2867
2948
  super(import_v1029.ApplicationCommandOptionType.Mentionable);
2868
2949
  }
@@ -2880,7 +2961,13 @@ var ChatInputCommandNumberOption = class extends (0, import_ts_mixer5.Mixin)(
2880
2961
  static {
2881
2962
  __name(this, "ChatInputCommandNumberOption");
2882
2963
  }
2964
+ /**
2965
+ * @internal
2966
+ */
2883
2967
  static predicate = numberOptionPredicate;
2968
+ /**
2969
+ * Creates a new number option.
2970
+ */
2884
2971
  constructor() {
2885
2972
  super(import_v1030.ApplicationCommandOptionType.Number);
2886
2973
  }
@@ -2892,6 +2979,9 @@ var ChatInputCommandRoleOption = class extends ApplicationCommandOptionBase {
2892
2979
  static {
2893
2980
  __name(this, "ChatInputCommandRoleOption");
2894
2981
  }
2982
+ /**
2983
+ * Creates a new role option.
2984
+ */
2895
2985
  constructor() {
2896
2986
  super(import_v1031.ApplicationCommandOptionType.Role);
2897
2987
  }
@@ -2908,7 +2998,13 @@ var ChatInputCommandStringOption = class extends (0, import_ts_mixer6.Mixin)(
2908
2998
  static {
2909
2999
  __name(this, "ChatInputCommandStringOption");
2910
3000
  }
3001
+ /**
3002
+ * @internal
3003
+ */
2911
3004
  static predicate = stringOptionPredicate;
3005
+ /**
3006
+ * Creates a new string option builder.
3007
+ */
2912
3008
  constructor() {
2913
3009
  super(import_v1032.ApplicationCommandOptionType.String);
2914
3010
  }
@@ -2952,6 +3048,9 @@ var ChatInputCommandUserOption = class extends ApplicationCommandOptionBase {
2952
3048
  static {
2953
3049
  __name(this, "ChatInputCommandUserOption");
2954
3050
  }
3051
+ /**
3052
+ * Creates a new user option.
3053
+ */
2955
3054
  constructor() {
2956
3055
  super(import_v1033.ApplicationCommandOptionType.User);
2957
3056
  }
@@ -2962,6 +3061,9 @@ var SharedChatInputCommandOptions = class {
2962
3061
  static {
2963
3062
  __name(this, "SharedChatInputCommandOptions");
2964
3063
  }
3064
+ /**
3065
+ * The options within this command.
3066
+ */
2965
3067
  get options() {
2966
3068
  return this.data.options ??= [];
2967
3069
  }
@@ -3091,6 +3193,9 @@ var ChatInputCommandSubcommandGroupBuilder = class extends SharedNameAndDescript
3091
3193
  static {
3092
3194
  __name(this, "ChatInputCommandSubcommandGroupBuilder");
3093
3195
  }
3196
+ /**
3197
+ * The options within this subcommand group.
3198
+ */
3094
3199
  get options() {
3095
3200
  return this.data.options ??= [];
3096
3201
  }
@@ -3290,7 +3395,17 @@ var ContextMenuCommandBuilder = class extends (0, import_ts_mixer9.Mixin)(
3290
3395
  static {
3291
3396
  __name(this, "ContextMenuCommandBuilder");
3292
3397
  }
3398
+ /**
3399
+ * The API data associated with this context menu command.
3400
+ *
3401
+ * @internal
3402
+ */
3293
3403
  data;
3404
+ /**
3405
+ * Creates a new context menu command.
3406
+ *
3407
+ * @param data - The API data to create this context menu command with
3408
+ */
3294
3409
  constructor(data = {}) {
3295
3410
  super();
3296
3411
  this.data = structuredClone(data);
@@ -3358,13 +3473,14 @@ var ModalBuilder = class {
3358
3473
  return this.data.components;
3359
3474
  }
3360
3475
  /**
3361
- * Creates a new modal from API data.
3476
+ * Creates a new modal.
3362
3477
  *
3363
3478
  * @param data - The API data to create this modal with
3364
3479
  */
3365
- constructor({ components = [], ...data } = {}) {
3480
+ constructor(data = {}) {
3481
+ const { components = [], ...rest } = data;
3366
3482
  this.data = {
3367
- ...structuredClone(data),
3483
+ ...structuredClone(rest),
3368
3484
  components: components.map((component) => createComponentBuilder(component))
3369
3485
  };
3370
3486
  }
@@ -3511,14 +3627,17 @@ var EmbedAuthorBuilder = class {
3511
3627
  static {
3512
3628
  __name(this, "EmbedAuthorBuilder");
3513
3629
  }
3630
+ /**
3631
+ * The API data associated with this embed author.
3632
+ */
3514
3633
  data;
3515
3634
  /**
3516
- * Creates a new embed author from API data.
3635
+ * Creates a new embed author.
3517
3636
  *
3518
- * @param data - The API data to use
3637
+ * @param data - The API data to create this embed author with
3519
3638
  */
3520
- constructor(data) {
3521
- this.data = structuredClone(data) ?? {};
3639
+ constructor(data = {}) {
3640
+ this.data = structuredClone(data);
3522
3641
  }
3523
3642
  /**
3524
3643
  * Sets the name for this embed author.
@@ -3580,14 +3699,17 @@ var EmbedFieldBuilder = class {
3580
3699
  static {
3581
3700
  __name(this, "EmbedFieldBuilder");
3582
3701
  }
3702
+ /**
3703
+ * The API data associated with this embed field.
3704
+ */
3583
3705
  data;
3584
3706
  /**
3585
- * Creates a new embed field from API data.
3707
+ * Creates a new embed field.
3586
3708
  *
3587
- * @param data - The API data to use
3709
+ * @param data - The API data to create this embed field with
3588
3710
  */
3589
- constructor(data) {
3590
- this.data = structuredClone(data) ?? {};
3711
+ constructor(data = {}) {
3712
+ this.data = structuredClone(data);
3591
3713
  }
3592
3714
  /**
3593
3715
  * Sets the name for this embed field.
@@ -3635,14 +3757,17 @@ var EmbedFooterBuilder = class {
3635
3757
  static {
3636
3758
  __name(this, "EmbedFooterBuilder");
3637
3759
  }
3760
+ /**
3761
+ * The API data associated with this embed footer.
3762
+ */
3638
3763
  data;
3639
3764
  /**
3640
- * Creates a new embed footer from API data.
3765
+ * Creates a new embed footer.
3641
3766
  *
3642
- * @param data - The API data to use
3767
+ * @param data - The API data to create this embed footer with
3643
3768
  */
3644
- constructor(data) {
3645
- this.data = structuredClone(data) ?? {};
3769
+ constructor(data = {}) {
3770
+ this.data = structuredClone(data);
3646
3771
  }
3647
3772
  /**
3648
3773
  * Sets the text for this embed footer.
@@ -3699,16 +3824,17 @@ var EmbedBuilder = class {
3699
3824
  return this.data.fields;
3700
3825
  }
3701
3826
  /**
3702
- * Creates a new embed from API data.
3827
+ * Creates a new embed.
3703
3828
  *
3704
3829
  * @param data - The API data to create this embed with
3705
3830
  */
3706
3831
  constructor(data = {}) {
3832
+ const { author, fields = [], footer, ...rest } = data;
3707
3833
  this.data = {
3708
- ...structuredClone(data),
3709
- author: data.author && new EmbedAuthorBuilder(data.author),
3710
- fields: data.fields?.map((field) => new EmbedFieldBuilder(field)) ?? [],
3711
- footer: data.footer && new EmbedFooterBuilder(data.footer)
3834
+ ...structuredClone(rest),
3835
+ author: author && new EmbedAuthorBuilder(author),
3836
+ fields: fields.map((field) => new EmbedFieldBuilder(field)),
3837
+ footer: footer && new EmbedFooterBuilder(footer)
3712
3838
  };
3713
3839
  }
3714
3840
  /**
@@ -3963,9 +4089,9 @@ var EmbedBuilder = class {
3963
4089
  const data = {
3964
4090
  ...structuredClone(rest),
3965
4091
  // Disable validation because the embedPredicate below will validate those as well
3966
- author: this.data.author?.toJSON(false),
3967
- fields: this.data.fields?.map((field) => field.toJSON(false)),
3968
- footer: this.data.footer?.toJSON(false)
4092
+ author: author?.toJSON(false),
4093
+ fields: fields.map((field) => field.toJSON(false)),
4094
+ footer: footer?.toJSON(false)
3969
4095
  };
3970
4096
  validate(embedPredicate, data, validationOverride);
3971
4097
  return data;
@@ -3996,12 +4122,14 @@ var PollMediaBuilder = class {
3996
4122
  }
3997
4123
  /**
3998
4124
  * The API data associated with this poll media.
4125
+ *
4126
+ * @internal
3999
4127
  */
4000
4128
  data;
4001
4129
  /**
4002
- * Creates new poll media from API data.
4130
+ * Creates new poll media.
4003
4131
  *
4004
- * @param data - The API data to use
4132
+ * @param data - The API data to create this poll media with
4005
4133
  */
4006
4134
  constructor(data = {}) {
4007
4135
  this.data = structuredClone(data);
@@ -4058,14 +4186,15 @@ var PollAnswerBuilder = class {
4058
4186
  */
4059
4187
  data;
4060
4188
  /**
4061
- * Creates a new poll answer from API data.
4189
+ * Creates a new poll answer.
4062
4190
  *
4063
4191
  * @param data - The API data to create this poll answer with
4064
4192
  */
4065
4193
  constructor(data = {}) {
4194
+ const { poll_media, ...rest } = data;
4066
4195
  this.data = {
4067
- ...structuredClone(data),
4068
- poll_media: new PollAnswerMediaBuilder(data.poll_media)
4196
+ ...structuredClone(rest),
4197
+ poll_media: new PollAnswerMediaBuilder(poll_media)
4069
4198
  };
4070
4199
  }
4071
4200
  /**
@@ -4136,15 +4265,16 @@ var PollBuilder = class {
4136
4265
  return this.data.answers;
4137
4266
  }
4138
4267
  /**
4139
- * Creates a new poll from API data.
4268
+ * Creates a new poll.
4140
4269
  *
4141
4270
  * @param data - The API data to create this poll with
4142
4271
  */
4143
4272
  constructor(data = {}) {
4273
+ const { question, answers = [], ...rest } = data;
4144
4274
  this.data = {
4145
- ...structuredClone(data),
4146
- question: new PollQuestionBuilder(data.question),
4147
- answers: data.answers?.map((answer) => new PollAnswerBuilder(answer)) ?? []
4275
+ ...structuredClone(rest),
4276
+ question: new PollQuestionBuilder(question),
4277
+ answers: answers.map((answer) => new PollAnswerBuilder(answer))
4148
4278
  };
4149
4279
  }
4150
4280
  /**
@@ -4407,11 +4537,14 @@ var AllowedMentionsBuilder = class {
4407
4537
  static {
4408
4538
  __name(this, "AllowedMentionsBuilder");
4409
4539
  }
4540
+ /**
4541
+ * The API data associated with these allowed mentions.
4542
+ */
4410
4543
  data;
4411
4544
  /**
4412
- * Creates a new allowed mentions builder from API data.
4545
+ * Creates a new allowed mentions builder.
4413
4546
  *
4414
- * @param data - The API data to create this allowed mentions builder with
4547
+ * @param data - The API data to create this allowed mentions with
4415
4548
  */
4416
4549
  constructor(data = {}) {
4417
4550
  this.data = structuredClone(data);
@@ -4578,11 +4711,14 @@ var AttachmentBuilder = class {
4578
4711
  static {
4579
4712
  __name(this, "AttachmentBuilder");
4580
4713
  }
4714
+ /**
4715
+ * The API data associated with this attachment.
4716
+ */
4581
4717
  data;
4582
4718
  /**
4583
- * Creates a new attachment builder from API data.
4719
+ * Creates a new attachment builder.
4584
4720
  *
4585
- * @param data - The API data to create this attachment builder with
4721
+ * @param data - The API data to create this attachment with
4586
4722
  */
4587
4723
  constructor(data = {}) {
4588
4724
  this.data = structuredClone(data);
@@ -4695,11 +4831,14 @@ var MessageReferenceBuilder = class {
4695
4831
  static {
4696
4832
  __name(this, "MessageReferenceBuilder");
4697
4833
  }
4834
+ /**
4835
+ * The API data associated with this message reference.
4836
+ */
4698
4837
  data;
4699
4838
  /**
4700
- * Creates a new message reference builder from API data.
4839
+ * Creates a new message reference builder.
4701
4840
  *
4702
- * @param data - The API data to create this message reference builder with
4841
+ * @param data - The API data to create this message reference with
4703
4842
  */
4704
4843
  constructor(data = {}) {
4705
4844
  this.data = structuredClone(data);
@@ -4812,21 +4951,14 @@ var MessageBuilder = class {
4812
4951
  return this.data.embeds;
4813
4952
  }
4814
4953
  /**
4815
- * Creates a new message builder from API data.
4954
+ * Creates a new message builder.
4816
4955
  *
4817
- * @param data - The API data to create this message builder with
4956
+ * @param data - The API data to create this message with
4818
4957
  */
4819
- constructor({
4820
- attachments = [],
4821
- embeds = [],
4822
- components = [],
4823
- message_reference,
4824
- poll,
4825
- allowed_mentions,
4826
- ...data
4827
- } = {}) {
4958
+ constructor(data = {}) {
4959
+ const { attachments = [], embeds = [], components = [], message_reference, poll, allowed_mentions, ...rest } = data;
4828
4960
  this.data = {
4829
- ...structuredClone(data),
4961
+ ...structuredClone(rest),
4830
4962
  allowed_mentions: allowed_mentions && new AllowedMentionsBuilder(allowed_mentions),
4831
4963
  attachments: attachments.map((attachment) => new AttachmentBuilder(attachment)),
4832
4964
  embeds: embeds.map((embed) => new EmbedBuilder(embed)),
@@ -5288,7 +5420,7 @@ var MessageBuilder = class {
5288
5420
  };
5289
5421
 
5290
5422
  // src/index.ts
5291
- var version = "2.0.0-dev.1748606728-762bbc652";
5423
+ var version = "2.0.0-dev.1748909649-d40ceedad";
5292
5424
  // Annotate the CommonJS export names for ESM import in node:
5293
5425
  0 && (module.exports = {
5294
5426
  ActionRowBuilder,