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