@discordjs/structures 0.2.0-pr-11005.1765454364-f3f6d34e7 → 0.2.0-pr-10758.1765463096-d081e1706

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
@@ -21,48 +21,106 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  // src/index.ts
22
22
  var index_exports = {};
23
23
  __export(index_exports, {
24
+ ActionRowComponent: () => ActionRowComponent,
24
25
  AnnouncementChannel: () => AnnouncementChannel,
25
26
  AnnouncementThreadChannel: () => AnnouncementThreadChannel,
27
+ ApplicationCommandInteractionMetadata: () => ApplicationCommandInteractionMetadata,
26
28
  AppliedTagsMixin: () => AppliedTagsMixin,
29
+ Attachment: () => Attachment,
30
+ AttachmentFlagsBitField: () => AttachmentFlagsBitField,
27
31
  AvatarDecorationData: () => AvatarDecorationData,
28
32
  BitField: () => BitField,
33
+ ButtonComponent: () => ButtonComponent,
29
34
  CategoryChannel: () => CategoryChannel,
30
35
  Channel: () => Channel,
31
36
  ChannelFlagsBitField: () => ChannelFlagsBitField,
37
+ ChannelMention: () => ChannelMention,
32
38
  ChannelOwnerMixin: () => ChannelOwnerMixin,
33
39
  ChannelParentMixin: () => ChannelParentMixin,
34
40
  ChannelPermissionMixin: () => ChannelPermissionMixin,
35
41
  ChannelPinMixin: () => ChannelPinMixin,
42
+ ChannelSelectMenuComponent: () => ChannelSelectMenuComponent,
36
43
  ChannelSlowmodeMixin: () => ChannelSlowmodeMixin,
37
44
  ChannelTopicMixin: () => ChannelTopicMixin,
38
45
  ChannelWebhookMixin: () => ChannelWebhookMixin,
46
+ Component: () => Component,
47
+ ComponentEmoji: () => ComponentEmoji,
39
48
  Connection: () => Connection,
49
+ ContainerComponent: () => ContainerComponent,
40
50
  DMChannel: () => DMChannel,
41
51
  DMChannelMixin: () => DMChannelMixin,
42
52
  DataTemplatePropertyName: () => DataTemplatePropertyName,
53
+ Embed: () => Embed,
54
+ EmbedAuthor: () => EmbedAuthor,
55
+ EmbedField: () => EmbedField,
56
+ EmbedFooter: () => EmbedFooter,
57
+ EmbedImage: () => EmbedImage,
58
+ EmbedProvider: () => EmbedProvider,
59
+ EmbedThumbnail: () => EmbedThumbnail,
60
+ EmbedVideo: () => EmbedVideo,
61
+ FileComponent: () => FileComponent,
62
+ FileUploadComponent: () => FileUploadComponent,
43
63
  ForumChannel: () => ForumChannel,
44
64
  ForumTag: () => ForumTag,
45
65
  GroupDMChannel: () => GroupDMChannel,
46
66
  GroupDMMixin: () => GroupDMMixin,
47
67
  GuildChannelMixin: () => GuildChannelMixin,
68
+ InteractionMetadata: () => InteractionMetadata,
69
+ InteractiveButtonComponent: () => InteractiveButtonComponent,
48
70
  Invite: () => Invite,
71
+ LabeledButtonComponent: () => LabeledButtonComponent,
72
+ LinkButtonComponent: () => LinkButtonComponent,
49
73
  MediaChannel: () => MediaChannel,
74
+ MediaGalleryComponent: () => MediaGalleryComponent,
75
+ MediaGalleryItem: () => MediaGalleryItem,
76
+ MentionableSelectMenuComponent: () => MentionableSelectMenuComponent,
77
+ Message: () => Message,
78
+ MessageActivity: () => MessageActivity,
79
+ MessageCall: () => MessageCall,
80
+ MessageComponentInteractionMetadata: () => MessageComponentInteractionMetadata,
81
+ MessageFlagsBitField: () => MessageFlagsBitField,
82
+ MessageReference: () => MessageReference,
50
83
  Mixin: () => Mixin,
84
+ ModalSubmitInteractionMetadata: () => ModalSubmitInteractionMetadata,
51
85
  OptimizeDataPropertyName: () => OptimizeDataPropertyName,
52
86
  PermissionOverwrite: () => PermissionOverwrite,
53
87
  PermissionsBitField: () => PermissionsBitField,
88
+ Poll: () => Poll,
89
+ PollAnswer: () => PollAnswer,
90
+ PollAnswerCount: () => PollAnswerCount,
91
+ PollMedia: () => PollMedia,
92
+ PollResults: () => PollResults,
93
+ PremiumButtonComponent: () => PremiumButtonComponent,
54
94
  PrivateThreadChannel: () => PrivateThreadChannel,
55
95
  PublicThreadChannel: () => PublicThreadChannel,
96
+ Reaction: () => Reaction,
97
+ ReactionCountDetails: () => ReactionCountDetails,
98
+ ResolvedInteractionData: () => ResolvedInteractionData,
99
+ RoleSelectMenuComponent: () => RoleSelectMenuComponent,
100
+ RoleSubscriptionData: () => RoleSubscriptionData,
101
+ SectionComponent: () => SectionComponent,
102
+ SelectMenuComponent: () => SelectMenuComponent,
103
+ SelectMenuDefaultValue: () => SelectMenuDefaultValue,
104
+ SeparatorComponent: () => SeparatorComponent,
56
105
  StageChannel: () => StageChannel,
106
+ Sticker: () => Sticker,
107
+ StringSelectMenuComponent: () => StringSelectMenuComponent,
108
+ StringSelectMenuOption: () => StringSelectMenuOption,
57
109
  Structure: () => Structure,
58
110
  TextChannel: () => TextChannel,
59
111
  TextChannelMixin: () => TextChannelMixin,
112
+ TextDisplayComponent: () => TextDisplayComponent,
113
+ TextInputComponent: () => TextInputComponent,
60
114
  ThreadChannelMixin: () => ThreadChannelMixin,
61
115
  ThreadMetadata: () => ThreadMetadata,
62
116
  ThreadOnlyChannelMixin: () => ThreadOnlyChannelMixin,
117
+ ThumbnailComponent: () => ThumbnailComponent,
118
+ UnfurledMediaItem: () => UnfurledMediaItem,
63
119
  User: () => User,
120
+ UserSelectMenuComponent: () => UserSelectMenuComponent,
64
121
  VoiceChannel: () => VoiceChannel,
65
122
  VoiceChannelMixin: () => VoiceChannelMixin,
123
+ dateToDiscordISOTimestamp: () => dateToDiscordISOTimestamp,
66
124
  extendTemplate: () => extendTemplate
67
125
  });
68
126
  module.exports = __toCommonJS(index_exports);
@@ -228,8 +286,23 @@ var BitField = class _BitField {
228
286
  }
229
287
  };
230
288
 
231
- // src/bitfields/ChannelFlagsBitField.ts
289
+ // src/bitfields/AttachmentFlagsBitField.ts
232
290
  var import_v10 = require("discord-api-types/v10");
