@discordjs/builders 2.0.0-dev.1748650424-ef2c1bfa7 → 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.d.mts +291 -57
- package/dist/index.d.ts +291 -57
- package/dist/index.js +225 -93
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +225 -93
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -433,9 +433,9 @@ var ChannelSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
|
433
433
|
}
|
|
434
434
|
data;
|
|
435
435
|
/**
|
|
436
|
-
* Creates a new select menu
|
|
436
|
+
* Creates a new channel select menu.
|
|
437
437
|
*
|
|
438
|
-
* @param data - The API data to create this select menu with
|
|
438
|
+
* @param data - The API data to create this channel select menu with
|
|
439
439
|
* @example
|
|
440
440
|
* Creating a select menu from an API data object:
|
|
441
441
|
* ```ts
|
|
@@ -531,9 +531,9 @@ var MentionableSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
|
531
531
|
}
|
|
532
532
|
data;
|
|
533
533
|
/**
|
|
534
|
-
* Creates a new select menu
|
|
534
|
+
* Creates a new mentionable select menu.
|
|
535
535
|
*
|
|
536
|
-
* @param data - The API data to create this select menu with
|
|
536
|
+
* @param data - The API data to create this mentionable select menu with
|
|
537
537
|
* @example
|
|
538
538
|
* Creating a select menu from an API data object:
|
|
539
539
|
* ```ts
|
|
@@ -630,9 +630,9 @@ var RoleSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
|
630
630
|
}
|
|
631
631
|
data;
|
|
632
632
|
/**
|
|
633
|
-
* Creates a new select menu
|
|
633
|
+
* Creates a new role select menu.
|
|
634
634
|
*
|
|
635
|
-
* @param data - The API data to create this select menu with
|
|
635
|
+
* @param data - The API data to create this role select menu with
|
|
636
636
|
* @example
|
|
637
637
|
* Creating a select menu from an API data object:
|
|
638
638
|
* ```ts
|
|
@@ -720,7 +720,7 @@ var StringSelectMenuOptionBuilder = class {
|
|
|
720
720
|
}
|
|
721
721
|
data;
|
|
722
722
|
/**
|
|
723
|
-
* Creates a new string select menu option
|
|
723
|
+
* Creates a new string select menu option.
|
|
724
724
|
*
|
|
725
725
|
* @param data - The API data to create this string select menu option with
|
|
726
726
|
* @example
|
|
@@ -826,9 +826,9 @@ var StringSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
|
826
826
|
return this.data.options;
|
|
827
827
|
}
|
|
828
828
|
/**
|
|
829
|
-
* Creates a new select menu
|
|
829
|
+
* Creates a new string select menu.
|
|
830
830
|
*
|
|
831
|
-
* @param data - The API data to create this select menu with
|
|
831
|
+
* @param data - The API data to create this string select menu with
|
|
832
832
|
* @example
|
|
833
833
|
* Creating a select menu from an API data object:
|
|
834
834
|
* ```ts
|
|
@@ -856,10 +856,11 @@ var StringSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
|
856
856
|
* });
|
|
857
857
|
* ```
|
|
858
858
|
*/
|
|
859
|
-
constructor(
|
|
859
|
+
constructor(data = {}) {
|
|
860
860
|
super();
|
|
861
|
+
const { options = [], ...rest } = data;
|
|
861
862
|
this.data = {
|
|
862
|
-
...structuredClone(
|
|
863
|
+
...structuredClone(rest),
|
|
863
864
|
options: options.map((option) => new StringSelectMenuOptionBuilder(option)),
|
|
864
865
|
type: ComponentType8.StringSelect
|
|
865
866
|
};
|
|
@@ -942,9 +943,9 @@ var UserSelectMenuBuilder = class extends BaseSelectMenuBuilder {
|
|
|
942
943
|
}
|
|
943
944
|
data;
|
|
944
945
|
/**
|
|
945
|
-
* Creates a new select menu
|
|
946
|
+
* Creates a new user select menu.
|
|
946
947
|
*
|
|
947
|
-
* @param data - The API data to create this select menu with
|
|
948
|
+
* @param data - The API data to create this user select menu with
|
|
948
949
|
* @example
|
|
949
950
|
* Creating a select menu from an API data object:
|
|
950
951
|
* ```ts
|
|
@@ -1029,9 +1030,12 @@ var TextInputBuilder = class extends ComponentBuilder {
|
|
|
1029
1030
|
static {
|
|
1030
1031
|
__name(this, "TextInputBuilder");
|
|
1031
1032
|
}
|
|
1033
|
+
/**
|
|
1034
|
+
* @internal
|
|
1035
|
+
*/
|
|
1032
1036
|
data;
|
|
1033
1037
|
/**
|
|
1034
|
-
* Creates a new text input
|
|
1038
|
+
* Creates a new text input.
|
|
1035
1039
|
*
|
|
1036
1040
|
* @param data - The API data to create this text input with
|
|
1037
1041
|
* @example
|
|
@@ -1241,9 +1245,12 @@ var FileBuilder = class extends ComponentBuilder {
|
|
|
1241
1245
|
static {
|
|
1242
1246
|
__name(this, "FileBuilder");
|
|
1243
1247
|
}
|
|
1248
|
+
/**
|
|
1249
|
+
* @internal
|
|
1250
|
+
*/
|
|
1244
1251
|
data;
|
|
1245
1252
|
/**
|
|
1246
|
-
* Creates a new file
|
|
1253
|
+
* Creates a new file.
|
|
1247
1254
|
*
|
|
1248
1255
|
* @param data - The API data to create this file with
|
|
1249
1256
|
* @example
|
|
@@ -1269,9 +1276,10 @@ var FileBuilder = class extends ComponentBuilder {
|
|
|
1269
1276
|
*/
|
|
1270
1277
|
constructor(data = {}) {
|
|
1271
1278
|
super();
|
|
1279
|
+
const { file, ...rest } = data;
|
|
1272
1280
|
this.data = {
|
|
1273
|
-
...structuredClone(
|
|
1274
|
-
file:
|
|
1281
|
+
...structuredClone(rest),
|
|
1282
|
+
file: file && { url: file.url },
|
|
1275
1283
|
type: ComponentType13.File
|
|
1276
1284
|
};
|
|
1277
1285
|
}
|
|
@@ -1313,7 +1321,7 @@ var MediaGalleryItemBuilder = class {
|
|
|
1313
1321
|
}
|
|
1314
1322
|
data;
|
|
1315
1323
|
/**
|
|
1316
|
-
* Creates a new media gallery item
|
|
1324
|
+
* Creates a new media gallery item.
|
|
1317
1325
|
*
|
|
1318
1326
|
* @param data - The API data to create this media gallery item with
|
|
1319
1327
|
* @example
|
|
@@ -1338,9 +1346,7 @@ var MediaGalleryItemBuilder = class {
|
|
|
1338
1346
|
* ```
|
|
1339
1347
|
*/
|
|
1340
1348
|
constructor(data = {}) {
|
|
1341
|
-
this.data =
|
|
1342
|
-
...structuredClone(data)
|
|
1343
|
-
};
|
|
1349
|
+
this.data = structuredClone(data);
|
|
1344
1350
|
}
|
|
1345
1351
|
/**
|
|
1346
1352
|
* Sets the source URL of this media gallery item.
|
|
@@ -1391,9 +1397,18 @@ var MediaGalleryBuilder = class extends ComponentBuilder {
|
|
|
1391
1397
|
static {
|
|
1392
1398
|
__name(this, "MediaGalleryBuilder");
|
|
1393
1399
|
}
|
|
1400
|
+
/**
|
|
1401
|
+
* @internal
|
|
1402
|
+
*/
|
|
1394
1403
|
data;
|
|
1395
1404
|
/**
|
|
1396
|
-
*
|
|
1405
|
+
* The items in this media gallery.
|
|
1406
|
+
*/
|
|
1407
|
+
get items() {
|
|
1408
|
+
return this.data.items;
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* Creates a new media gallery.
|
|
1397
1412
|
*
|
|
1398
1413
|
* @param data - The API data to create this container with
|
|
1399
1414
|
* @example
|
|
@@ -1428,17 +1443,13 @@ var MediaGalleryBuilder = class extends ComponentBuilder {
|
|
|
1428
1443
|
*/
|
|
1429
1444
|
constructor(data = {}) {
|
|
1430
1445
|
super();
|
|
1446
|
+
const { items = [], ...rest } = data;
|
|
1431
1447
|
this.data = {
|
|
1432
|
-
|
|
1448
|
+
...structuredClone(rest),
|
|
1449
|
+
items: items.map((item) => new MediaGalleryItemBuilder(item)),
|
|
1433
1450
|
type: ComponentType14.MediaGallery
|
|
1434
1451
|
};
|
|
1435
1452
|
}
|
|
1436
|
-
/**
|
|
1437
|
-
* The items in this media gallery.
|
|
1438
|
-
*/
|
|
1439
|
-
get items() {
|
|
1440
|
-
return this.data.items;
|
|
1441
|
-
}
|
|
1442
1453
|
/**
|
|
1443
1454
|
* Adds a media gallery item to this media gallery.
|
|
1444
1455
|
*
|
|
@@ -1486,9 +1497,12 @@ var TextDisplayBuilder = class extends ComponentBuilder {
|
|
|
1486
1497
|
static {
|
|
1487
1498
|
__name(this, "TextDisplayBuilder");
|
|
1488
1499
|
}
|
|
1500
|
+
/**
|
|
1501
|
+
* @internal
|
|
1502
|
+
*/
|
|
1489
1503
|
data;
|
|
1490
1504
|
/**
|
|
1491
|
-
* Creates a new text display
|
|
1505
|
+
* Creates a new text display.
|
|
1492
1506
|
*
|
|
1493
1507
|
* @param data - The API data to create this text display with
|
|
1494
1508
|
* @example
|
|
@@ -1539,9 +1553,12 @@ var ThumbnailBuilder = class extends ComponentBuilder {
|
|
|
1539
1553
|
static {
|
|
1540
1554
|
__name(this, "ThumbnailBuilder");
|
|
1541
1555
|
}
|
|
1556
|
+
/**
|
|
1557
|
+
* @internal
|
|
1558
|
+
*/
|
|
1542
1559
|
data;
|
|
1543
1560
|
/**
|
|
1544
|
-
* Creates a new thumbnail
|
|
1561
|
+
* Creates a new thumbnail.
|
|
1545
1562
|
*
|
|
1546
1563
|
* @param data - The API data to create this thumbnail with
|
|
1547
1564
|
* @example
|
|
@@ -1567,9 +1584,10 @@ var ThumbnailBuilder = class extends ComponentBuilder {
|
|
|
1567
1584
|
*/
|
|
1568
1585
|
constructor(data = {}) {
|
|
1569
1586
|
super();
|
|
1587
|
+
const { media, ...rest } = data;
|
|
1570
1588
|
this.data = {
|
|
1571
|
-
...structuredClone(
|
|
1572
|
-
media:
|
|
1589
|
+
...structuredClone(rest),
|
|
1590
|
+
media: media && { url: media.url },
|
|
1573
1591
|
type: ComponentType16.Thumbnail
|
|
1574
1592
|
};
|
|
1575
1593
|
}
|
|
@@ -1622,12 +1640,18 @@ var SectionBuilder = class extends ComponentBuilder {
|
|
|
1622
1640
|
static {
|
|
1623
1641
|
__name(this, "SectionBuilder");
|
|
1624
1642
|
}
|
|
1643
|
+
/**
|
|
1644
|
+
* @internal
|
|
1645
|
+
*/
|
|
1625
1646
|
data;
|
|
1647
|
+
/**
|
|
1648
|
+
* The components within this section.
|
|
1649
|
+
*/
|
|
1626
1650
|
get components() {
|
|
1627
1651
|
return this.data.components;
|
|
1628
1652
|
}
|
|
1629
1653
|
/**
|
|
1630
|
-
* Creates a new section
|
|
1654
|
+
* Creates a new section.
|
|
1631
1655
|
*
|
|
1632
1656
|
* @param data - The API data to create this section with
|
|
1633
1657
|
* @example
|
|
@@ -1666,7 +1690,7 @@ var SectionBuilder = class extends ComponentBuilder {
|
|
|
1666
1690
|
const { components = [], accessory, ...rest } = data;
|
|
1667
1691
|
this.data = {
|
|
1668
1692
|
...structuredClone(rest),
|
|
1669
|
-
accessory: accessory
|
|
1693
|
+
accessory: accessory && resolveAccessoryComponent(accessory),
|
|
1670
1694
|
components: components.map((component) => new TextDisplayBuilder(component)),
|
|
1671
1695
|
type: ComponentType17.Section
|
|
1672
1696
|
};
|
|
@@ -1786,9 +1810,12 @@ var SeparatorBuilder = class extends ComponentBuilder {
|
|
|
1786
1810
|
static {
|
|
1787
1811
|
__name(this, "SeparatorBuilder");
|
|
1788
1812
|
}
|
|
1813
|
+
/**
|
|
1814
|
+
* @internal
|
|
1815
|
+
*/
|
|
1789
1816
|
data;
|
|
1790
1817
|
/**
|
|
1791
|
-
* Creates a new separator
|
|
1818
|
+
* Creates a new separator.
|
|
1792
1819
|
*
|
|
1793
1820
|
* @param data - The API data to create this separator with
|
|
1794
1821
|
* @example
|
|
@@ -1855,9 +1882,24 @@ var ContainerBuilder = class extends ComponentBuilder {
|
|
|
1855
1882
|
static {
|
|
1856
1883
|
__name(this, "ContainerBuilder");
|
|
1857
1884
|
}
|
|
1885
|
+
/**
|
|
1886
|
+
* @internal
|
|
1887
|
+
*/
|
|
1858
1888
|
data;
|
|
1859
|
-
|
|
1889
|
+
/**
|
|
1890
|
+
* Gets the components within this container.
|
|
1891
|
+
*/
|
|
1892
|
+
get components() {
|
|
1893
|
+
return this.data.components;
|
|
1894
|
+
}
|
|
1895
|
+
/**
|
|
1896
|
+
* Creates a new container builder.
|
|
1897
|
+
*
|
|
1898
|
+
* @param data - The API data to create the container with
|
|
1899
|
+
*/
|
|
1900
|
+
constructor(data = {}) {
|
|
1860
1901
|
super();
|
|
1902
|
+
const { components = [], ...rest } = data;
|
|
1861
1903
|
this.data = {
|
|
1862
1904
|
...structuredClone(rest),
|
|
1863
1905
|
components: components.map((component) => createComponentBuilder(component)),
|
|
@@ -2082,6 +2124,9 @@ var ActionRowBuilder = class extends ComponentBuilder {
|
|
|
2082
2124
|
static {
|
|
2083
2125
|
__name(this, "ActionRowBuilder");
|
|
2084
2126
|
}
|
|
2127
|
+
/**
|
|
2128
|
+
* @internal
|
|
2129
|
+
*/
|
|
2085
2130
|
data;
|
|
2086
2131
|
/**
|
|
2087
2132
|
* The components within this action row.
|
|
@@ -2090,7 +2135,7 @@ var ActionRowBuilder = class extends ComponentBuilder {
|
|
|
2090
2135
|
return this.data.components;
|
|
2091
2136
|
}
|
|
2092
2137
|
/**
|
|
2093
|
-
* Creates a new action row
|
|
2138
|
+
* Creates a new action row.
|
|
2094
2139
|
*
|
|
2095
2140
|
* @param data - The API data to create this action row with
|
|
2096
2141
|
* @example
|
|
@@ -2123,12 +2168,13 @@ var ActionRowBuilder = class extends ComponentBuilder {
|
|
|
2123
2168
|
* .addComponents(button2, button3);
|
|
2124
2169
|
* ```
|
|
2125
2170
|
*/
|
|
2126
|
-
constructor(
|
|
2171
|
+
constructor(data = {}) {
|
|
2127
2172
|
super();
|
|
2173
|
+
const { components = [], ...rest } = data;
|
|
2128
2174
|
this.data = {
|
|
2129
|
-
...structuredClone(
|
|
2130
|
-
|
|
2131
|
-
|
|
2175
|
+
...structuredClone(rest),
|
|
2176
|
+
components: components.map((component) => createComponentBuilder(component)),
|
|
2177
|
+
type: ComponentType21.ActionRow
|
|
2132
2178
|
};
|
|
2133
2179
|
}
|
|
2134
2180
|
/**
|
|
@@ -2432,6 +2478,9 @@ var SharedName = class {
|
|
|
2432
2478
|
static {
|
|
2433
2479
|
__name(this, "SharedName");
|
|
2434
2480
|
}
|
|
2481
|
+
/**
|
|
2482
|
+
* @internal
|
|
2483
|
+
*/
|
|
2435
2484
|
data = {};
|
|
2436
2485
|
/**
|
|
2437
2486
|
* Sets the name of this command.
|
|
@@ -2486,6 +2535,9 @@ var SharedNameAndDescription = class extends SharedName {
|
|
|
2486
2535
|
static {
|
|
2487
2536
|
__name(this, "SharedNameAndDescription");
|
|
2488
2537
|
}
|
|
2538
|
+
/**
|
|
2539
|
+
* @internal
|
|
2540
|
+
*/
|
|
2489
2541
|
data = {};
|
|
2490
2542
|
/**
|
|
2491
2543
|
* Sets the description of this command.
|
|
@@ -2649,7 +2701,15 @@ var ApplicationCommandOptionBase = class extends SharedNameAndDescription {
|
|
|
2649
2701
|
static {
|
|
2650
2702
|
__name(this, "ApplicationCommandOptionBase");
|
|
2651
2703
|
}
|
|
2704
|
+
/**
|
|
2705
|
+
* @internal
|
|
2706
|
+
*/
|
|
2652
2707
|
static predicate = basicOptionPredicate;
|
|
2708
|
+
/**
|
|
2709
|
+
* Creates a new application command option builder.
|
|
2710
|
+
*
|
|
2711
|
+
* @param type - The type of the option
|
|
2712
|
+
*/
|
|
2653
2713
|
constructor(type) {
|
|
2654
2714
|
super();
|
|
2655
2715
|
this.data.type = type;
|
|
@@ -2682,6 +2742,9 @@ var ChatInputCommandAttachmentOption = class extends ApplicationCommandOptionBas
|
|
|
2682
2742
|
static {
|
|
2683
2743
|
__name(this, "ChatInputCommandAttachmentOption");
|
|
2684
2744
|
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Creates a new attachment option.
|
|
2747
|
+
*/
|
|
2685
2748
|
constructor() {
|
|
2686
2749
|
super(ApplicationCommandOptionType2.Attachment);
|
|
2687
2750
|
}
|
|
@@ -2693,6 +2756,9 @@ var ChatInputCommandBooleanOption = class extends ApplicationCommandOptionBase {
|
|
|
2693
2756
|
static {
|
|
2694
2757
|
__name(this, "ChatInputCommandBooleanOption");
|
|
2695
2758
|
}
|
|
2759
|
+
/**
|
|
2760
|
+
* Creates a new boolean option.
|
|
2761
|
+
*/
|
|
2696
2762
|
constructor() {
|
|
2697
2763
|
super(ApplicationCommandOptionType3.Boolean);
|
|
2698
2764
|
}
|
|
@@ -2708,7 +2774,13 @@ var ChatInputCommandChannelOption = class extends Mixin3(
|
|
|
2708
2774
|
static {
|
|
2709
2775
|
__name(this, "ChatInputCommandChannelOption");
|
|
2710
2776
|
}
|
|
2777
|
+
/**
|
|
2778
|
+
* @internal
|
|
2779
|
+
*/
|
|
2711
2780
|
static predicate = channelOptionPredicate;
|
|
2781
|
+
/**
|
|
2782
|
+
* Creates a new channel option.
|
|
2783
|
+
*/
|
|
2712
2784
|
constructor() {
|
|
2713
2785
|
super(ApplicationCommandOptionType4.Channel);
|
|
2714
2786
|
}
|
|
@@ -2726,7 +2798,13 @@ var ChatInputCommandIntegerOption = class extends Mixin4(
|
|
|
2726
2798
|
static {
|
|
2727
2799
|
__name(this, "ChatInputCommandIntegerOption");
|
|
2728
2800
|
}
|
|
2801
|
+
/**
|
|
2802
|
+
* @internal
|
|
2803
|
+
*/
|
|
2729
2804
|
static predicate = integerOptionPredicate;
|
|
2805
|
+
/**
|
|
2806
|
+
* Creates a new integer option.
|
|
2807
|
+
*/
|
|
2730
2808
|
constructor() {
|
|
2731
2809
|
super(ApplicationCommandOptionType5.Integer);
|
|
2732
2810
|
}
|
|
@@ -2738,6 +2816,9 @@ var ChatInputCommandMentionableOption = class extends ApplicationCommandOptionBa
|
|
|
2738
2816
|
static {
|
|
2739
2817
|
__name(this, "ChatInputCommandMentionableOption");
|
|
2740
2818
|
}
|
|
2819
|
+
/**
|
|
2820
|
+
* Creates a new mentionable option.
|
|
2821
|
+
*/
|
|
2741
2822
|
constructor() {
|
|
2742
2823
|
super(ApplicationCommandOptionType6.Mentionable);
|
|
2743
2824
|
}
|
|
@@ -2755,7 +2836,13 @@ var ChatInputCommandNumberOption = class extends Mixin5(
|
|
|
2755
2836
|
static {
|
|
2756
2837
|
__name(this, "ChatInputCommandNumberOption");
|
|
2757
2838
|
}
|
|
2839
|
+
/**
|
|
2840
|
+
* @internal
|
|
2841
|
+
*/
|
|
2758
2842
|
static predicate = numberOptionPredicate;
|
|
2843
|
+
/**
|
|
2844
|
+
* Creates a new number option.
|
|
2845
|
+
*/
|
|
2759
2846
|
constructor() {
|
|
2760
2847
|
super(ApplicationCommandOptionType7.Number);
|
|
2761
2848
|
}
|
|
@@ -2767,6 +2854,9 @@ var ChatInputCommandRoleOption = class extends ApplicationCommandOptionBase {
|
|
|
2767
2854
|
static {
|
|
2768
2855
|
__name(this, "ChatInputCommandRoleOption");
|
|
2769
2856
|
}
|
|
2857
|
+
/**
|
|
2858
|
+
* Creates a new role option.
|
|
2859
|
+
*/
|
|
2770
2860
|
constructor() {
|
|
2771
2861
|
super(ApplicationCommandOptionType8.Role);
|
|
2772
2862
|
}
|
|
@@ -2783,7 +2873,13 @@ var ChatInputCommandStringOption = class extends Mixin6(
|
|
|
2783
2873
|
static {
|
|
2784
2874
|
__name(this, "ChatInputCommandStringOption");
|
|
2785
2875
|
}
|
|
2876
|
+
/**
|
|
2877
|
+
* @internal
|
|
2878
|
+
*/
|
|
2786
2879
|
static predicate = stringOptionPredicate;
|
|
2880
|
+
/**
|
|
2881
|
+
* Creates a new string option builder.
|
|
2882
|
+
*/
|
|
2787
2883
|
constructor() {
|
|
2788
2884
|
super(ApplicationCommandOptionType9.String);
|
|
2789
2885
|
}
|
|
@@ -2827,6 +2923,9 @@ var ChatInputCommandUserOption = class extends ApplicationCommandOptionBase {
|
|
|
2827
2923
|
static {
|
|
2828
2924
|
__name(this, "ChatInputCommandUserOption");
|
|
2829
2925
|
}
|
|
2926
|
+
/**
|
|
2927
|
+
* Creates a new user option.
|
|
2928
|
+
*/
|
|
2830
2929
|
constructor() {
|
|
2831
2930
|
super(ApplicationCommandOptionType10.User);
|
|
2832
2931
|
}
|
|
@@ -2837,6 +2936,9 @@ var SharedChatInputCommandOptions = class {
|
|
|
2837
2936
|
static {
|
|
2838
2937
|
__name(this, "SharedChatInputCommandOptions");
|
|
2839
2938
|
}
|
|
2939
|
+
/**
|
|
2940
|
+
* The options within this command.
|
|
2941
|
+
*/
|
|
2840
2942
|
get options() {
|
|
2841
2943
|
return this.data.options ??= [];
|
|
2842
2944
|
}
|
|
@@ -2966,6 +3068,9 @@ var ChatInputCommandSubcommandGroupBuilder = class extends SharedNameAndDescript
|
|
|
2966
3068
|
static {
|
|
2967
3069
|
__name(this, "ChatInputCommandSubcommandGroupBuilder");
|
|
2968
3070
|
}
|
|
3071
|
+
/**
|
|
3072
|
+
* The options within this subcommand group.
|
|
3073
|
+
*/
|
|
2969
3074
|
get options() {
|
|
2970
3075
|
return this.data.options ??= [];
|
|
2971
3076
|
}
|
|
@@ -3165,7 +3270,17 @@ var ContextMenuCommandBuilder = class extends Mixin9(
|
|
|
3165
3270
|
static {
|
|
3166
3271
|
__name(this, "ContextMenuCommandBuilder");
|
|
3167
3272
|
}
|
|
3273
|
+
/**
|
|
3274
|
+
* The API data associated with this context menu command.
|
|
3275
|
+
*
|
|
3276
|
+
* @internal
|
|
3277
|
+
*/
|
|
3168
3278
|
data;
|
|
3279
|
+
/**
|
|
3280
|
+
* Creates a new context menu command.
|
|
3281
|
+
*
|
|
3282
|
+
* @param data - The API data to create this context menu command with
|
|
3283
|
+
*/
|
|
3169
3284
|
constructor(data = {}) {
|
|
3170
3285
|
super();
|
|
3171
3286
|
this.data = structuredClone(data);
|
|
@@ -3233,13 +3348,14 @@ var ModalBuilder = class {
|
|
|
3233
3348
|
return this.data.components;
|
|
3234
3349
|
}
|
|
3235
3350
|
/**
|
|
3236
|
-
* Creates a new modal
|
|
3351
|
+
* Creates a new modal.
|
|
3237
3352
|
*
|
|
3238
3353
|
* @param data - The API data to create this modal with
|
|
3239
3354
|
*/
|
|
3240
|
-
constructor(
|
|
3355
|
+
constructor(data = {}) {
|
|
3356
|
+
const { components = [], ...rest } = data;
|
|
3241
3357
|
this.data = {
|
|
3242
|
-
...structuredClone(
|
|
3358
|
+
...structuredClone(rest),
|
|
3243
3359
|
components: components.map((component) => createComponentBuilder(component))
|
|
3244
3360
|
};
|
|
3245
3361
|
}
|
|
@@ -3386,14 +3502,17 @@ var EmbedAuthorBuilder = class {
|
|
|
3386
3502
|
static {
|
|
3387
3503
|
__name(this, "EmbedAuthorBuilder");
|
|
3388
3504
|
}
|
|
3505
|
+
/**
|
|
3506
|
+
* The API data associated with this embed author.
|
|
3507
|
+
*/
|
|
3389
3508
|
data;
|
|
3390
3509
|
/**
|
|
3391
|
-
* Creates a new embed author
|
|
3510
|
+
* Creates a new embed author.
|
|
3392
3511
|
*
|
|
3393
|
-
* @param data - The API data to
|
|
3512
|
+
* @param data - The API data to create this embed author with
|
|
3394
3513
|
*/
|
|
3395
|
-
constructor(data) {
|
|
3396
|
-
this.data = structuredClone(data)
|
|
3514
|
+
constructor(data = {}) {
|
|
3515
|
+
this.data = structuredClone(data);
|
|
3397
3516
|
}
|
|
3398
3517
|
/**
|
|
3399
3518
|
* Sets the name for this embed author.
|
|
@@ -3455,14 +3574,17 @@ var EmbedFieldBuilder = class {
|
|
|
3455
3574
|
static {
|
|
3456
3575
|
__name(this, "EmbedFieldBuilder");
|
|
3457
3576
|
}
|
|
3577
|
+
/**
|
|
3578
|
+
* The API data associated with this embed field.
|
|
3579
|
+
*/
|
|
3458
3580
|
data;
|
|
3459
3581
|
/**
|
|
3460
|
-
* Creates a new embed field
|
|
3582
|
+
* Creates a new embed field.
|
|
3461
3583
|
*
|
|
3462
|
-
* @param data - The API data to
|
|
3584
|
+
* @param data - The API data to create this embed field with
|
|
3463
3585
|
*/
|
|
3464
|
-
constructor(data) {
|
|
3465
|
-
this.data = structuredClone(data)
|
|
3586
|
+
constructor(data = {}) {
|
|
3587
|
+
this.data = structuredClone(data);
|
|
3466
3588
|
}
|
|
3467
3589
|
/**
|
|
3468
3590
|
* Sets the name for this embed field.
|
|
@@ -3510,14 +3632,17 @@ var EmbedFooterBuilder = class {
|
|
|
3510
3632
|
static {
|
|
3511
3633
|
__name(this, "EmbedFooterBuilder");
|
|
3512
3634
|
}
|
|
3635
|
+
/**
|
|
3636
|
+
* The API data associated with this embed footer.
|
|
3637
|
+
*/
|
|
3513
3638
|
data;
|
|
3514
3639
|
/**
|
|
3515
|
-
* Creates a new embed footer
|
|
3640
|
+
* Creates a new embed footer.
|
|
3516
3641
|
*
|
|
3517
|
-
* @param data - The API data to
|
|
3642
|
+
* @param data - The API data to create this embed footer with
|
|
3518
3643
|
*/
|
|
3519
|
-
constructor(data) {
|
|
3520
|
-
this.data = structuredClone(data)
|
|
3644
|
+
constructor(data = {}) {
|
|
3645
|
+
this.data = structuredClone(data);
|
|
3521
3646
|
}
|
|
3522
3647
|
/**
|
|
3523
3648
|
* Sets the text for this embed footer.
|
|
@@ -3574,16 +3699,17 @@ var EmbedBuilder = class {
|
|
|
3574
3699
|
return this.data.fields;
|
|
3575
3700
|
}
|
|
3576
3701
|
/**
|
|
3577
|
-
* Creates a new embed
|
|
3702
|
+
* Creates a new embed.
|
|
3578
3703
|
*
|
|
3579
3704
|
* @param data - The API data to create this embed with
|
|
3580
3705
|
*/
|
|
3581
3706
|
constructor(data = {}) {
|
|
3707
|
+
const { author, fields = [], footer, ...rest } = data;
|
|
3582
3708
|
this.data = {
|
|
3583
|
-
...structuredClone(
|
|
3584
|
-
author:
|
|
3585
|
-
fields:
|
|
3586
|
-
footer:
|
|
3709
|
+
...structuredClone(rest),
|
|
3710
|
+
author: author && new EmbedAuthorBuilder(author),
|
|
3711
|
+
fields: fields.map((field) => new EmbedFieldBuilder(field)),
|
|
3712
|
+
footer: footer && new EmbedFooterBuilder(footer)
|
|
3587
3713
|
};
|
|
3588
3714
|
}
|
|
3589
3715
|
/**
|
|
@@ -3838,9 +3964,9 @@ var EmbedBuilder = class {
|
|
|
3838
3964
|
const data = {
|
|
3839
3965
|
...structuredClone(rest),
|
|
3840
3966
|
// Disable validation because the embedPredicate below will validate those as well
|
|
3841
|
-
author:
|
|
3842
|
-
fields:
|
|
3843
|
-
footer:
|
|
3967
|
+
author: author?.toJSON(false),
|
|
3968
|
+
fields: fields.map((field) => field.toJSON(false)),
|
|
3969
|
+
footer: footer?.toJSON(false)
|
|
3844
3970
|
};
|
|
3845
3971
|
validate(embedPredicate, data, validationOverride);
|
|
3846
3972
|
return data;
|
|
@@ -3871,12 +3997,14 @@ var PollMediaBuilder = class {
|
|
|
3871
3997
|
}
|
|
3872
3998
|
/**
|
|
3873
3999
|
* The API data associated with this poll media.
|
|
4000
|
+
*
|
|
4001
|
+
* @internal
|
|
3874
4002
|
*/
|
|
3875
4003
|
data;
|
|
3876
4004
|
/**
|
|
3877
|
-
* Creates new poll media
|
|
4005
|
+
* Creates new poll media.
|
|
3878
4006
|
*
|
|
3879
|
-
* @param data - The API data to
|
|
4007
|
+
* @param data - The API data to create this poll media with
|
|
3880
4008
|
*/
|
|
3881
4009
|
constructor(data = {}) {
|
|
3882
4010
|
this.data = structuredClone(data);
|
|
@@ -3933,14 +4061,15 @@ var PollAnswerBuilder = class {
|
|
|
3933
4061
|
*/
|
|
3934
4062
|
data;
|
|
3935
4063
|
/**
|
|
3936
|
-
* Creates a new poll answer
|
|
4064
|
+
* Creates a new poll answer.
|
|
3937
4065
|
*
|
|
3938
4066
|
* @param data - The API data to create this poll answer with
|
|
3939
4067
|
*/
|
|
3940
4068
|
constructor(data = {}) {
|
|
4069
|
+
const { poll_media, ...rest } = data;
|
|
3941
4070
|
this.data = {
|
|
3942
|
-
...structuredClone(
|
|
3943
|
-
poll_media: new PollAnswerMediaBuilder(
|
|
4071
|
+
...structuredClone(rest),
|
|
4072
|
+
poll_media: new PollAnswerMediaBuilder(poll_media)
|
|
3944
4073
|
};
|
|
3945
4074
|
}
|
|
3946
4075
|
/**
|
|
@@ -4011,15 +4140,16 @@ var PollBuilder = class {
|
|
|
4011
4140
|
return this.data.answers;
|
|
4012
4141
|
}
|
|
4013
4142
|
/**
|
|
4014
|
-
* Creates a new poll
|
|
4143
|
+
* Creates a new poll.
|
|
4015
4144
|
*
|
|
4016
4145
|
* @param data - The API data to create this poll with
|
|
4017
4146
|
*/
|
|
4018
4147
|
constructor(data = {}) {
|
|
4148
|
+
const { question, answers = [], ...rest } = data;
|
|
4019
4149
|
this.data = {
|
|
4020
|
-
...structuredClone(
|
|
4021
|
-
question: new PollQuestionBuilder(
|
|
4022
|
-
answers:
|
|
4150
|
+
...structuredClone(rest),
|
|
4151
|
+
question: new PollQuestionBuilder(question),
|
|
4152
|
+
answers: answers.map((answer) => new PollAnswerBuilder(answer))
|
|
4023
4153
|
};
|
|
4024
4154
|
}
|
|
4025
4155
|
/**
|
|
@@ -4282,11 +4412,14 @@ var AllowedMentionsBuilder = class {
|
|
|
4282
4412
|
static {
|
|
4283
4413
|
__name(this, "AllowedMentionsBuilder");
|
|
4284
4414
|
}
|
|
4415
|
+
/**
|
|
4416
|
+
* The API data associated with these allowed mentions.
|
|
4417
|
+
*/
|
|
4285
4418
|
data;
|
|
4286
4419
|
/**
|
|
4287
|
-
* Creates a new allowed mentions builder
|
|
4420
|
+
* Creates a new allowed mentions builder.
|
|
4288
4421
|
*
|
|
4289
|
-
* @param data - The API data to create this allowed mentions
|
|
4422
|
+
* @param data - The API data to create this allowed mentions with
|
|
4290
4423
|
*/
|
|
4291
4424
|
constructor(data = {}) {
|
|
4292
4425
|
this.data = structuredClone(data);
|
|
@@ -4453,11 +4586,14 @@ var AttachmentBuilder = class {
|
|
|
4453
4586
|
static {
|
|
4454
4587
|
__name(this, "AttachmentBuilder");
|
|
4455
4588
|
}
|
|
4589
|
+
/**
|
|
4590
|
+
* The API data associated with this attachment.
|
|
4591
|
+
*/
|
|
4456
4592
|
data;
|
|
4457
4593
|
/**
|
|
4458
|
-
* Creates a new attachment builder
|
|
4594
|
+
* Creates a new attachment builder.
|
|
4459
4595
|
*
|
|
4460
|
-
* @param data - The API data to create this attachment
|
|
4596
|
+
* @param data - The API data to create this attachment with
|
|
4461
4597
|
*/
|
|
4462
4598
|
constructor(data = {}) {
|
|
4463
4599
|
this.data = structuredClone(data);
|
|
@@ -4570,11 +4706,14 @@ var MessageReferenceBuilder = class {
|
|
|
4570
4706
|
static {
|
|
4571
4707
|
__name(this, "MessageReferenceBuilder");
|
|
4572
4708
|
}
|
|
4709
|
+
/**
|
|
4710
|
+
* The API data associated with this message reference.
|
|
4711
|
+
*/
|
|
4573
4712
|
data;
|
|
4574
4713
|
/**
|
|
4575
|
-
* Creates a new message reference builder
|
|
4714
|
+
* Creates a new message reference builder.
|
|
4576
4715
|
*
|
|
4577
|
-
* @param data - The API data to create this message reference
|
|
4716
|
+
* @param data - The API data to create this message reference with
|
|
4578
4717
|
*/
|
|
4579
4718
|
constructor(data = {}) {
|
|
4580
4719
|
this.data = structuredClone(data);
|
|
@@ -4687,21 +4826,14 @@ var MessageBuilder = class {
|
|
|
4687
4826
|
return this.data.embeds;
|
|
4688
4827
|
}
|
|
4689
4828
|
/**
|
|
4690
|
-
* Creates a new message builder
|
|
4829
|
+
* Creates a new message builder.
|
|
4691
4830
|
*
|
|
4692
|
-
* @param data - The API data to create this message
|
|
4831
|
+
* @param data - The API data to create this message with
|
|
4693
4832
|
*/
|
|
4694
|
-
constructor({
|
|
4695
|
-
attachments = [],
|
|
4696
|
-
embeds = [],
|
|
4697
|
-
components = [],
|
|
4698
|
-
message_reference,
|
|
4699
|
-
poll,
|
|
4700
|
-
allowed_mentions,
|
|
4701
|
-
...data
|
|
4702
|
-
} = {}) {
|
|
4833
|
+
constructor(data = {}) {
|
|
4834
|
+
const { attachments = [], embeds = [], components = [], message_reference, poll, allowed_mentions, ...rest } = data;
|
|
4703
4835
|
this.data = {
|
|
4704
|
-
...structuredClone(
|
|
4836
|
+
...structuredClone(rest),
|
|
4705
4837
|
allowed_mentions: allowed_mentions && new AllowedMentionsBuilder(allowed_mentions),
|
|
4706
4838
|
attachments: attachments.map((attachment) => new AttachmentBuilder(attachment)),
|
|
4707
4839
|
embeds: embeds.map((embed) => new EmbedBuilder(embed)),
|
|
@@ -5163,7 +5295,7 @@ var MessageBuilder = class {
|
|
|
5163
5295
|
};
|
|
5164
5296
|
|
|
5165
5297
|
// src/index.ts
|
|
5166
|
-
var version = "2.0.0-dev.
|
|
5298
|
+
var version = "2.0.0-dev.1748909649-d40ceedad";
|
|
5167
5299
|
export {
|
|
5168
5300
|
ActionRowBuilder,
|
|
5169
5301
|
AllowedMentionsBuilder,
|