291
+ var AttachmentFlagsBitField = class extends BitField {
292
+ static {
293
+ __name(this, "AttachmentFlagsBitField");
294
+ }
295
+ /**
296
+ * Numeric attachment flags.
297
+ */
298
+ static Flags = import_v10.AttachmentFlags;
299
+ toJSON() {
300
+ return super.toJSON(true);
301
+ }
302
+ };
303
+
304
+ // src/bitfields/ChannelFlagsBitField.ts
305
+ var import_v102 = require("discord-api-types/v10");
233
306
  var ChannelFlagsBitField = class extends BitField {
234
307
  static {
235
308
  __name(this, "ChannelFlagsBitField");
@@ -237,14 +310,29 @@ var ChannelFlagsBitField = class extends BitField {
237
310
  /**
238
311
  * Numeric guild channel flags.
239
312
  */
240
- static Flags = import_v10.ChannelFlags;
313
+ static Flags = import_v102.ChannelFlags;
314
+ toJSON() {
315
+ return super.toJSON(true);
316
+ }
317
+ };
318
+
319
+ // src/bitfields/MessageFlagsBitField.ts
320
+ var import_v103 = require("discord-api-types/v10");
321
+ var MessageFlagsBitField = class extends BitField {
322
+ static {
323
+ __name(this, "MessageFlagsBitField");
324
+ }
325
+ /**
326
+ * Numeric message flags.
327
+ */
328
+ static Flags = import_v103.MessageFlags;
241
329
  toJSON() {
242
330
  return super.toJSON(true);
243
331
  }
244
332
  };
245
333
 
246
334
  // src/bitfields/PermissionsBitField.ts
247
- var import_v102 = require("discord-api-types/v10");
335
+ var import_v104 = require("discord-api-types/v10");
248
336
  var PermissionsBitField = class extends BitField {
249
337
  static {
250
338
  __name(this, "PermissionsBitField");
@@ -254,11 +342,11 @@ var PermissionsBitField = class extends BitField {
254
342
  *
255
343
  * @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
256
344
  */
257
- static Flags = import_v102.PermissionFlagsBits;
345
+ static Flags = import_v104.PermissionFlagsBits;
258
346
  /**
259
347
  * Bit field representing every permission combined
260
348
  */
261
- static All = Object.values(import_v102.PermissionFlagsBits).reduce((all, perm) => all | perm, 0n);
349
+ static All = Object.values(import_v104.PermissionFlagsBits).reduce((all, perm) => all | perm, 0n);
262
350
  /**
263
351
  * Bit field representing the default permissions for users
264
352
  */
@@ -266,7 +354,7 @@ var PermissionsBitField = class extends BitField {
266
354
  /**
267
355
  * Bit field representing the permissions required for moderators of stage channels
268
356
  */
269
- static StageModerator = import_v102.PermissionFlagsBits.ManageChannels | import_v102.PermissionFlagsBits.MuteMembers | import_v102.PermissionFlagsBits.MoveMembers;
357
+ static StageModerator = import_v104.PermissionFlagsBits.ManageChannels | import_v104.PermissionFlagsBits.MuteMembers | import_v104.PermissionFlagsBits.MoveMembers;
270
358
  /**
271
359
  * Gets all given bits that are missing from the bit field.
272
360
  *
@@ -275,7 +363,7 @@ var PermissionsBitField = class extends BitField {
275
363
  * @returns A bit field containing the missing permissions
276
364
  */
277
365
  missing(bits, checkAdmin = true) {
278
- return checkAdmin && this.has(import_v102.PermissionFlagsBits.Administrator) ? [] : super.missing(bits);
366
+ return checkAdmin && this.has(import_v104.PermissionFlagsBits.Administrator) ? [] : super.missing(bits);
279
367
  }
280
368
  /**
281
369
  * Checks whether the bit field has a permission, or any of multiple permissions.
@@ -285,7 +373,7 @@ var PermissionsBitField = class extends BitField {
285
373
  * @returns Whether the bit field has the permission(s)
286
374
  */
287
375
  any(permission, checkAdmin = true) {
288
- return checkAdmin && super.has(import_v102.PermissionFlagsBits.Administrator) || super.any(permission);
376
+ return checkAdmin && super.has(import_v104.PermissionFlagsBits.Administrator) || super.any(permission);
289
377
  }
290
378
  /**
291
379
  * Checks whether the bit field has a permission, or multiple permissions.
@@ -295,7 +383,7 @@ var PermissionsBitField = class extends BitField {
295
383
  * @returns Whether the bit field has the permission(s)
296
384
  */
297
385
  has(permission, checkAdmin = true) {
298
- return checkAdmin && super.has(import_v102.PermissionFlagsBits.Administrator) || super.has(permission);
386
+ return checkAdmin && super.has(import_v104.PermissionFlagsBits.Administrator) || super.has(permission);
299
387
  }
300
388
  /**
301
389
  * Gets an Array of bitfield names based on the permissions available.
@@ -308,18 +396,20 @@ var PermissionsBitField = class extends BitField {
308
396
  };
309
397
 
310
398
  // src/utils/symbols.ts
311
- var kData = Symbol.for("djs.structures.data");
312
- var kClone = Symbol.for("djs.structures.clone");
313
- var kPatch = Symbol.for("djs.structures.patch");
314
- var kExpiresTimestamp = Symbol.for("djs.structures.expiresTimestamp");
315
- var kCreatedTimestamp = Symbol.for("djs.structures.createdTimestamp");
316
- var kEditedTimestamp = Symbol.for("djs.structures.editedTimestamp");
317
- var kArchiveTimestamp = Symbol.for("djs.structures.archiveTimestamp");
318
- var kAllow = Symbol.for("djs.structures.allow");
319
- var kDeny = Symbol.for("djs.structures.deny");
320
- var kLastPinTimestamp = Symbol.for("djs.structures.lastPinTimestamp");
321
- var kMixinConstruct = Symbol.for("djs.structures.mixin.construct");
322
- var kMixinToJSON = Symbol.for("djs.structures.mixin.toJSON");
399
+ var kData = /* @__PURE__ */ Symbol.for("djs.structures.data");
400
+ var kClone = /* @__PURE__ */ Symbol.for("djs.structures.clone");
401
+ var kPatch = /* @__PURE__ */ Symbol.for("djs.structures.patch");
402
+ var kExpiresTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.expiresTimestamp");
403
+ var kEndedTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.endedTimestamp");
404
+ var kCreatedTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.createdTimestamp");
405
+ var kEditedTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.editedTimestamp");
406
+ var kArchiveTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.archiveTimestamp");
407
+ var kAllow = /* @__PURE__ */ Symbol.for("djs.structures.allow");
408
+ var kDeny = /* @__PURE__ */ Symbol.for("djs.structures.deny");
409
+ var kBurstColors = /* @__PURE__ */ Symbol.for("djs.structures.burstColors");
410
+ var kLastPinTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.lastPinTimestamp");
411
+ var kMixinConstruct = /* @__PURE__ */ Symbol.for("djs.structures.mixin.construct");
412
+ var kMixinToJSON = /* @__PURE__ */ Symbol.for("djs.structures.mixin.toJSON");
323
413
 
324
414
  // src/channels/mixins/AppliedTagsMixin.ts
325
415
  var AppliedTagsMixin = class {
@@ -1023,14 +1113,6 @@ var Channel = class extends Structure {
1023
1113
  constructor(data) {
1024
1114
  super(data);
1025
1115
  }
1026
- /**
1027
- * {@inheritDoc Structure.[kPatch]}
1028
- *
1029
- * @internal
1030
- */
1031
- [kPatch](data) {
1032
- return super[kPatch](data);
1033
- }
1034
1116
  /**
1035
1117
  * The id of the channel
1036
1118
  */
@@ -1450,8 +1532,33 @@ Mixin(VoiceChannel, [
1450
1532
  VoiceChannelMixin
1451
1533
  ]);
1452
1534
 
1535
+ // src/interactions/ResolvedInteractionData.ts
1536
+ var ResolvedInteractionData = class extends Structure {
1537
+ static {
1538
+ __name(this, "ResolvedInteractionData");
1539
+ }
1540
+ /**
1541
+ * @param data - The raw data received from the API for the connection
1542
+ */
1543
+ constructor(data) {
1544
+ super(data);
1545
+ }
1546
+ };
1547
+
1548
+ // src/invites/Invite.ts
1549
+ var import_v105 = require("discord-api-types/v10");
1550
+
1551
+ // src/utils/optimization.ts
1552
+ function extendTemplate(superTemplate, additions) {
1553
+ return Object.defineProperties(additions, Object.getOwnPropertyDescriptors(superTemplate));
1554
+ }
1555
+ __name(extendTemplate, "extendTemplate");
1556
+ function dateToDiscordISOTimestamp(date) {
1557
+ return `${date.getUTCFullYear()}-${(date.getUTCMonth() + 1).toString().padStart(2, "0")}-${date.getUTCDate().toString().padStart(2, "0")}T${date.getUTCHours().toString().padStart(2, "0")}:${date.getUTCMinutes().toString().padStart(2, "0")}:${date.getUTCSeconds().toString().padStart(2, "0")}.${date.getUTCMilliseconds().toString().padEnd(6, "0")}+00:00`;
1558
+ }
1559
+ __name(dateToDiscordISOTimestamp, "dateToDiscordISOTimestamp");
1560
+
1453
1561
  // src/invites/Invite.ts
1454
- var import_v103 = require("discord-api-types/v10");
1455
1562
  var Invite = class extends Structure {
1456
1563
  static {
1457
1564
  __name(this, "Invite");
@@ -1487,15 +1594,6 @@ var Invite = class extends Structure {
1487
1594
  super(data);
1488
1595
  this.optimizeData(data);
1489
1596
  }
1490
- /**
1491
- * {@inheritDoc Structure.[kPatch]}
1492
- *
1493
- * @internal
1494
- */
1495
- [kPatch](data) {
1496
- super[kPatch](data);
1497
- return this;
1498
- }
1499
1597
  /**
1500
1598
  * {@inheritDoc Structure.optimizeData}
1501
1599
  *
@@ -1605,7 +1703,7 @@ var Invite = class extends Structure {
1605
1703
  * The URL to the invite
1606
1704
  */
1607
1705
  get url() {
1608
- return this.code ? `${import_v103.RouteBases.invite}/${this.code}` : null;
1706
+ return this.code ? `${import_v105.RouteBases.invite}/${this.code}` : null;
1609
1707
  }
1610
1708
  /**
1611
1709
  * When concatenated with a string, this automatically concatenates the invite's URL instead of the object.
@@ -1621,10 +1719,10 @@ var Invite = class extends Structure {
1621
1719
  toJSON() {
1622
1720
  const clone = super.toJSON();
1623
1721
  if (this[kExpiresTimestamp]) {
1624
- clone.expires_at = new Date(this[kExpiresTimestamp]).toISOString();
1722
+ clone.expires_at = dateToDiscordISOTimestamp(new Date(this[kExpiresTimestamp]));
1625
1723
  }
1626
1724
  if (this[kCreatedTimestamp]) {
1627
- clone.created_at = new Date(this[kCreatedTimestamp]).toISOString();
1725
+ clone.created_at = dateToDiscordISOTimestamp(new Date(this[kCreatedTimestamp]));
1628
1726
  }
1629
1727
  return clone;
1630
1728
  }
@@ -1636,316 +1734,2317 @@ var Invite = class extends Structure {
1636
1734
  }
1637
1735
  };
1638
1736
 
1639
- // src/users/AvatarDecorationData.ts
1640
- var AvatarDecorationData = class extends Structure {
1737
+ // src/messages/components/Component.ts
1738
+ var Component = class extends Structure {
1641
1739
  static {
1642
- __name(this, "AvatarDecorationData");
1740
+ __name(this, "Component");
1643
1741
  }
1644
1742
  /**
1645
- * The template used for removing data from the raw data stored for each Connection
1646
- */
1647
- static DataTemplate = {};
1648
- /**
1649
- * @param data - The raw data received from the API for the connection
1743
+ * @param data - The raw data received from the API for the component
1650
1744
  */
1651
1745
  constructor(data) {
1652
1746
  super(data);
1653
1747
  }
1654
1748
  /**
1655
- * The id of the SKU this avatar decoration is part of.
1749
+ * 32 bit integer used as an optional identifier for component
1656
1750
  */
1657
- get skuId() {
1658
- return this[kData].sku_id;
1751
+ get id() {
1752
+ return this[kData].id;
1659
1753
  }
1660
1754
  /**
1661
- * The asset of this avatar decoration.
1755
+ * The type of the component
1662
1756
  */
1663
- get asset() {
1664
- return this[kData].asset;
1757
+ get type() {
1758
+ return this[kData].type;
1665
1759
  }
1666
1760
  };
1667
1761
 
1668
- // src/users/User.ts
1669
- var import_snowflake2 = require("@sapphire/snowflake");
1670
- var User = class extends Structure {
1762
+ // src/messages/components/ActionRowComponent.ts
1763
+ var ActionRowComponent = class extends Component {
1671
1764
  static {
1672
- __name(this, "User");
1765
+ __name(this, "ActionRowComponent");
1673
1766
  }
1674
1767
  /**
1675
- * The template used for removing data from the raw data stored for each User
1768
+ * The template used for removing data from the raw data stored for each ActionRowComponent.
1676
1769
  */
1677
1770
  static DataTemplate = {};
1678
1771
  /**
1679
- * @param data - The raw data received from the API for the user
1772
+ * @param data - The raw data received from the API for the action row
1680
1773
  */
1681
1774
  constructor(data) {
1682
1775
  super(data);
1683
1776
  }
1684
- /**
1685
- * {@inheritDoc Structure.[kPatch]}
1686
- *
1687
- * @internal
1688
- */
1689
- [kPatch](data) {
1690
- return super[kPatch](data);
1777
+ };
1778
+
1779
+ // src/messages/components/ButtonComponent.ts
1780
+ var ButtonComponent = class extends Component {
1781
+ static {
1782
+ __name(this, "ButtonComponent");
1691
1783
  }
1692
1784
  /**
1693
- * The user's id
1785
+ * @param data - The raw data received from the API for the button
1694
1786
  */
1695
- get id() {
1696
- return this[kData].id;
1787
+ constructor(data) {
1788
+ super(data);
1697
1789
  }
1698
1790
  /**
1699
- * The username of the user
1791
+ * The style of the button
1700
1792
  */
1701
- get username() {
1702
- return this[kData].username;
1793
+ get style() {
1794
+ return this[kData].style;
1703
1795
  }
1704
1796
  /**
1705
- * The user's 4 digit tag, if a bot
1797
+ * The status of the button
1706
1798
  */
1707
- get discriminator() {
1708
- return this[kData].discriminator;
1799
+ get disabled() {
1800
+ return typeof this[kData].disabled === "boolean" ? this[kData].disabled : null;
1709
1801
  }
1710
- /**
1711
- * The user's display name, the application name for bots
1712
- */
1713
- get globalName() {
1714
- return this[kData].global_name;
1802
+ };
1803
+
1804
+ // src/messages/components/SelectMenuComponent.ts
1805
+ var SelectMenuComponent = class extends Component {
1806
+ static {
1807
+ __name(this, "SelectMenuComponent");
1715
1808
  }
1716
1809
  /**
1717
- * The name displayed in the client for this user when no nickname is set
1810
+ * @param data - The raw data received from the API for the select menu
1718
1811
  */
1719
- get displayName() {
1720
- return this.globalName ?? this.username;
1812
+ constructor(data) {
1813
+ super(data);
1721
1814
  }
1722
1815
  /**
1723
- * The user avatar's hash
1816
+ * The customId to be sent in the interaction when a selection is made
1724
1817
  */
1725
- get avatar() {
1726
- return this[kData].avatar;
1818
+ get customId() {
1819
+ return this[kData].custom_id;
1727
1820
  }
1728
1821
  /**
1729
- * Whether the user is a bot
1822
+ * Whether the select menu is disabled
1730
1823
  */
1731
- get bot() {
1732
- return this[kData].bot ?? false;
1824
+ get disabled() {
1825
+ return this[kData].disabled;
1733
1826
  }
1734
1827
  /**
1735
- * Whether the user is an Official Discord System user
1828
+ * The maximum number of items that can be chosen
1736
1829
  */
1737
- get system() {
1738
- return this[kData].system ?? false;
1830
+ get maxValues() {
1831
+ return this[kData].max_values;
1739
1832
  }
1740
1833
  /**
1741
- * Whether the user has mfa enabled
1742
- *
1743
- * @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
1834
+ * The minimum number of items that must be chosen
1744
1835
  */
1745
- get mfaEnabled() {
1746
- return this[kData].mfa_enabled;
1836
+ get minValues() {
1837
+ return this[kData].min_values;
1747
1838
  }
1748
1839
  /**
1749
- * The user's banner hash
1750
- *
1751
- * @remarks This property is only set when the user was manually fetched
1840
+ * Custom placeholder text if nothing is selected
1752
1841
  */
1753
- get banner() {
1754
- return this[kData].banner;
1842
+ get placeholder() {
1843
+ return this[kData].placeholder;
1755
1844
  }
1756
1845
  /**
1757
- * The base 10 accent color of the user's banner
1758
- *
1759
- * @remarks This property is only set when the user was manually fetched
1846
+ * Whether a selection is required
1760
1847
  */
1761
- get accentColor() {
1762
- return this[kData].accent_color;
1848
+ get required() {
1849
+ return this[kData].required;
1850
+ }
1851
+ };
1852
+
1853
+ // src/messages/components/ChannelSelectMenuComponent.ts
1854
+ var ChannelSelectMenuComponent = class extends SelectMenuComponent {
1855
+ static {
1856
+ __name(this, "ChannelSelectMenuComponent");
1763
1857
  }
1764
1858
  /**
1765
- * The user's primary Discord language
1766
- *
1767
- * @remarks This property is only set when the user was fetched with an Oauth2 token and the `identify` scope
1859
+ * The template used for removing data from the raw data stored for each ChannelSelectMenuComponent.
1768
1860
  */
1769
- get locale() {
1770
- return this[kData].locale;
1771
- }
1861
+ static DataTemplate = {};
1772
1862
  /**
1773
- * Whether the email on the user's account has been verified
1774
- *
1775
- * @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
1863
+ * @param data - The raw data received from the API for the channel select menu
1776
1864
  */
1777
- get verified() {
1778
- return this[kData].verified;
1865
+ constructor(data) {
1866
+ super(data);
1779
1867
  }
1780
1868
  /**
1781
- * The user's email
1782
- *
1783
- * @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
1869
+ * The list of channel types to include in the channel select component
1784
1870
  */
1785
- get email() {
1786
- return this[kData].email;
1871
+ get channelTypes() {
1872
+ return Array.isArray(this[kData].channel_types) ? this[kData].channel_types : null;
1873
+ }
1874
+ };
1875
+
1876
+ // src/messages/components/ContainerComponent.ts
1877
+ var ContainerComponent = class extends Component {
1878
+ static {
1879
+ __name(this, "ContainerComponent");
1787
1880
  }
1788
1881
  /**
1789
- * The type of nitro subscription on the user's account
1790
- *
1791
- * @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
1882
+ * The template used for removing data from the raw data stored for each ContainerComponent.
1792
1883
  */
1793
- get premiumType() {
1794
- return this[kData].premium_type;
1795
- }
1884
+ static DataTemplate = {};
1796
1885
  /**
1797
- * The timestamp the user was created at
1886
+ * @param data - The raw data received from the API for the container
1798
1887
  */
1799
- get createdTimestamp() {
1800
- return isIdSet(this.id) ? import_snowflake2.DiscordSnowflake.timestampFrom(this.id) : null;
1888
+ constructor(data) {
1889
+ super(data);
1801
1890
  }
1802
1891
  /**
1803
- * The time the user was created at
1892
+ * Color for the accent on the container as RGB
1804
1893
  */
1805
- get createdAt() {
1806
- const createdTimestamp = this.createdTimestamp;
1807
- return createdTimestamp ? new Date(createdTimestamp) : null;
1894
+ get accentColor() {
1895
+ return this[kData].accent_color;
1808
1896
  }
1809
1897
  /**
1810
- * The hexadecimal version of the user accent color, with a leading hash
1811
- *
1812
- * @remarks This property is only set when the user was manually fetched
1898
+ * The hexadecimal version of the accent color, with a leading hash
1813
1899
  */
1814
1900
  get hexAccentColor() {
1815
1901
  const accentColor = this.accentColor;
1816
1902
  if (typeof accentColor !== "number") return accentColor;
1817
1903
  return `#${accentColor.toString(16).padStart(6, "0")}`;
1818
1904
  }
1905
+ /**
1906
+ * Whether the container should be a spoiler (or blurred out)
1907
+ */
1908
+ get spoiler() {
1909
+ return this[kData].spoiler;
1910
+ }
1819
1911
  };
1820
1912
 
1821
- // src/users/Connection.ts
1822
- var Connection = class extends Structure {
1913
+ // src/messages/components/FileComponent.ts
1914
+ var FileComponent = class extends Component {
1823
1915
  static {
1824
- __name(this, "Connection");
1916
+ __name(this, "FileComponent");
1825
1917
  }
1826
1918
  /**
1827
- * The template used for removing data from the raw data stored for each Connection
1919
+ * The template used for removing data from the raw data stored for each FileComponent.
1828
1920
  */
1829
1921
  static DataTemplate = {};
1830
1922
  /**
1831
- * @param data - The raw data received from the API for the connection
1923
+ * @param data - The raw data received from the API for the file component
1832
1924
  */
1833
1925
  constructor(data) {
1834
1926
  super(data);
1835
1927
  }
1836
1928
  /**
1837
- * {@inheritDoc Structure.[kPatch]}
1838
- *
1839
- * @internal
1929
+ * Whether the media should be a spoiler (or blurred out)
1840
1930
  */
1841
- [kPatch](data) {
1842
- return super[kPatch](data);
1931
+ get spoiler() {
1932
+ return this[kData].spoiler;
1843
1933
  }
1844
1934
  /**
1845
- * The id of the connection account
1935
+ * The name of the file
1846
1936
  */
1847
- get id() {
1848
- return this[kData].id;
1937
+ get name() {
1938
+ return this[kData].name;
1849
1939
  }
1850
1940
  /**
1851
- * The username of the connection account
1941
+ * The size of the file in bytes
1852
1942
  */
1853
- get name() {
1854
- return this[kData].name;
1943
+ get size() {
1944
+ return this[kData].size;
1945
+ }
1946
+ };
1947
+
1948
+ // src/messages/components/FileUploadComponent.ts
1949
+ var FileUploadComponent = class extends Component {
1950
+ static {
1951
+ __name(this, "FileUploadComponent");
1855
1952
  }
1856
1953
  /**
1857
- * The type of service this connection is for
1954
+ * The template used for removing data from the raw data stored for each FileUploadComponent.
1858
1955
  */
1859
- get type() {
1860
- return this[kData].type;
1956
+ static DataTemplate = {};
1957
+ /**
1958
+ * @param data - The raw data received from the API for the file upload component
1959
+ */
1960
+ constructor(data) {
1961
+ super(data);
1861
1962
  }
1862
1963
  /**
1863
- * Whether the connection is revoked
1964
+ * The custom id to be sent in the interaction when the modal gets submitted
1864
1965
  */
1865
- get revoked() {
1866
- return this[kData].revoked ?? false;
1966
+ get customId() {
1967
+ return this[kData].custom_id;
1867
1968
  }
1868
1969
  /**
1869
- * Whether the connection is verified
1970
+ * The maximum number of items that can be uploaded
1870
1971
  */
1871
- get verified() {
1872
- return this[kData].verified;
1972
+ get maxValues() {
1973
+ return this[kData].max_values;
1873
1974
  }
1874
1975
  /**
1875
- * Whether friend sync is enabled for this connection
1976
+ * The minimum number of items that must be uploaded
1876
1977
  */
1877
- get friendSync() {
1878
- return this[kData].friend_sync;
1978
+ get minValues() {
1979
+ return this[kData].min_values;
1879
1980
  }
1880
1981
  /**
1881
- * Whether activities related to this connection are shown in the users presence
1982
+ * Whether the file upload requires files to be uploaded before submitting the modal
1882
1983
  */
1883
- get showActivity() {
1884
- return this[kData].show_activity;
1984
+ get required() {
1985
+ return this[kData].required;
1986
+ }
1987
+ };
1988
+
1989
+ // src/messages/components/LabeledButtonComponent.ts
1990
+ var LabeledButtonComponent = class extends ButtonComponent {
1991
+ static {
1992
+ __name(this, "LabeledButtonComponent");
1885
1993
  }
1886
1994
  /**
1887
- * Whether this connection has an Oauth2 token for console voice transfer
1995
+ * @param data - The raw data received from the API for the button
1888
1996
  */
1889
- get twoWayLink() {
1890
- return this[kData].two_way_link;
1997
+ constructor(data) {
1998
+ super(data);
1891
1999
  }
1892
2000
  /**
1893
- * The visibility state for this connection
2001
+ * The label to be displayed on the button
1894
2002
  */
1895
- get visibility() {
1896
- return this[kData].visibility;
2003
+ get label() {
2004
+ return this[kData].label;
1897
2005
  }
1898
2006
  };
1899
2007
 
1900
- // src/utils/optimization.ts
1901
- function extendTemplate(superTemplate, additions) {
1902
- return Object.defineProperties(additions, Object.getOwnPropertyDescriptors(superTemplate));
1903
- }
1904
- __name(extendTemplate, "extendTemplate");
2008
+ // src/messages/components/InteractiveButtonComponent.ts
2009
+ var InteractiveButtonComponent = class extends LabeledButtonComponent {
2010
+ static {
2011
+ __name(this, "InteractiveButtonComponent");
2012
+ }
2013
+ /**
2014
+ * The template used for removing data from the raw data stored for each InteractiveButtonComponent.
2015
+ */
2016
+ static DataTemplate = {};
2017
+ /**
2018
+ * @param data - The raw data received from the API for the interactive button
2019
+ */
2020
+ constructor(data) {
2021
+ super(data);
2022
+ }
2023
+ /**
2024
+ * The custom id to be sent in the interaction when clicked
2025
+ */
2026
+ get customId() {
2027
+ return this[kData].custom_id;
2028
+ }
2029
+ };
2030
+
2031
+ // src/messages/components/LinkButtonComponent.ts
2032
+ var LinkButtonComponent = class extends LabeledButtonComponent {
2033
+ static {
2034
+ __name(this, "LinkButtonComponent");
2035
+ }
2036
+ /**
2037
+ * The template used for removing data from the raw data stored for each LinkButtonComponent.
2038
+ */
2039
+ static DataTemplate = {};
2040
+ /**
2041
+ * @param data - The raw data received from the API for the link button
2042
+ */
2043
+ constructor(data) {
2044
+ super(data);
2045
+ }
2046
+ /**
2047
+ * The URL to direct users to when clicked
2048
+ */
2049
+ get url() {
2050
+ return this[kData].url;
2051
+ }
2052
+ };
2053
+
2054
+ // src/messages/components/MediaGalleryComponent.ts
2055
+ var MediaGalleryComponent = class extends Component {
2056
+ static {
2057
+ __name(this, "MediaGalleryComponent");
2058
+ }
2059
+ /**
2060
+ * The template used for removing data from the raw data stored for each MediaGalleryComponent.
2061
+ */
2062
+ static DataTemplate = {};
2063
+ /**
2064
+ * @param data - The raw data received from the API for the media gallery
2065
+ */
2066
+ constructor(data) {
2067
+ super(data);
2068
+ }
2069
+ };
2070
+
2071
+ // src/messages/components/MentionableSelectMenuComponent.ts
2072
+ var MentionableSelectMenuComponent = class extends SelectMenuComponent {
2073
+ static {
2074
+ __name(this, "MentionableSelectMenuComponent");
2075
+ }
2076
+ /**
2077
+ * The template used for removing data from the raw data stored for each MentionableSelectMenuComponent.
2078
+ */
2079
+ static DataTemplate = {};
2080
+ /**
2081
+ * @param data - The raw data received from the API for the mentionable select menu
2082
+ */
2083
+ constructor(data) {
2084
+ super(data);
2085
+ }
2086
+ };
2087
+
2088
+ // src/messages/components/PremiumButtonComponent.ts
2089
+ var PremiumButtonComponent = class extends ButtonComponent {
2090
+ static {
2091
+ __name(this, "PremiumButtonComponent");
2092
+ }
2093
+ /**
2094
+ * The template used for removing data from the raw data stored for each PremiumButtonComponent.
2095
+ */
2096
+ static DataTemplate = {};
2097
+ /**
2098
+ * @param data - The raw data received from the API for the premium button
2099
+ */
2100
+ constructor(data) {
2101
+ super(data);
2102
+ }
2103
+ /**
2104
+ * The id for a purchasable SKU
2105
+ */
2106
+ get skuId() {
2107
+ return this[kData].sku_id;
2108
+ }
2109
+ };
2110
+
2111
+ // src/messages/components/RoleSelectMenuComponent.ts
2112
+ var RoleSelectMenuComponent = class extends SelectMenuComponent {
2113
+ static {
2114
+ __name(this, "RoleSelectMenuComponent");
2115
+ }
2116
+ /**
2117
+ * The template used for removing data from the raw data stored for each RoleSelectMenuComponent.
2118
+ */
2119
+ static DataTemplate = {};
2120
+ /**
2121
+ * @param data - The raw data received from the API for the role select menu
2122
+ */
2123
+ constructor(data) {
2124
+ super(data);
2125
+ }
2126
+ };
2127
+
2128
+ // src/messages/components/SectionComponent.ts
2129
+ var SectionComponent = class extends Component {
2130
+ static {
2131
+ __name(this, "SectionComponent");
2132
+ }
2133
+ /**
2134
+ * The template used for removing data from the raw data stored for each SectionComponent.
2135
+ */
2136
+ static DataTemplate = {};
2137
+ /**
2138
+ * @param data - The raw data received from the API for the section
2139
+ */
2140
+ constructor(data) {
2141
+ super(data);
2142
+ }
2143
+ };
2144
+
2145
+ // src/messages/components/SeparatorComponent.ts
2146
+ var SeparatorComponent = class extends Component {
2147
+ static {
2148
+ __name(this, "SeparatorComponent");
2149
+ }
2150
+ /**
2151
+ * The template used for removing data from the raw data stored for each SeparatorComponent.
2152
+ */
2153
+ static DataTemplate = {};
2154
+ /**
2155
+ * @param data - The raw data received from the API for the separator
2156
+ */
2157
+ constructor(data) {
2158
+ super(data);
2159
+ }
2160
+ /**
2161
+ * Whether a visual divider should be displayed in the component
2162
+ */
2163
+ get divider() {
2164
+ return this[kData].divider;
2165
+ }
2166
+ /**
2167
+ * The size of the separator padding
2168
+ */
2169
+ get spacing() {
2170
+ return this[kData].spacing;
2171
+ }
2172
+ };
2173
+
2174
+ // src/messages/components/StringSelectMenuComponent.ts
2175
+ var StringSelectMenuComponent = class extends SelectMenuComponent {
2176
+ static {
2177
+ __name(this, "StringSelectMenuComponent");
2178
+ }
2179
+ /**
2180
+ * The template used for removing data from the raw data stored for each StringSelectMenuComponent.
2181
+ */
2182
+ static DataTemplate = {};
2183
+ /**
2184
+ * @param data - The raw data received from the API for the string select menu
2185
+ */
2186
+ constructor(data) {
2187
+ super(data);
2188
+ }
2189
+ };
2190
+
2191
+ // src/messages/components/TextDisplayComponent.ts
2192
+ var TextDisplayComponent = class extends Component {
2193
+ static {
2194
+ __name(this, "TextDisplayComponent");
2195
+ }
2196
+ /**
2197
+ * The template used for removing data from the raw data stored for each TextDisplayComponent.
2198
+ */
2199
+ static DataTemplate = {};
2200
+ /**
2201
+ * @param data - The raw data received from the API for the text display
2202
+ */
2203
+ constructor(data) {
2204
+ super(data);
2205
+ }
2206
+ /**
2207
+ * Text that will be displayed similar to a message
2208
+ */
2209
+ get content() {
2210
+ return this[kData].content;
2211
+ }
2212
+ };
2213
+
2214
+ // src/messages/components/TextInputComponent.ts
2215
+ var TextInputComponent = class extends Component {
2216
+ static {
2217
+ __name(this, "TextInputComponent");
2218
+ }
2219
+ /**
2220
+ * The template used for removing data from the raw data stored for each TextInputComponent.
2221
+ */
2222
+ static DataTemplate = {};
2223
+ /**
2224
+ * @param data - The raw data received from the API for the text input
2225
+ */
2226
+ constructor(data) {
2227
+ super(data);
2228
+ }
2229
+ /**
2230
+ * The custom id for the text input
2231
+ */
2232
+ get customId() {
2233
+ return this[kData].custom_id;
2234
+ }
2235
+ /**
2236
+ * Text that appears on top of the text input field
2237
+ */
2238
+ get label() {
2239
+ return this[kData].label;
2240
+ }
2241
+ /**
2242
+ * The maximal length of text input
2243
+ */
2244
+ get maxLength() {
2245
+ return this[kData].max_length;
2246
+ }
2247
+ /**
2248
+ * The minimal length of text input
2249
+ */
2250
+ get minLength() {
2251
+ return this[kData].min_length;
2252
+ }
2253
+ /**
2254
+ * The placeholder for the text input
2255
+ */
2256
+ get placeholder() {
2257
+ return this[kData].placeholder;
2258
+ }
2259
+ /**
2260
+ * Whether this text input is required
2261
+ */
2262
+ get required() {
2263
+ return this[kData].required;
2264
+ }
2265
+ /**
2266
+ * One of text input styles
2267
+ */
2268
+ get style() {
2269
+ return this[kData].style;
2270
+ }
2271
+ /**
2272
+ * The pre-filled text in the text input
2273
+ */
2274
+ get value() {
2275
+ return this[kData].value;
2276
+ }
2277
+ };
2278
+
2279
+ // src/messages/components/ThumbnailComponent.ts
2280
+ var ThumbnailComponent = class extends Component {
2281
+ static {
2282
+ __name(this, "ThumbnailComponent");
2283
+ }
2284
+ /**
2285
+ * The template used for removing data from the raw data stored for each ThumbnailComponent.
2286
+ */
2287
+ static DataTemplate = {};
2288
+ /**
2289
+ * @param data - The raw data received from the API for the thumbnail
2290
+ */
2291
+ constructor(data) {
2292
+ super(data);
2293
+ }
2294
+ /**
2295
+ * Alt text for the media
2296
+ */
2297
+ get description() {
2298
+ return this[kData].description;
2299
+ }
2300
+ /**
2301
+ * Whether the thumbnail should be a spoiler (or blurred out)
2302
+ */
2303
+ get spoiler() {
2304
+ return this[kData].spoiler;
2305
+ }
2306
+ };
2307
+
2308
+ // src/messages/components/UserSelectMenuComponent.ts
2309
+ var UserSelectMenuComponent = class extends SelectMenuComponent {
2310
+ static {
2311
+ __name(this, "UserSelectMenuComponent");
2312
+ }
2313
+ /**
2314
+ * The template used for removing data from the raw data stored for each UserSelectMenuComponent.
2315
+ */
2316
+ static DataTemplate = {};
2317
+ /**
2318
+ * @param data - The raw data received from the API for the user select menu
2319
+ */
2320
+ constructor(data) {
2321
+ super(data);
2322
+ }
2323
+ };
2324
+
2325
+ // src/messages/components/ComponentEmoji.ts
2326
+ var ComponentEmoji = class extends Structure {
2327
+ static {
2328
+ __name(this, "ComponentEmoji");
2329
+ }
2330
+ /**
2331
+ * The template used for removing data from the raw data stored for each ComponentEmoji.
2332
+ */
2333
+ static DataTemplate = {};
2334
+ /**
2335
+ * @param data - The raw data received from the API for the component emoji
2336
+ */
2337
+ constructor(data) {
2338
+ super(data);
2339
+ }
2340
+ /**
2341
+ * The id of the emoji
2342
+ */
2343
+ get id() {
2344
+ return this[kData].id;
2345
+ }
2346
+ /**
2347
+ * The name of the emoji
2348
+ */
2349
+ get name() {
2350
+ return this[kData].name;
2351
+ }
2352
+ /**
2353
+ * Whether this emoji is animated
2354
+ */
2355
+ get animated() {
2356
+ return this[kData].animated;
2357
+ }
2358
+ };
2359
+
2360
+ // src/messages/components/MediaGalleryItem.ts
2361
+ var MediaGalleryItem = class extends Structure {
2362
+ static {
2363
+ __name(this, "MediaGalleryItem");
2364
+ }
2365
+ /**
2366
+ * The template used for removing data from the raw data stored for each MediaGalleryItem.
2367
+ */
2368
+ static DataTemplate = {};
2369
+ /**
2370
+ * @param data - The raw data received from the API for the media gallery item
2371
+ */
2372
+ constructor(data) {
2373
+ super(data);
2374
+ }
2375
+ /**
2376
+ * Alt text for the media
2377
+ */
2378
+ get description() {
2379
+ return this[kData].description;
2380
+ }
2381
+ /**
2382
+ * Whether the media should be a spoiler (or blurred out)
2383
+ */
2384
+ get spoiler() {
2385
+ return this[kData].spoiler;
2386
+ }
2387
+ };
2388
+
2389
+ // src/messages/components/SelectMenuDefaultValue.ts
2390
+ var SelectMenuDefaultValue = class extends Structure {
2391
+ static {
2392
+ __name(this, "SelectMenuDefaultValue");
2393
+ }
2394
+ /**
2395
+ * The template used for removing data from the raw data stored for each SelectMenuDefaultValue.
2396
+ */
2397
+ static DataTemplate = {};
2398
+ /**
2399
+ * @param data - The raw data received from the API for the select menu default value
2400
+ */
2401
+ constructor(data) {
2402
+ super(data);
2403
+ }
2404
+ get id() {
2405
+ return this[kData].id;
2406
+ }
2407
+ get type() {
2408
+ return this[kData].type;
2409
+ }
2410
+ };
2411
+
2412
+ // src/messages/components/StringSelectMenuOption.ts
2413
+ var StringSelectMenuOption = class extends Structure {
2414
+ static {
2415
+ __name(this, "StringSelectMenuOption");
2416
+ }
2417
+ /**
2418
+ * The template used for removing data from the raw data stored for each StringSelectMenuOption.
2419
+ */
2420
+ static DataTemplate = {};
2421
+ /**
2422
+ * @param data - The raw data received from the API for the string select menu option
2423
+ */
2424
+ constructor(data) {
2425
+ super(data);
2426
+ }
2427
+ /**
2428
+ * Whether this option should be already-selected by default
2429
+ */
2430
+ get default() {
2431
+ return this[kData].default;
2432
+ }
2433
+ /**
2434
+ * An additional description of the option
2435
+ */
2436
+ get description() {
2437
+ return this[kData].description;
2438
+ }
2439
+ /**
2440
+ * The user-facing name of the option
2441
+ */
2442
+ get label() {
2443
+ return this[kData].label;
2444
+ }
2445
+ /**
2446
+ * The dev-defined value of the option
2447
+ */
2448
+ get value() {
2449
+ return this[kData].value;
2450
+ }
2451
+ };
2452
+
2453
+ // src/messages/components/UnfurledMediaItem.ts
2454
+ var UnfurledMediaItem = class extends Structure {
2455
+ static {
2456
+ __name(this, "UnfurledMediaItem");
2457
+ }
2458
+ /**
2459
+ * The template used for removing data from the raw data stored for each UnfurledMediaItem.
2460
+ */
2461
+ static DataTemplate = {};
2462
+ /**
2463
+ * @param data - The raw data received from the API for the unfurled media item
2464
+ */
2465
+ constructor(data) {
2466
+ super(data);
2467
+ }
2468
+ /**
2469
+ * The id of the uploaded attachment
2470
+ */
2471
+ get attachmentId() {
2472
+ return this[kData].attachment_id;
2473
+ }
2474
+ /**
2475
+ * The media type of the content
2476
+ */
2477
+ get contentType() {
2478
+ return this[kData].content_type;
2479
+ }
2480
+ /**
2481
+ * The height of the media item (if image)
2482
+ */
2483
+ get height() {
2484
+ return this[kData].height;
2485
+ }
2486
+ /**
2487
+ * The proxied URL of the media item
2488
+ */
2489
+ get proxyURL() {
2490
+ return this[kData].proxy_url;
2491
+ }
2492
+ /**
2493
+ * Supports arbitrary URLs and attachment:// references
2494
+ */
2495
+ get url() {
2496
+ return this[kData].url;
2497
+ }
2498
+ /**
2499
+ * The width of the media item (if image)
2500
+ */
2501
+ get width() {
2502
+ return this[kData].width;
2503
+ }
2504
+ };
2505
+
2506
+ // src/messages/embeds/Embed.ts
2507
+ var Embed = class extends Structure {
2508
+ static {
2509
+ __name(this, "Embed");
2510
+ }
2511
+ /**
2512
+ * The template used for removing data from the raw data stored for each Embed.
2513
+ */
2514
+ static DataTemplate = {
2515
+ set timestamp(_) {
2516
+ }
2517
+ };
2518
+ [kCreatedTimestamp] = null;
2519
+ /**
2520
+ * @param data - The raw data received from the API for the connection
2521
+ */
2522
+ constructor(data) {
2523
+ super(data);
2524
+ this.optimizeData(data);
2525
+ }
2526
+ /**
2527
+ * {@inheritDoc Structure.optimizeData}
2528
+ *
2529
+ * @internal
2530
+ */
2531
+ optimizeData(data) {
2532
+ if (data.timestamp) {
2533
+ this[kCreatedTimestamp] = Date.parse(data.timestamp);
2534
+ }
2535
+ }
2536
+ /**
2537
+ * The color code of the embed
2538
+ */
2539
+ get color() {
2540
+ return this[kData].color;
2541
+ }
2542
+ /**
2543
+ * The hexadecimal version of the embed color, with a leading hash
2544
+ */
2545
+ get hexColor() {
2546
+ const color = this.color;
2547
+ if (typeof color !== "number") return color;
2548
+ return `#${color.toString(16).padStart(6, "0")}`;
2549
+ }
2550
+ /**
2551
+ * The description of the embed
2552
+ */
2553
+ get description() {
2554
+ return this[kData].description;
2555
+ }
2556
+ /**
2557
+ * THe title of the embed
2558
+ */
2559
+ get title() {
2560
+ return this[kData].title;
2561
+ }
2562
+ /**
2563
+ * The timestamp of the embed content
2564
+ */
2565
+ get timestamp() {
2566
+ return this[kCreatedTimestamp];
2567
+ }
2568
+ /**
2569
+ * The type of embed (always "rich" for webhook embeds)
2570
+ */
2571
+ get type() {
2572
+ return this[kData].type;
2573
+ }
2574
+ /**
2575
+ * The URL of the embed
2576
+ */
2577
+ get url() {
2578
+ return this[kData].url;
2579
+ }
2580
+ /**
2581
+ * {@inheritDoc Structure.toJSON}
2582
+ */
2583
+ toJSON() {
2584
+ const clone = super.toJSON();
2585
+ if (this[kCreatedTimestamp]) {
2586
+ clone.timestamp = dateToDiscordISOTimestamp(new Date(this[kCreatedTimestamp]));
2587
+ }
2588
+ return clone;
2589
+ }
2590
+ };
2591
+
2592
+ // src/messages/embeds/EmbedAuthor.ts
2593
+ var EmbedAuthor = class extends Structure {
2594
+ static {
2595
+ __name(this, "EmbedAuthor");
2596
+ }
2597
+ /**
2598
+ * @param data - The raw data received from the API for the connection
2599
+ */
2600
+ constructor(data) {
2601
+ super(data);
2602
+ }
2603
+ /**
2604
+ * The name of the author
2605
+ */
2606
+ get name() {
2607
+ return this[kData].name;
2608
+ }
2609
+ /**
2610
+ * The URL of author icon
2611
+ */
2612
+ get iconURL() {
2613
+ return this[kData].icon_url;
2614
+ }
2615
+ /**
2616
+ * A proxied URL of author icon
2617
+ */
2618
+ get proxyIconURL() {
2619
+ return this[kData].proxy_icon_url;
2620
+ }
2621
+ /**
2622
+ * The URL of the author
2623
+ */
2624
+ get url() {
2625
+ return this[kData].url;
2626
+ }
2627
+ };
2628
+
2629
+ // src/messages/embeds/EmbedField.ts
2630
+ var EmbedField = class extends Structure {
2631
+ static {
2632
+ __name(this, "EmbedField");
2633
+ }
2634
+ /**
2635
+ * @param data - The raw data received from the API for the connection
2636
+ */
2637
+ constructor(data) {
2638
+ super(data);
2639
+ }
2640
+ /**
2641
+ * The name of the field
2642
+ */
2643
+ get name() {
2644
+ return this[kData].name;
2645
+ }
2646
+ /**
2647
+ * The value of the field
2648
+ */
2649
+ get value() {
2650
+ return this[kData].value;
2651
+ }
2652
+ /**
2653
+ * Whether this field should display inline
2654
+ */
2655
+ get inline() {
2656
+ return this[kData].inline;
2657
+ }
2658
+ };
2659
+
2660
+ // src/messages/embeds/EmbedFooter.ts
2661
+ var EmbedFooter = class extends Structure {
2662
+ static {
2663
+ __name(this, "EmbedFooter");
2664
+ }
2665
+ /**
2666
+ * @param data - The raw data received from the API for the connection
2667
+ */
2668
+ constructor(data) {
2669
+ super(data);
2670
+ }
2671
+ /**
2672
+ * The footer text
2673
+ */
2674
+ get text() {
2675
+ return this[kData].text;
2676
+ }
2677
+ /**
2678
+ * The URL of the footer icon
2679
+ */
2680
+ get iconURL() {
2681
+ return this[kData].icon_url;
2682
+ }
2683
+ /**
2684
+ * A proxied URL of the footer icon
2685
+ */
2686
+ get proxyIconURL() {
2687
+ return this[kData].proxy_icon_url;
2688
+ }
2689
+ };
2690
+
2691
+ // src/messages/embeds/EmbedImage.ts
2692
+ var EmbedImage = class extends Structure {
2693
+ static {
2694
+ __name(this, "EmbedImage");
2695
+ }
2696
+ /**
2697
+ * @param data - The raw data received from the API for the connection
2698
+ */
2699
+ constructor(data) {
2700
+ super(data);
2701
+ }
2702
+ /**
2703
+ * The height of the image
2704
+ */
2705
+ get height() {
2706
+ return this[kData].height;
2707
+ }
2708
+ /**
2709
+ * The width of the image
2710
+ */
2711
+ get width() {
2712
+ return this[kData].width;
2713
+ }
2714
+ /**
2715
+ * A proxied URL of the image
2716
+ */
2717
+ get proxyURL() {
2718
+ return this[kData].proxy_url;
2719
+ }
2720
+ /**
2721
+ * Source URL of the image
2722
+ */
2723
+ get url() {
2724
+ return this[kData].url;
2725
+ }
2726
+ };
2727
+
2728
+ // src/messages/embeds/EmbedProvider.ts
2729
+ var EmbedProvider = class extends Structure {
2730
+ static {
2731
+ __name(this, "EmbedProvider");
2732
+ }
2733
+ /**
2734
+ * @param data - The raw data received from the API for the connection
2735
+ */
2736
+ constructor(data) {
2737
+ super(data);
2738
+ }
2739
+ /**
2740
+ * The name of the provider
2741
+ */
2742
+ get name() {
2743
+ return this[kData].name;
2744
+ }
2745
+ /**
2746
+ * The URL of the provider
2747
+ */
2748
+ get url() {
2749
+ return this[kData].url;
2750
+ }
2751
+ };
2752
+
2753
+ // src/messages/embeds/EmbedThumbnail.ts
2754
+ var EmbedThumbnail = class extends Structure {
2755
+ static {
2756
+ __name(this, "EmbedThumbnail");
2757
+ }
2758
+ /**
2759
+ * @param data - The raw data received from the API for the connection
2760
+ */
2761
+ constructor(data) {
2762
+ super(data);
2763
+ }
2764
+ /**
2765
+ * The height of the thumbnail
2766
+ */
2767
+ get height() {
2768
+ return this[kData].height;
2769
+ }
2770
+ /**
2771
+ * The width of the thumbnail
2772
+ */
2773
+ get width() {
2774
+ return this[kData].width;
2775
+ }
2776
+ /**
2777
+ * A proxied URL of the thumbnail
2778
+ */
2779
+ get proxyURL() {
2780
+ return this[kData].proxy_url;
2781
+ }
2782
+ /**
2783
+ * The source URL of the thumbnail
2784
+ */
2785
+ get url() {
2786
+ return this[kData].url;
2787
+ }
2788
+ };
2789
+
2790
+ // src/messages/embeds/EmbedVideo.ts
2791
+ var EmbedVideo = class extends Structure {
2792
+ static {
2793
+ __name(this, "EmbedVideo");
2794
+ }
2795
+ /**
2796
+ * @param data - The raw data received from the API for the connection
2797
+ */
2798
+ constructor(data) {
2799
+ super(data);
2800
+ }
2801
+ /**
2802
+ * The height of the video
2803
+ */
2804
+ get height() {
2805
+ return this[kData].height;
2806
+ }
2807
+ /**
2808
+ * The width of the video
2809
+ */
2810
+ get width() {
2811
+ return this[kData].width;
2812
+ }
2813
+ /**
2814
+ * A proxied URL of the video
2815
+ */
2816
+ get proxyURL() {
2817
+ return this[kData].proxy_url;
2818
+ }
2819
+ /**
2820
+ * The source URL of the video
2821
+ */
2822
+ get url() {
2823
+ return this[kData].url;
2824
+ }
2825
+ };
2826
+
2827
+ // src/messages/InteractionMetadata.ts
2828
+ var InteractionMetadata = class extends Structure {
2829
+ static {
2830
+ __name(this, "InteractionMetadata");
2831
+ }
2832
+ /**
2833
+ * @param data - The raw data received from the API for the connection
2834
+ */
2835
+ constructor(data) {
2836
+ super(data);
2837
+ }
2838
+ /**
2839
+ * The id of the interaction
2840
+ */
2841
+ get id() {
2842
+ return this[kData].id;
2843
+ }
2844
+ /**
2845
+ * The id of the original response message, present only on follow-up messages
2846
+ */
2847
+ get originalResponseMessageId() {
2848
+ return this[kData].original_response_message_id;
2849
+ }
2850
+ /**
2851
+ * The type of interaction
2852
+ */
2853
+ get type() {
2854
+ return this[kData].type;
2855
+ }
2856
+ };
2857
+
2858
+ // src/messages/ApplicationCommandInteractionMetadata.ts
2859
+ var ApplicationCommandInteractionMetadata = class extends InteractionMetadata {
2860
+ static {
2861
+ __name(this, "ApplicationCommandInteractionMetadata");
2862
+ }
2863
+ /**
2864
+ * The template used for removing data from the raw data stored for each ApplicationCommandInteractionMetadata.
2865
+ */
2866
+ static DataTemplate = {};
2867
+ /**
2868
+ * @param data - The raw data received from the API for the connection
2869
+ */
2870
+ constructor(data) {
2871
+ super(data);
2872
+ }
2873
+ /**
2874
+ * The id of the message the command was run on
2875
+ */
2876
+ get targetMessageId() {
2877
+ return this[kData].target_message_id;
2878
+ }
2879
+ };
2880
+
2881
+ // src/messages/Attachment.ts
2882
+ var Attachment = class extends Structure {
2883
+ static {
2884
+ __name(this, "Attachment");
2885
+ }
2886
+ /**
2887
+ * The template used for removing data from the raw data stored for each Attachment.
2888
+ */
2889
+ static DataTemplate = {};
2890
+ /**
2891
+ * @param data - The raw data received from the API for the connection
2892
+ */
2893
+ constructor(data) {
2894
+ super(data);
2895
+ }
2896
+ /**
2897
+ * The id of the attachment
2898
+ */
2899
+ get id() {
2900
+ return this[kData].id;
2901
+ }
2902
+ /**
2903
+ * The name of the attached file
2904
+ */
2905
+ get filename() {
2906
+ return this[kData].filename;
2907
+ }
2908
+ /**
2909
+ * The title of the file
2910
+ */
2911
+ get title() {
2912
+ return this[kData].title;
2913
+ }
2914
+ /**
2915
+ * The description for the file
2916
+ */
2917
+ get description() {
2918
+ return this[kData].description;
2919
+ }
2920
+ /**
2921
+ * The attachment's media type
2922
+ */
2923
+ get contentType() {
2924
+ return this[kData].content_type;
2925
+ }
2926
+ /**
2927
+ * The size of the file in bytes
2928
+ */
2929
+ get size() {
2930
+ return this[kData].size;
2931
+ }
2932
+ /**
2933
+ * The source URL of the file
2934
+ */
2935
+ get url() {
2936
+ return this[kData].url;
2937
+ }
2938
+ /**
2939
+ * A proxied URL of the file
2940
+ */
2941
+ get proxyURL() {
2942
+ return this[kData].proxy_url;
2943
+ }
2944
+ /**
2945
+ * The height of the file (if image)
2946
+ */
2947
+ get height() {
2948
+ return this[kData].height;
2949
+ }
2950
+ /**
2951
+ * The width of the file (if image)
2952
+ */
2953
+ get width() {
2954
+ return this[kData].width;
2955
+ }
2956
+ /**
2957
+ * Whether this attachment is ephemeral
2958
+ */
2959
+ get ephemeral() {
2960
+ return this[kData].ephemeral;
2961
+ }
2962
+ /**
2963
+ * The duration of the audio file
2964
+ */
2965
+ get durationSecs() {
2966
+ return this[kData].duration_secs;
2967
+ }
2968
+ /**
2969
+ * Base64 encoded bytearray representing a sampled waveform
2970
+ */
2971
+ get waveform() {
2972
+ return this[kData].waveform;
2973
+ }
2974
+ /**
2975
+ * Attachment flags combined as a bitfield
2976
+ */
2977
+ get flags() {
2978
+ const flags = this[kData].flags;
2979
+ return flags ? new AttachmentFlagsBitField(this[kData].flags) : null;
2980
+ }
2981
+ };
2982
+
2983
+ // src/messages/ChannelMention.ts
2984
+ var ChannelMention = class extends Structure {
2985
+ static {
2986
+ __name(this, "ChannelMention");
2987
+ }
2988
+ /**
2989
+ * The template used for removing data from the raw data stored for each ChannelMention.
2990
+ */
2991
+ static DataTemplate = {};
2992
+ /**
2993
+ * @param data - The raw data received from the API for the channel mention
2994
+ */
2995
+ constructor(data) {
2996
+ super(data);
2997
+ }
2998
+ /**
2999
+ * The type of the mentioned channel
3000
+ */
3001
+ get type() {
3002
+ return this[kData].type;
3003
+ }
3004
+ /**
3005
+ * The name of the mentioned channel
3006
+ */
3007
+ get name() {
3008
+ return this[kData].name;
3009
+ }
3010
+ /**
3011
+ * The id of the mentioned channel
3012
+ */
3013
+ get id() {
3014
+ return this[kData].id;
3015
+ }
3016
+ /**
3017
+ * The id of the guild the mentioned channel is in
3018
+ */
3019
+ get guildId() {
3020
+ return this[kData].guild_id;
3021
+ }
3022
+ };
3023
+
3024
+ // src/messages/Message.ts
3025
+ var import_snowflake2 = require("@sapphire/snowflake");
3026
+ var Message = class extends Structure {
3027
+ static {
3028
+ __name(this, "Message");
3029
+ }
3030
+ /**
3031
+ * The template used for removing data from the raw data stored for each Message
3032
+ */
3033
+ static DataTemplate = {
3034
+ set timestamp(_) {
3035
+ },
3036
+ set edited_timestamp(_) {
3037
+ }
3038
+ };
3039
+ [kEditedTimestamp] = null;
3040
+ /**
3041
+ * @param data - The raw data received from the API for the message
3042
+ */
3043
+ constructor(data) {
3044
+ super(data);
3045
+ this.optimizeData(data);
3046
+ }
3047
+ /**
3048
+ * {@inheritDoc Structure.optimizeData}
3049
+ *
3050
+ * @internal
3051
+ */
3052
+ optimizeData(data) {
3053
+ if (data.edited_timestamp) {
3054
+ this[kEditedTimestamp] = Date.parse(data.edited_timestamp);
3055
+ }
3056
+ }
3057
+ /**
3058
+ * The message's id
3059
+ */
3060
+ get id() {
3061
+ return this[kData].id;
3062
+ }
3063
+ /**
3064
+ * The id of the interaction's application, if this message is a reply to an interaction
3065
+ */
3066
+ get applicationId() {
3067
+ return this[kData].application_id;
3068
+ }
3069
+ /**
3070
+ * The channel's id this message was sent in
3071
+ */
3072
+ get channelId() {
3073
+ return this[kData].channel_id;
3074
+ }
3075
+ /**
3076
+ * The timestamp this message was created at
3077
+ */
3078
+ get createdTimestamp() {
3079
+ return isIdSet(this.id) ? import_snowflake2.DiscordSnowflake.timestampFrom(this.id) : null;
3080
+ }
3081
+ /**
3082
+ * The time the message was created at
3083
+ */
3084
+ get createdAt() {
3085
+ const createdTimestamp = this.createdTimestamp;
3086
+ return createdTimestamp ? new Date(createdTimestamp) : null;
3087
+ }
3088
+ /**
3089
+ * The content of the message
3090
+ */
3091
+ get content() {
3092
+ return this[kData].content;
3093
+ }
3094
+ /**
3095
+ * The timestamp this message was last edited at, or `null` if it never was edited
3096
+ */
3097
+ get editedTimestamp() {
3098
+ return this[kEditedTimestamp];
3099
+ }
3100
+ /**
3101
+ * The time the message was last edited at, or `null` if it never was edited
3102
+ */
3103
+ get editedAt() {
3104
+ const editedTimestamp = this.editedTimestamp;
3105
+ return editedTimestamp ? new Date(editedTimestamp) : null;
3106
+ }
3107
+ /**
3108
+ * The flags of this message as a bit field
3109
+ */
3110
+ get flags() {
3111
+ const flags = this[kData].flags;
3112
+ return flags ? new MessageFlagsBitField(this[kData].flags) : null;
3113
+ }
3114
+ /**
3115
+ * The nonce used when sending this message.
3116
+ *
3117
+ * @remarks This is only present in MESSAGE_CREATE event, if a nonce was provided when sending
3118
+ */
3119
+ get nonce() {
3120
+ return this[kData].nonce;
3121
+ }
3122
+ /**
3123
+ * Whether this message is pinned in its channel
3124
+ */
3125
+ get pinned() {
3126
+ return this[kData].pinned;
3127
+ }
3128
+ /**
3129
+ * A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
3130
+ * It can be used to estimate the relative position of the message in a thread in company with `totalMessageSent` on parent thread
3131
+ */
3132
+ get position() {
3133
+ return this[kData].position;
3134
+ }
3135
+ /**
3136
+ * Whether this message was a TTS message
3137
+ */
3138
+ get tts() {
3139
+ return this[kData].tts;
3140
+ }
3141
+ /**
3142
+ * The type of message
3143
+ */
3144
+ get type() {
3145
+ return this[kData].type;
3146
+ }
3147
+ /**
3148
+ * If the message is generated by a webhook, this is the webhook's id
3149
+ */
3150
+ get webhookId() {
3151
+ return this[kData].webhook_id;
3152
+ }
3153
+ /**
3154
+ * {@inheritDoc Structure.toJSON}
3155
+ */
3156
+ toJSON() {
3157
+ const clone = super.toJSON();
3158
+ if (this[kEditedTimestamp]) {
3159
+ clone.edited_timestamp = dateToDiscordISOTimestamp(new Date(this[kEditedTimestamp]));
3160
+ }
3161
+ const createdAt = this.createdAt;
3162
+ if (createdAt) {
3163
+ clone.timestamp = dateToDiscordISOTimestamp(createdAt);
3164
+ }
3165
+ return clone;
3166
+ }
3167
+ };
3168
+
3169
+ // src/messages/MessageActivity.ts
3170
+ var MessageActivity = class extends Structure {
3171
+ static {
3172
+ __name(this, "MessageActivity");
3173
+ }
3174
+ /**
3175
+ * The template used for removing data from the raw data stored for each MessageActivity.
3176
+ */
3177
+ static DataTemplate = {};
3178
+ /**
3179
+ * @param data - The raw data received from the API for the connection
3180
+ */
3181
+ constructor(data) {
3182
+ super(data);
3183
+ }
3184
+ /**
3185
+ * The party id from a Rich Presence event
3186
+ */
3187
+ get partyId() {
3188
+ return this[kData].party_id;
3189
+ }
3190
+ /**
3191
+ * The type of message activity
3192
+ */
3193
+ get type() {
3194
+ return this[kData].type;
3195
+ }
3196
+ };
3197
+
3198
+ // src/messages/MessageCall.ts
3199
+ var MessageCall = class extends Structure {
3200
+ static {
3201
+ __name(this, "MessageCall");
3202
+ }
3203
+ /**
3204
+ * The template used for removing data from the raw data stored for each MessageCall
3205
+ */
3206
+ static DataTemplate = {
3207
+ set ended_timestamp(_) {
3208
+ }
3209
+ };
3210
+ [kEndedTimestamp] = null;
3211
+ /**
3212
+ * @param data - The raw data received from the API for the message call
3213
+ */
3214
+ constructor(data) {
3215
+ super(data);
3216
+ this.optimizeData(data);
3217
+ }
3218
+ /**
3219
+ * {@inheritDoc Structure.optimizeData}
3220
+ *
3221
+ * @internal
3222
+ */
3223
+ optimizeData(data) {
3224
+ if (data.ended_timestamp) {
3225
+ this[kEndedTimestamp] = Date.parse(data.ended_timestamp);
3226
+ }
3227
+ }
3228
+ /**
3229
+ * The timestamp this call ended at, or `null` if it didn't end yet
3230
+ */
3231
+ get endedTimestamp() {
3232
+ return this[kEndedTimestamp];
3233
+ }
3234
+ /**
3235
+ * The time the call ended at, or `null` if it didn't end yet
3236
+ */
3237
+ get endedAt() {
3238
+ const endedTimestamp = this.endedTimestamp;
3239
+ return endedTimestamp ? new Date(endedTimestamp) : null;
3240
+ }
3241
+ /**
3242
+ * {@inheritDoc Structure.toJSON}
3243
+ */
3244
+ toJSON() {
3245
+ const clone = super.toJSON();
3246
+ if (this[kEndedTimestamp]) {
3247
+ clone.ended_timestamp = dateToDiscordISOTimestamp(new Date(this[kEndedTimestamp]));
3248
+ }
3249
+ return clone;
3250
+ }
3251
+ };
3252
+
3253
+ // src/messages/MessageComponentInteractionMetadata.ts
3254
+ var MessageComponentInteractionMetadata = class extends InteractionMetadata {
3255
+ static {
3256
+ __name(this, "MessageComponentInteractionMetadata");
3257
+ }
3258
+ /**
3259
+ * The template used for removing data from the raw data stored for each MessageComponentInteractionMetadata.
3260
+ */
3261
+ static DataTemplate = {};
3262
+ /**
3263
+ * @param data - The raw data received from the API for the connection
3264
+ */
3265
+ constructor(data) {
3266
+ super(data);
3267
+ }
3268
+ /**
3269
+ * The id of the message that contained the interactive component
3270
+ */
3271
+ get interactedMessageId() {
3272
+ return this[kData].interacted_message_id;
3273
+ }
3274
+ };
3275
+
3276
+ // src/messages/MessageReference.ts
3277
+ var import_v106 = require("discord-api-types/v10");
3278
+ var MessageReference = class extends Structure {
3279
+ static {
3280
+ __name(this, "MessageReference");
3281
+ }
3282
+ /**
3283
+ * The template used for removing data from the raw data stored for each MessageReference.
3284
+ */
3285
+ static DataTemplate = {};
3286
+ /**
3287
+ * @param data - The raw data received from the API for the message reference
3288
+ */
3289
+ constructor(data) {
3290
+ super(data);
3291
+ }
3292
+ /**
3293
+ * The type of this reference
3294
+ */
3295
+ get type() {
3296
+ return "type" in this[kData] ? this[kData].type : import_v106.MessageReferenceType.Default;
3297
+ }
3298
+ /**
3299
+ * The id of the referenced message
3300
+ */
3301
+ get messageId() {
3302
+ return this[kData].message_id;
3303
+ }
3304
+ /**
3305
+ * The id of the channel the referenced message was sent in
3306
+ */
3307
+ get channelId() {
3308
+ return this[kData].channel_id;
3309
+ }
3310
+ /**
3311
+ * The id of the guild the referenced message was sent in
3312
+ */
3313
+ get guildId() {
3314
+ return this[kData].guild_id;
3315
+ }
3316
+ };
3317
+
3318
+ // src/messages/ModalSubmitInteractionMetadata.ts
3319
+ var ModalSubmitInteractionMetadata = class extends InteractionMetadata {
3320
+ static {
3321
+ __name(this, "ModalSubmitInteractionMetadata");
3322
+ }
3323
+ /**
3324
+ * The template used for removing data from the raw data stored for each ModalSubmitInteractionMetadata.
3325
+ */
3326
+ static DataTemplate = {};
3327
+ /**
3328
+ * @param data - The raw data received from the API for the connection
3329
+ */
3330
+ constructor(data) {
3331
+ super(data);
3332
+ }
3333
+ };
3334
+
3335
+ // src/messages/Reaction.ts
3336
+ var Reaction = class extends Structure {
3337
+ static {
3338
+ __name(this, "Reaction");
3339
+ }
3340
+ /**
3341
+ * The template used for removing data from the raw data stored for each Reaction.
3342
+ */
3343
+ static DataTemplate = {
3344
+ set burst_colors(_) {
3345
+ }
3346
+ };
3347
+ [kBurstColors] = null;
3348
+ /**
3349
+ * @param data - The raw data received from the API for the reaction
3350
+ */
3351
+ constructor(data) {
3352
+ super(data);
3353
+ this.optimizeData(data);
3354
+ }
3355
+ /**
3356
+ * {@inheritDoc Structure.optimizeData}
3357
+ *
3358
+ * @internal
3359
+ */
3360
+ optimizeData(data) {
3361
+ if (data.burst_colors) {
3362
+ this[kBurstColors] = data.burst_colors.map((color) => Number.parseInt(color, 16));
3363
+ }
3364
+ }
3365
+ /**
3366
+ * The amount how often this emoji has been used to react (including super reacts)
3367
+ */
3368
+ get count() {
3369
+ return this[kData].count;
3370
+ }
3371
+ /**
3372
+ * Whether the current user has reacted using this emoji
3373
+ */
3374
+ get me() {
3375
+ return this[kData].me;
3376
+ }
3377
+ /**
3378
+ * Whether the current user has super-reacted using this emoji
3379
+ */
3380
+ get meBurst() {
3381
+ return this[kData].me_burst;
3382
+ }
3383
+ /**
3384
+ * The colors used for super reaction
3385
+ */
3386
+ get burstColors() {
3387
+ return this[kBurstColors];
3388
+ }
3389
+ /**
3390
+ * {@inheritDoc Structure.toJSON}
3391
+ */
3392
+ toJSON() {
3393
+ const clone = super.toJSON();
3394
+ if (this[kBurstColors]) {
3395
+ clone.burst_colors = this[kBurstColors].map((color) => `#${color.toString(16).padStart(6, "0")}`);
3396
+ }
3397
+ return clone;
3398
+ }
3399
+ };
3400
+
3401
+ // src/messages/ReactionCountDetails.ts
3402
+ var ReactionCountDetails = class extends Structure {
3403
+ static {
3404
+ __name(this, "ReactionCountDetails");
3405
+ }
3406
+ /**
3407
+ * The template used for removing data from the raw data stored for each ReactionCountDetails.
3408
+ */
3409
+ static DataTemplate = {};
3410
+ /**
3411
+ * @param data - The raw data received from the API for the reaction count details
3412
+ */
3413
+ constructor(data) {
3414
+ super(data);
3415
+ }
3416
+ /**
3417
+ * The amount how often this emoji has been used to react (excluding super reacts)
3418
+ */
3419
+ get normal() {
3420
+ return this[kData].normal;
3421
+ }
3422
+ /**
3423
+ * The amount how often this emoji has been used to super-react
3424
+ */
3425
+ get burst() {
3426
+ return this[kData].burst;
3427
+ }
3428
+ };
3429
+
3430
+ // src/messages/RoleSubscriptionData.ts
3431
+ var RoleSubscriptionData = class extends Structure {
3432
+ static {
3433
+ __name(this, "RoleSubscriptionData");
3434
+ }
3435
+ /**
3436
+ * @param data - The raw data received from the API for the connection
3437
+ */
3438
+ constructor(data) {
3439
+ super(data);
3440
+ }
3441
+ /**
3442
+ * The id of the SKU and listing the user is subscribed to
3443
+ */
3444
+ get roleSubscriptionListingId() {
3445
+ return this[kData].role_subscription_listing_id;
3446
+ }
3447
+ /**
3448
+ * The name of the tier the user is subscribed to
3449
+ */
3450
+ get tierName() {
3451
+ return this[kData].tier_name;
3452
+ }
3453
+ /**
3454
+ * The number of months the user has been subscribed for
3455
+ */
3456
+ get totalMonthsSubscribed() {
3457
+ return this[kData].total_months_subscribed;
3458
+ }
3459
+ /**
3460
+ * Whether this notification is for a renewal
3461
+ */
3462
+ get isRenewal() {
3463
+ return this[kData].is_renewal;
3464
+ }
3465
+ };
3466
+
3467
+ // src/polls/Poll.ts
3468
+ var Poll = class extends Structure {
3469
+ static {
3470
+ __name(this, "Poll");
3471
+ }
3472
+ /**
3473
+ * The template used for removing data from the raw data stored for each Poll.
3474
+ */
3475
+ static DataTemplate = {
3476
+ set expiry(_) {
3477
+ }
3478
+ };
3479
+ /**
3480
+ * Optimized storage of {@link discord-api-types/v10#(APIPoll:interface).expiry}
3481
+ *
3482
+ * @internal
3483
+ */
3484
+ [kExpiresTimestamp] = null;
3485
+ /**
3486
+ * @param data - The raw data received from the API for the poll
3487
+ */
3488
+ constructor(data) {
3489
+ super(data);
3490
+ this.optimizeData(data);
3491
+ }
3492
+ /**
3493
+ * {@inheritDoc Structure.optimizeData}
3494
+ *
3495
+ * @internal
3496
+ */
3497
+ optimizeData(data) {
3498
+ if (data.expiry) {
3499
+ this[kExpiresTimestamp] = Date.parse(data.expiry);
3500
+ }
3501
+ }
3502
+ /**
3503
+ * Whether a user can select multiple answers
3504
+ */
3505
+ get allowMultiselect() {
3506
+ return this[kData].allow_multiselect;
3507
+ }
3508
+ /**
3509
+ * The layout type of the poll
3510
+ */
3511
+ get layoutType() {
3512
+ return this[kData].layout_type;
3513
+ }
3514
+ /**
3515
+ * The timestamp this poll will expire at
3516
+ */
3517
+ get expiresTimestamp() {
3518
+ return this[kExpiresTimestamp];
3519
+ }
3520
+ /**
3521
+ * The time the poll will expire at
3522
+ */
3523
+ get expiresAt() {
3524
+ const expiresTimestamp = this.expiresTimestamp;
3525
+ return expiresTimestamp ? new Date(expiresTimestamp) : null;
3526
+ }
3527
+ /**
3528
+ * {@inheritDoc Structure.toJSON}
3529
+ */
3530
+ toJSON() {
3531
+ const clone = super.toJSON();
3532
+ if (this[kExpiresTimestamp]) {
3533
+ clone.expiry = dateToDiscordISOTimestamp(new Date(this[kExpiresTimestamp]));
3534
+ }
3535
+ return clone;
3536
+ }
3537
+ };
3538
+
3539
+ // src/polls/PollAnswer.ts
3540
+ var PollAnswer = class extends Structure {
3541
+ static {
3542
+ __name(this, "PollAnswer");
3543
+ }
3544
+ /**
3545
+ * The template used for removing data from the raw data stored for each PollAnswer.
3546
+ */
3547
+ static DataTemplate = {};
3548
+ /**
3549
+ * @param data - The raw data received from the API for the poll answer
3550
+ */
3551
+ constructor(data) {
3552
+ super(data);
3553
+ }
3554
+ /**
3555
+ * The id of the poll answer
3556
+ */
3557
+ get answerId() {
3558
+ return this[kData].answer_id;
3559
+ }
3560
+ };
3561
+
3562
+ // src/polls/PollAnswerCount.ts
3563
+ var PollAnswerCount = class extends Structure {
3564
+ static {
3565
+ __name(this, "PollAnswerCount");
3566
+ }
3567
+ /**
3568
+ * The template used for removing data from the raw data stored for each PollAnswerCount.
3569
+ */
3570
+ static DataTemplate = {};
3571
+ /**
3572
+ * @param data - The raw data received from the API for the poll answer count
3573
+ */
3574
+ constructor(data) {
3575
+ super(data);
3576
+ }
3577
+ /**
3578
+ * The id of the poll answer
3579
+ */
3580
+ get id() {
3581
+ return this[kData].id;
3582
+ }
3583
+ /**
3584
+ * The number of votes for this answer
3585
+ */
3586
+ get count() {
3587
+ return this[kData].count;
3588
+ }
3589
+ /**
3590
+ * Whether the current user voted for this answer
3591
+ */
3592
+ get meVoted() {
3593
+ return this[kData].me_voted;
3594
+ }
3595
+ };
3596
+
3597
+ // src/polls/PollMedia.ts
3598
+ var PollMedia = class extends Structure {
3599
+ static {
3600
+ __name(this, "PollMedia");
3601
+ }
3602
+ /**
3603
+ * The template used for removing data from the raw data stored for each PollMedia.
3604
+ */
3605
+ static DataTemplate = {};
3606
+ /**
3607
+ * @param data - The raw data received from the API for the poll media
3608
+ */
3609
+ constructor(data) {
3610
+ super(data);
3611
+ }
3612
+ /**
3613
+ * The text of the poll field
3614
+ */
3615
+ get text() {
3616
+ return this[kData].text;
3617
+ }
3618
+ };
3619
+
3620
+ // src/polls/PollResults.ts
3621
+ var PollResults = class extends Structure {
3622
+ static {
3623
+ __name(this, "PollResults");
3624
+ }
3625
+ /**
3626
+ * The template used for removing data from the raw data stored for each PollResults.
3627
+ */
3628
+ static DataTemplate = {};
3629
+ /**
3630
+ * @param data - The raw data received from the API for the poll results
3631
+ */
3632
+ constructor(data) {
3633
+ super(data);
3634
+ }
3635
+ /**
3636
+ * Whether the votes have been precisely counted
3637
+ */
3638
+ get isFinalized() {
3639
+ return this[kData].is_finalized;
3640
+ }
3641
+ };
3642
+
3643
+ // src/stickers/Sticker.ts
3644
+ var Sticker = class extends Structure {
3645
+ static {
3646
+ __name(this, "Sticker");
3647
+ }
3648
+ /**
3649
+ * The template used for removing data from the raw data stored for each SitckerItem.
3650
+ */
3651
+ static DataTemplate = {};
3652
+ /**
3653
+ * @param data - The raw data received from the API for the sticker item
3654
+ */
3655
+ constructor(data) {
3656
+ super(data);
3657
+ }
3658
+ /**
3659
+ * The id of the sticker
3660
+ */
3661
+ get id() {
3662
+ return this[kData].id;
3663
+ }
3664
+ /**
3665
+ * The name of the sticker
3666
+ */
3667
+ get name() {
3668
+ return this[kData].name;
3669
+ }
3670
+ /**
3671
+ * The format type of the sticker
3672
+ */
3673
+ get formatType() {
3674
+ return this[kData].format_type;
3675
+ }
3676
+ /**
3677
+ * Whether this guild sticker can be used, may be false due to loss of Server Boosts
3678
+ */
3679
+ get available() {
3680
+ return this[kData].available;
3681
+ }
3682
+ /**
3683
+ * The description of the sticker
3684
+ */
3685
+ get description() {
3686
+ return this[kData].description;
3687
+ }
3688
+ /**
3689
+ * The autocomplete/suggestion tags for the sticker
3690
+ */
3691
+ get tags() {
3692
+ return this[kData].tags;
3693
+ }
3694
+ /**
3695
+ * The type of this sticker
3696
+ */
3697
+ get type() {
3698
+ return this[kData].type;
3699
+ }
3700
+ };
3701
+
3702
+ // src/users/AvatarDecorationData.ts
3703
+ var AvatarDecorationData = class extends Structure {
3704
+ static {
3705
+ __name(this, "AvatarDecorationData");
3706
+ }
3707
+ /**
3708
+ * The template used for removing data from the raw data stored for each Connection
3709
+ */
3710
+ static DataTemplate = {};
3711
+ /**
3712
+ * @param data - The raw data received from the API for the connection
3713
+ */
3714
+ constructor(data) {
3715
+ super(data);
3716
+ }
3717
+ /**
3718
+ * The id of the SKU this avatar decoration is part of.
3719
+ */
3720
+ get skuId() {
3721
+ return this[kData].sku_id;
3722
+ }
3723
+ /**
3724
+ * The asset of this avatar decoration.
3725
+ */
3726
+ get asset() {
3727
+ return this[kData].asset;
3728
+ }
3729
+ };
3730
+
3731
+ // src/users/User.ts
3732
+ var import_snowflake3 = require("@sapphire/snowflake");
3733
+ var User = class extends Structure {
3734
+ static {
3735
+ __name(this, "User");
3736
+ }
3737
+ /**
3738
+ * The template used for removing data from the raw data stored for each User
3739
+ */
3740
+ static DataTemplate = {};
3741
+ /**
3742
+ * @param data - The raw data received from the API for the user
3743
+ */
3744
+ constructor(data) {
3745
+ super(data);
3746
+ }
3747
+ /**
3748
+ * The user's id
3749
+ */
3750
+ get id() {
3751
+ return this[kData].id;
3752
+ }
3753
+ /**
3754
+ * The username of the user
3755
+ */
3756
+ get username() {
3757
+ return this[kData].username;
3758
+ }
3759
+ /**
3760
+ * The user's 4 digit tag, if a bot
3761
+ */
3762
+ get discriminator() {
3763
+ return this[kData].discriminator;
3764
+ }
3765
+ /**
3766
+ * The user's display name, the application name for bots
3767
+ */
3768
+ get globalName() {
3769
+ return this[kData].global_name;
3770
+ }
3771
+ /**
3772
+ * The name displayed in the client for this user when no nickname is set
3773
+ */
3774
+ get displayName() {
3775
+ return this.globalName ?? this.username;
3776
+ }
3777
+ /**
3778
+ * The user avatar's hash
3779
+ */
3780
+ get avatar() {
3781
+ return this[kData].avatar;
3782
+ }
3783
+ /**
3784
+ * Whether the user is a bot
3785
+ */
3786
+ get bot() {
3787
+ return this[kData].bot ?? false;
3788
+ }
3789
+ /**
3790
+ * Whether the user is an Official Discord System user
3791
+ */
3792
+ get system() {
3793
+ return this[kData].system ?? false;
3794
+ }
3795
+ /**
3796
+ * Whether the user has mfa enabled
3797
+ *
3798
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
3799
+ */
3800
+ get mfaEnabled() {
3801
+ return this[kData].mfa_enabled;
3802
+ }
3803
+ /**
3804
+ * The user's banner hash
3805
+ *
3806
+ * @remarks This property is only set when the user was manually fetched
3807
+ */
3808
+ get banner() {
3809
+ return this[kData].banner;
3810
+ }
3811
+ /**
3812
+ * The base 10 accent color of the user's banner
3813
+ *
3814
+ * @remarks This property is only set when the user was manually fetched
3815
+ */
3816
+ get accentColor() {
3817
+ return this[kData].accent_color;
3818
+ }
3819
+ /**
3820
+ * The user's primary Discord language
3821
+ *
3822
+ * @remarks This property is only set when the user was fetched with an Oauth2 token and the `identify` scope
3823
+ */
3824
+ get locale() {
3825
+ return this[kData].locale;
3826
+ }
3827
+ /**
3828
+ * Whether the email on the user's account has been verified
3829
+ *
3830
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
3831
+ */
3832
+ get verified() {
3833
+ return this[kData].verified;
3834
+ }
3835
+ /**
3836
+ * The user's email
3837
+ *
3838
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
3839
+ */
3840
+ get email() {
3841
+ return this[kData].email;
3842
+ }
3843
+ /**
3844
+ * The type of nitro subscription on the user's account
3845
+ *
3846
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
3847
+ */
3848
+ get premiumType() {
3849
+ return this[kData].premium_type;
3850
+ }
3851
+ /**
3852
+ * The timestamp the user was created at
3853
+ */
3854
+ get createdTimestamp() {
3855
+ return isIdSet(this.id) ? import_snowflake3.DiscordSnowflake.timestampFrom(this.id) : null;
3856
+ }
3857
+ /**
3858
+ * The time the user was created at
3859
+ */
3860
+ get createdAt() {
3861
+ const createdTimestamp = this.createdTimestamp;
3862
+ return createdTimestamp ? new Date(createdTimestamp) : null;
3863
+ }
3864
+ /**
3865
+ * The hexadecimal version of the user accent color, with a leading hash
3866
+ *
3867
+ * @remarks This property is only set when the user was manually fetched
3868
+ */
3869
+ get hexAccentColor() {
3870
+ const accentColor = this.accentColor;
3871
+ if (typeof accentColor !== "number") return accentColor;
3872
+ return `#${accentColor.toString(16).padStart(6, "0")}`;
3873
+ }
3874
+ };
3875
+
3876
+ // src/users/Connection.ts
3877
+ var Connection = class extends Structure {
3878
+ static {
3879
+ __name(this, "Connection");
3880
+ }
3881
+ /**
3882
+ * The template used for removing data from the raw data stored for each Connection
3883
+ */
3884
+ static DataTemplate = {};
3885
+ /**
3886
+ * @param data - The raw data received from the API for the connection
3887
+ */
3888
+ constructor(data) {
3889
+ super(data);
3890
+ }
3891
+ /**
3892
+ * The id of the connection account
3893
+ */
3894
+ get id() {
3895
+ return this[kData].id;
3896
+ }
3897
+ /**
3898
+ * The username of the connection account
3899
+ */
3900
+ get name() {
3901
+ return this[kData].name;
3902
+ }
3903
+ /**
3904
+ * The type of service this connection is for
3905
+ */
3906
+ get type() {
3907
+ return this[kData].type;
3908
+ }
3909
+ /**
3910
+ * Whether the connection is revoked
3911
+ */
3912
+ get revoked() {
3913
+ return this[kData].revoked ?? false;
3914
+ }
3915
+ /**
3916
+ * Whether the connection is verified
3917
+ */
3918
+ get verified() {
3919
+ return this[kData].verified;
3920
+ }
3921
+ /**
3922
+ * Whether friend sync is enabled for this connection
3923
+ */
3924
+ get friendSync() {
3925
+ return this[kData].friend_sync;
3926
+ }
3927
+ /**
3928
+ * Whether activities related to this connection are shown in the users presence
3929
+ */
3930
+ get showActivity() {
3931
+ return this[kData].show_activity;
3932
+ }
3933
+ /**
3934
+ * Whether this connection has an Oauth2 token for console voice transfer
3935
+ */
3936
+ get twoWayLink() {
3937
+ return this[kData].two_way_link;
3938
+ }
3939
+ /**
3940
+ * The visibility state for this connection
3941
+ */
3942
+ get visibility() {
3943
+ return this[kData].visibility;
3944
+ }
3945
+ };
1905
3946
  // Annotate the CommonJS export names for ESM import in node:
1906
3947
  0 && (module.exports = {
3948
+ ActionRowComponent,
1907
3949
  AnnouncementChannel,
1908
3950
  AnnouncementThreadChannel,
3951
+ ApplicationCommandInteractionMetadata,
1909
3952
  AppliedTagsMixin,
3953
+ Attachment,
3954
+ AttachmentFlagsBitField,
1910
3955
  AvatarDecorationData,
1911
3956
  BitField,
3957
+ ButtonComponent,
1912
3958
  CategoryChannel,
1913
3959
  Channel,
1914
3960
  ChannelFlagsBitField,
3961
+ ChannelMention,
1915
3962
  ChannelOwnerMixin,
1916
3963
  ChannelParentMixin,
1917
3964
  ChannelPermissionMixin,
1918
3965
  ChannelPinMixin,
3966
+ ChannelSelectMenuComponent,
1919
3967
  ChannelSlowmodeMixin,
1920
3968
  ChannelTopicMixin,
1921
3969
  ChannelWebhookMixin,
3970
+ Component,
3971
+ ComponentEmoji,
1922
3972
  Connection,
3973
+ ContainerComponent,
1923
3974
  DMChannel,
1924
3975
  DMChannelMixin,
1925
3976
  DataTemplatePropertyName,
3977
+ Embed,
3978
+ EmbedAuthor,
3979
+ EmbedField,
3980
+ EmbedFooter,
3981
+ EmbedImage,
3982
+ EmbedProvider,
3983
+ EmbedThumbnail,
3984
+ EmbedVideo,
3985
+ FileComponent,
3986
+ FileUploadComponent,
1926
3987
  ForumChannel,
1927
3988
  ForumTag,
1928
3989
  GroupDMChannel,
1929
3990
  GroupDMMixin,
1930
3991
  GuildChannelMixin,
3992
+ InteractionMetadata,
3993
+ InteractiveButtonComponent,
1931
3994
  Invite,
3995
+ LabeledButtonComponent,
3996
+ LinkButtonComponent,
1932
3997
  MediaChannel,
3998
+ MediaGalleryComponent,
3999
+ MediaGalleryItem,
4000
+ MentionableSelectMenuComponent,
4001
+ Message,
4002
+ MessageActivity,
4003
+ MessageCall,
4004
+ MessageComponentInteractionMetadata,
4005
+ MessageFlagsBitField,
4006
+ MessageReference,
1933
4007
  Mixin,
4008
+ ModalSubmitInteractionMetadata,
1934
4009
  OptimizeDataPropertyName,
1935
4010
  PermissionOverwrite,
1936
4011
  PermissionsBitField,
4012
+ Poll,
4013
+ PollAnswer,
4014
+ PollAnswerCount,
4015
+ PollMedia,
4016
+ PollResults,
4017
+ PremiumButtonComponent,
1937
4018
  PrivateThreadChannel,
1938
4019
  PublicThreadChannel,
4020
+ Reaction,
4021
+ ReactionCountDetails,
4022
+ ResolvedInteractionData,
4023
+ RoleSelectMenuComponent,
4024
+ RoleSubscriptionData,
4025
+ SectionComponent,
4026
+ SelectMenuComponent,
4027
+ SelectMenuDefaultValue,
4028
+ SeparatorComponent,
1939
4029
  StageChannel,
4030
+ Sticker,
4031
+ StringSelectMenuComponent,
4032
+ StringSelectMenuOption,
1940
4033
  Structure,
1941
4034
  TextChannel,
1942
4035
  TextChannelMixin,
4036
+ TextDisplayComponent,
4037
+ TextInputComponent,
1943
4038
  ThreadChannelMixin,
1944
4039
  ThreadMetadata,
1945
4040
  ThreadOnlyChannelMixin,
4041
+ ThumbnailComponent,
4042
+ UnfurledMediaItem,
1946
4043
  User,
4044
+ UserSelectMenuComponent,
1947
4045
  VoiceChannel,
1948
4046
  VoiceChannelMixin,
4047
+ dateToDiscordISOTimestamp,
1949
4048
  extendTemplate
1950
4049
  });
1951
4050
  //# sourceMappingURL=index.js.map