@discordjs/structures 0.2.0-dev.1767398517-8ccae833e → 0.2.0-dev.1768608129-017176926
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 +145 -2
- package/dist/index.d.ts +145 -2
- package/dist/index.js +231 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_api_types_v10 from 'discord-api-types/v10';
|
|
2
|
-
import { AttachmentFlags, ChannelFlags, MessageFlags, PermissionFlagsBits, GuildChannelType, ChannelType, ThreadChannelType, GuildTextChannelType, TextChannelType, APIChannel, APIPartialChannel, APIGuildForumTag, APIOverwrite, APIThreadMetadata, APINewsChannel, APIAnnouncementThreadChannel, APIGuildCategoryChannel, APIDMChannel, APIGuildForumChannel, APIGroupDMChannel, APIGuildMediaChannel, APIPrivateThreadChannel, APIPublicThreadChannel, APIGuildStageVoiceChannel, APITextChannel, APIGuildVoiceChannel, APIInteractionDataResolved, APIInvite, APIExtendedInvite, APIMessageComponent, APIModalComponent, ComponentType, APIBaseComponent, APIComponentInActionRow, APIActionRowComponent, ButtonStyle, APIButtonComponentWithCustomId, APIButtonComponent, APISelectMenuComponent, APIChannelSelectComponent, APIContainerComponent, APIFileComponent, APIFileUploadComponent, APIButtonComponentWithURL, APIMediaGalleryComponent, APIMentionableSelectComponent, APIButtonComponentWithSKUId, APIRoleSelectComponent, APISectionComponent, APISeparatorComponent, APIStringSelectComponent, APITextDisplayComponent, APITextInputComponent, APIThumbnailComponent, APIUserSelectComponent, APIMessageComponentEmoji, APIMediaGalleryItem, SelectMenuDefaultValueType, APISelectMenuDefaultValue, APISelectMenuOption, APIUnfurledMediaItem, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, InteractionType, APIMessageInteractionMetadata, APIApplicationCommandInteractionMetadata, APIAttachment, APIChannelMention, APIMessage, APIMessageActivity, APIMessageCall, APIMessageComponentInteractionMetadata, APIMessageReference, MessageReferenceType, APIModalSubmitInteractionMetadata, APIReaction, APIReactionCountDetails, APIMessageRoleSubscriptionData, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, APISticker, APIAvatarDecorationData, APIUser, APIConnection } from 'discord-api-types/v10';
|
|
2
|
+
import { AttachmentFlags, ChannelFlags, MessageFlags, PermissionFlagsBits, GuildChannelType, ChannelType, ThreadChannelType, GuildTextChannelType, TextChannelType, APIChannel, APIPartialChannel, APIGuildForumTag, APIOverwrite, APIThreadMetadata, APINewsChannel, APIAnnouncementThreadChannel, APIGuildCategoryChannel, APIDMChannel, APIGuildForumChannel, APIGroupDMChannel, APIGuildMediaChannel, APIPrivateThreadChannel, APIPublicThreadChannel, APIGuildStageVoiceChannel, APITextChannel, APIGuildVoiceChannel, APIEmoji, APIEntitlement, APIInteractionDataResolved, APIInvite, APIExtendedInvite, APIMessageComponent, APIModalComponent, ComponentType, APIBaseComponent, APIComponentInActionRow, APIActionRowComponent, ButtonStyle, APIButtonComponentWithCustomId, APIButtonComponent, APISelectMenuComponent, APIChannelSelectComponent, APIContainerComponent, APIFileComponent, APIFileUploadComponent, APIButtonComponentWithURL, APIMediaGalleryComponent, APIMentionableSelectComponent, APIButtonComponentWithSKUId, APIRoleSelectComponent, APISectionComponent, APISeparatorComponent, APIStringSelectComponent, APITextDisplayComponent, APITextInputComponent, APIThumbnailComponent, APIUserSelectComponent, APIMessageComponentEmoji, APIMediaGalleryItem, SelectMenuDefaultValueType, APISelectMenuDefaultValue, APISelectMenuOption, APIUnfurledMediaItem, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, InteractionType, APIMessageInteractionMetadata, APIApplicationCommandInteractionMetadata, APIAttachment, APIChannelMention, APIMessage, APIMessageActivity, APIMessageCall, APIMessageComponentInteractionMetadata, APIMessageReference, MessageReferenceType, APIModalSubmitInteractionMetadata, APIReaction, APIReactionCountDetails, APIMessageRoleSubscriptionData, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, APISticker, APIAvatarDecorationData, APIUser, APIConnection } from 'discord-api-types/v10';
|
|
3
3
|
|
|
4
4
|
type ReplaceOmittedWithUnknown<Omitted extends keyof Data | '', Data> = {
|
|
5
5
|
[Key in keyof Data]: Key extends Omitted ? unknown : Data[Key];
|
|
@@ -276,6 +276,8 @@ declare const kEndedTimestamp: unique symbol;
|
|
|
276
276
|
declare const kCreatedTimestamp: unique symbol;
|
|
277
277
|
declare const kEditedTimestamp: unique symbol;
|
|
278
278
|
declare const kArchiveTimestamp: unique symbol;
|
|
279
|
+
declare const kStartsTimestamp: unique symbol;
|
|
280
|
+
declare const kEndsTimestamp: unique symbol;
|
|
279
281
|
declare const kAllow: unique symbol;
|
|
280
282
|
declare const kDeny: unique symbol;
|
|
281
283
|
declare const kBurstColors: unique symbol;
|
|
@@ -1104,6 +1106,147 @@ declare class VoiceChannel<Omitted extends keyof APIGuildVoiceChannel | '' = ''>
|
|
|
1104
1106
|
constructor(data: Partialize<APIGuildVoiceChannel, Omitted>);
|
|
1105
1107
|
}
|
|
1106
1108
|
|
|
1109
|
+
/**
|
|
1110
|
+
* Represents any emoji on Discord.
|
|
1111
|
+
*
|
|
1112
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1113
|
+
* @remarks has substructure `User` which needs to be instantiated and stored by an extending class using it
|
|
1114
|
+
* @remarks intentionally does not export `roles` so that extending classes can resolve `Snowflake[]` to `Role[]`
|
|
1115
|
+
*/
|
|
1116
|
+
declare class Emoji<Omitted extends keyof APIEmoji | '' = ''> extends Structure<APIEmoji, Omitted> {
|
|
1117
|
+
/**
|
|
1118
|
+
* The template used for removing data from the raw data stored for each emoji
|
|
1119
|
+
*/
|
|
1120
|
+
static readonly DataTemplate: Partial<APIEmoji>;
|
|
1121
|
+
/**
|
|
1122
|
+
* @param data - The raw data received from the API for the emoji
|
|
1123
|
+
*/
|
|
1124
|
+
constructor(data: Partialize<APIEmoji, Omitted>);
|
|
1125
|
+
/**
|
|
1126
|
+
* The emoji's id
|
|
1127
|
+
*/
|
|
1128
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIEmoji[T] : never : never;
|
|
1129
|
+
/**
|
|
1130
|
+
* The name of the emoji
|
|
1131
|
+
*
|
|
1132
|
+
* @remarks can be null only in reaction emoji objects
|
|
1133
|
+
*/
|
|
1134
|
+
get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIEmoji[T] : never : never;
|
|
1135
|
+
/**
|
|
1136
|
+
* Whether this emoji must be wrapped in colons
|
|
1137
|
+
*/
|
|
1138
|
+
get requireColons(): ("require_colons" extends infer T ? T extends "require_colons" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1139
|
+
/**
|
|
1140
|
+
* Whether the emoji is managed
|
|
1141
|
+
*/
|
|
1142
|
+
get managed(): ("managed" extends infer T ? T extends "managed" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1143
|
+
/**
|
|
1144
|
+
* Whether the emoji is animated
|
|
1145
|
+
*/
|
|
1146
|
+
get animated(): ("animated" extends infer T ? T extends "animated" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1147
|
+
/**
|
|
1148
|
+
* Whether the emoji can be used
|
|
1149
|
+
*
|
|
1150
|
+
* @remarks May be false due to loss of server boosts
|
|
1151
|
+
*/
|
|
1152
|
+
get available(): ("available" extends infer T ? T extends "available" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1153
|
+
/**
|
|
1154
|
+
* The timestamp the emoji was created at
|
|
1155
|
+
*/
|
|
1156
|
+
get createdTimestamp(): number | null;
|
|
1157
|
+
/**
|
|
1158
|
+
* The time the emoji was created at
|
|
1159
|
+
*/
|
|
1160
|
+
get createdAt(): Date | null;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* Represents any entitlement on Discord.
|
|
1165
|
+
*
|
|
1166
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1167
|
+
*/
|
|
1168
|
+
declare class Entitlement<Omitted extends keyof APIEntitlement | '' = 'ends_at' | 'starts_at'> extends Structure<APIEntitlement, Omitted> {
|
|
1169
|
+
/**
|
|
1170
|
+
* The template used for removing data from the raw data stored for each entitlement
|
|
1171
|
+
*
|
|
1172
|
+
* @remarks This template has defaults, if you want to remove additional data and keep the defaults,
|
|
1173
|
+
* use `Object.defineProperties`. To override the defaults, set this value directly.
|
|
1174
|
+
*/
|
|
1175
|
+
static readonly DataTemplate: Partial<APIEntitlement>;
|
|
1176
|
+
protected [kStartsTimestamp]: number | null;
|
|
1177
|
+
protected [kEndsTimestamp]: number | null;
|
|
1178
|
+
/**
|
|
1179
|
+
* @param data - The raw data received from the API for the entitlement
|
|
1180
|
+
*/
|
|
1181
|
+
constructor(data: Partialize<APIEntitlement, Omitted>);
|
|
1182
|
+
/**
|
|
1183
|
+
* {@inheritDoc Structure.optimizeData}
|
|
1184
|
+
*/
|
|
1185
|
+
protected optimizeData(data: Partial<APIEntitlement>): void;
|
|
1186
|
+
/**
|
|
1187
|
+
* The id of the entitlement
|
|
1188
|
+
*/
|
|
1189
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1190
|
+
/**
|
|
1191
|
+
* The id of the SKU
|
|
1192
|
+
*/
|
|
1193
|
+
get skuId(): "sku_id" extends infer T ? T extends "sku_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1194
|
+
/**
|
|
1195
|
+
* The id of the parent application
|
|
1196
|
+
*/
|
|
1197
|
+
get applicationId(): "application_id" extends infer T ? T extends "application_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1198
|
+
/**
|
|
1199
|
+
* The id of the user that is granted access to the entitlement's SKU
|
|
1200
|
+
*/
|
|
1201
|
+
get userId(): ("user_id" extends infer T ? T extends "user_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never) | undefined;
|
|
1202
|
+
/**
|
|
1203
|
+
* Type of entitlement
|
|
1204
|
+
*
|
|
1205
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types}
|
|
1206
|
+
*/
|
|
1207
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1208
|
+
/**
|
|
1209
|
+
* Whether the entitlement was deleted
|
|
1210
|
+
*/
|
|
1211
|
+
get deleted(): "deleted" extends infer T ? T extends "deleted" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1212
|
+
/**
|
|
1213
|
+
* Start date at which the entitlement is valid
|
|
1214
|
+
*/
|
|
1215
|
+
get startsAt(): Date | null;
|
|
1216
|
+
/**
|
|
1217
|
+
* Timestamp of the start date at which the entitlement is valid
|
|
1218
|
+
*/
|
|
1219
|
+
get startsTimestamp(): number | null;
|
|
1220
|
+
/**
|
|
1221
|
+
* End date at which the entitlement is valid
|
|
1222
|
+
*/
|
|
1223
|
+
get endsAt(): Date | null;
|
|
1224
|
+
/**
|
|
1225
|
+
* Timestamp of the end date at which the entitlement is valid
|
|
1226
|
+
*/
|
|
1227
|
+
get endsTimestamp(): number | null;
|
|
1228
|
+
/**
|
|
1229
|
+
* Id of the guild that is granted access to the entitlement's SKU
|
|
1230
|
+
*/
|
|
1231
|
+
get guildId(): ("guild_id" extends infer T ? T extends "guild_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never) | undefined;
|
|
1232
|
+
/**
|
|
1233
|
+
* For consumable items, whether the entitlement has been consumed
|
|
1234
|
+
*/
|
|
1235
|
+
get consumed(): ("consumed" extends infer T ? T extends "consumed" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never) | undefined;
|
|
1236
|
+
/**
|
|
1237
|
+
* The timestamp the entitlement was created at
|
|
1238
|
+
*/
|
|
1239
|
+
get createdTimestamp(): number | null;
|
|
1240
|
+
/**
|
|
1241
|
+
* The time the entitlement was created at
|
|
1242
|
+
*/
|
|
1243
|
+
get createdAt(): Date | null;
|
|
1244
|
+
/**
|
|
1245
|
+
* {@inheritDoc Structure.toJSON}
|
|
1246
|
+
*/
|
|
1247
|
+
toJSON(): APIEntitlement;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1107
1250
|
/**
|
|
1108
1251
|
* Represents data for users, members, channels, and roles in the message's auto-populated select menus.
|
|
1109
1252
|
*
|
|
@@ -2944,4 +3087,4 @@ declare function extendTemplate<SuperTemplate extends Record<string, unknown>>(s
|
|
|
2944
3087
|
*/
|
|
2945
3088
|
declare function dateToDiscordISOTimestamp(date: Date): string;
|
|
2946
3089
|
|
|
2947
|
-
export { type APIActualInvite, ActionRowComponent, AnnouncementChannel, AnnouncementThreadChannel, ApplicationCommandInteractionMetadata, AppliedTagsMixin, Attachment, AttachmentFlagsBitField, AvatarDecorationData, BitField, type BitFieldResolvable, ButtonComponent, type ButtonDataType, CategoryChannel, Channel, type ChannelDataType, ChannelFlagsBitField, ChannelMention, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelPinMixin, ChannelSelectMenuComponent, ChannelSlowmodeMixin, ChannelTopicMixin, ChannelWebhookMixin, type CollapseUnion, Component, type ComponentDataType, ComponentEmoji, Connection, ContainerComponent, DMChannel, DMChannelMixin, DataTemplatePropertyName, Embed, EmbedAuthor, EmbedField, EmbedFooter, EmbedImage, EmbedProvider, EmbedThumbnail, EmbedVideo, type EnumLike, FileComponent, FileUploadComponent, ForumChannel, ForumTag, GroupDMChannel, GroupDMMixin, GuildChannelMixin, type If, InteractionMetadata, type InteractionMetadataType, InteractiveButtonComponent, Invite, LabeledButtonComponent, LinkButtonComponent, MediaChannel, MediaGalleryComponent, MediaGalleryItem, MentionableSelectMenuComponent, type MergePrototype, type MergePrototypes, Message, MessageActivity, MessageCall, MessageComponentInteractionMetadata, MessageFlagsBitField, MessageReference, Mixin, type MixinBase, type MixinTypes, type Mixinable, ModalSubmitInteractionMetadata, type NonAbstract, OptimizeDataPropertyName, type OptionalPropertyNames, type PartialChannel, type Partialize, PermissionOverwrite, PermissionsBitField, Poll, PollAnswer, PollAnswerCount, PollMedia, PollResults, PremiumButtonComponent, PrivateThreadChannel, PublicThreadChannel, Reaction, ReactionCountDetails, type RecursiveReadonlyArray, type ReplaceOmittedWithUnknown, ResolvedInteractionData, RoleSelectMenuComponent, RoleSubscriptionData, SectionComponent, SelectMenuComponent, SelectMenuDefaultValue, SeparatorComponent, StageChannel, Sticker, StringSelectMenuComponent, StringSelectMenuOption, Structure, TextChannel, TextChannelMixin, TextDisplayComponent, TextInputComponent, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, ThumbnailComponent, UnfurledMediaItem, User, UserSelectMenuComponent, VoiceChannel, VoiceChannelMixin, dateToDiscordISOTimestamp, extendTemplate };
|
|
3090
|
+
export { type APIActualInvite, ActionRowComponent, AnnouncementChannel, AnnouncementThreadChannel, ApplicationCommandInteractionMetadata, AppliedTagsMixin, Attachment, AttachmentFlagsBitField, AvatarDecorationData, BitField, type BitFieldResolvable, ButtonComponent, type ButtonDataType, CategoryChannel, Channel, type ChannelDataType, ChannelFlagsBitField, ChannelMention, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelPinMixin, ChannelSelectMenuComponent, ChannelSlowmodeMixin, ChannelTopicMixin, ChannelWebhookMixin, type CollapseUnion, Component, type ComponentDataType, ComponentEmoji, Connection, ContainerComponent, DMChannel, DMChannelMixin, DataTemplatePropertyName, Embed, EmbedAuthor, EmbedField, EmbedFooter, EmbedImage, EmbedProvider, EmbedThumbnail, EmbedVideo, Emoji, Entitlement, type EnumLike, FileComponent, FileUploadComponent, ForumChannel, ForumTag, GroupDMChannel, GroupDMMixin, GuildChannelMixin, type If, InteractionMetadata, type InteractionMetadataType, InteractiveButtonComponent, Invite, LabeledButtonComponent, LinkButtonComponent, MediaChannel, MediaGalleryComponent, MediaGalleryItem, MentionableSelectMenuComponent, type MergePrototype, type MergePrototypes, Message, MessageActivity, MessageCall, MessageComponentInteractionMetadata, MessageFlagsBitField, MessageReference, Mixin, type MixinBase, type MixinTypes, type Mixinable, ModalSubmitInteractionMetadata, type NonAbstract, OptimizeDataPropertyName, type OptionalPropertyNames, type PartialChannel, type Partialize, PermissionOverwrite, PermissionsBitField, Poll, PollAnswer, PollAnswerCount, PollMedia, PollResults, PremiumButtonComponent, PrivateThreadChannel, PublicThreadChannel, Reaction, ReactionCountDetails, type RecursiveReadonlyArray, type ReplaceOmittedWithUnknown, ResolvedInteractionData, RoleSelectMenuComponent, RoleSubscriptionData, SectionComponent, SelectMenuComponent, SelectMenuDefaultValue, SeparatorComponent, StageChannel, Sticker, StringSelectMenuComponent, StringSelectMenuOption, Structure, TextChannel, TextChannelMixin, TextDisplayComponent, TextInputComponent, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, ThumbnailComponent, UnfurledMediaItem, User, UserSelectMenuComponent, VoiceChannel, VoiceChannelMixin, dateToDiscordISOTimestamp, extendTemplate };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_api_types_v10 from 'discord-api-types/v10';
|
|
2
|
-
import { AttachmentFlags, ChannelFlags, MessageFlags, PermissionFlagsBits, GuildChannelType, ChannelType, ThreadChannelType, GuildTextChannelType, TextChannelType, APIChannel, APIPartialChannel, APIGuildForumTag, APIOverwrite, APIThreadMetadata, APINewsChannel, APIAnnouncementThreadChannel, APIGuildCategoryChannel, APIDMChannel, APIGuildForumChannel, APIGroupDMChannel, APIGuildMediaChannel, APIPrivateThreadChannel, APIPublicThreadChannel, APIGuildStageVoiceChannel, APITextChannel, APIGuildVoiceChannel, APIInteractionDataResolved, APIInvite, APIExtendedInvite, APIMessageComponent, APIModalComponent, ComponentType, APIBaseComponent, APIComponentInActionRow, APIActionRowComponent, ButtonStyle, APIButtonComponentWithCustomId, APIButtonComponent, APISelectMenuComponent, APIChannelSelectComponent, APIContainerComponent, APIFileComponent, APIFileUploadComponent, APIButtonComponentWithURL, APIMediaGalleryComponent, APIMentionableSelectComponent, APIButtonComponentWithSKUId, APIRoleSelectComponent, APISectionComponent, APISeparatorComponent, APIStringSelectComponent, APITextDisplayComponent, APITextInputComponent, APIThumbnailComponent, APIUserSelectComponent, APIMessageComponentEmoji, APIMediaGalleryItem, SelectMenuDefaultValueType, APISelectMenuDefaultValue, APISelectMenuOption, APIUnfurledMediaItem, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, InteractionType, APIMessageInteractionMetadata, APIApplicationCommandInteractionMetadata, APIAttachment, APIChannelMention, APIMessage, APIMessageActivity, APIMessageCall, APIMessageComponentInteractionMetadata, APIMessageReference, MessageReferenceType, APIModalSubmitInteractionMetadata, APIReaction, APIReactionCountDetails, APIMessageRoleSubscriptionData, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, APISticker, APIAvatarDecorationData, APIUser, APIConnection } from 'discord-api-types/v10';
|
|
2
|
+
import { AttachmentFlags, ChannelFlags, MessageFlags, PermissionFlagsBits, GuildChannelType, ChannelType, ThreadChannelType, GuildTextChannelType, TextChannelType, APIChannel, APIPartialChannel, APIGuildForumTag, APIOverwrite, APIThreadMetadata, APINewsChannel, APIAnnouncementThreadChannel, APIGuildCategoryChannel, APIDMChannel, APIGuildForumChannel, APIGroupDMChannel, APIGuildMediaChannel, APIPrivateThreadChannel, APIPublicThreadChannel, APIGuildStageVoiceChannel, APITextChannel, APIGuildVoiceChannel, APIEmoji, APIEntitlement, APIInteractionDataResolved, APIInvite, APIExtendedInvite, APIMessageComponent, APIModalComponent, ComponentType, APIBaseComponent, APIComponentInActionRow, APIActionRowComponent, ButtonStyle, APIButtonComponentWithCustomId, APIButtonComponent, APISelectMenuComponent, APIChannelSelectComponent, APIContainerComponent, APIFileComponent, APIFileUploadComponent, APIButtonComponentWithURL, APIMediaGalleryComponent, APIMentionableSelectComponent, APIButtonComponentWithSKUId, APIRoleSelectComponent, APISectionComponent, APISeparatorComponent, APIStringSelectComponent, APITextDisplayComponent, APITextInputComponent, APIThumbnailComponent, APIUserSelectComponent, APIMessageComponentEmoji, APIMediaGalleryItem, SelectMenuDefaultValueType, APISelectMenuDefaultValue, APISelectMenuOption, APIUnfurledMediaItem, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, InteractionType, APIMessageInteractionMetadata, APIApplicationCommandInteractionMetadata, APIAttachment, APIChannelMention, APIMessage, APIMessageActivity, APIMessageCall, APIMessageComponentInteractionMetadata, APIMessageReference, MessageReferenceType, APIModalSubmitInteractionMetadata, APIReaction, APIReactionCountDetails, APIMessageRoleSubscriptionData, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, APISticker, APIAvatarDecorationData, APIUser, APIConnection } from 'discord-api-types/v10';
|
|
3
3
|
|
|
4
4
|
type ReplaceOmittedWithUnknown<Omitted extends keyof Data | '', Data> = {
|
|
5
5
|
[Key in keyof Data]: Key extends Omitted ? unknown : Data[Key];
|
|
@@ -276,6 +276,8 @@ declare const kEndedTimestamp: unique symbol;
|
|
|
276
276
|
declare const kCreatedTimestamp: unique symbol;
|
|
277
277
|
declare const kEditedTimestamp: unique symbol;
|
|
278
278
|
declare const kArchiveTimestamp: unique symbol;
|
|
279
|
+
declare const kStartsTimestamp: unique symbol;
|
|
280
|
+
declare const kEndsTimestamp: unique symbol;
|
|
279
281
|
declare const kAllow: unique symbol;
|
|
280
282
|
declare const kDeny: unique symbol;
|
|
281
283
|
declare const kBurstColors: unique symbol;
|
|
@@ -1104,6 +1106,147 @@ declare class VoiceChannel<Omitted extends keyof APIGuildVoiceChannel | '' = ''>
|
|
|
1104
1106
|
constructor(data: Partialize<APIGuildVoiceChannel, Omitted>);
|
|
1105
1107
|
}
|
|
1106
1108
|
|
|
1109
|
+
/**
|
|
1110
|
+
* Represents any emoji on Discord.
|
|
1111
|
+
*
|
|
1112
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1113
|
+
* @remarks has substructure `User` which needs to be instantiated and stored by an extending class using it
|
|
1114
|
+
* @remarks intentionally does not export `roles` so that extending classes can resolve `Snowflake[]` to `Role[]`
|
|
1115
|
+
*/
|
|
1116
|
+
declare class Emoji<Omitted extends keyof APIEmoji | '' = ''> extends Structure<APIEmoji, Omitted> {
|
|
1117
|
+
/**
|
|
1118
|
+
* The template used for removing data from the raw data stored for each emoji
|
|
1119
|
+
*/
|
|
1120
|
+
static readonly DataTemplate: Partial<APIEmoji>;
|
|
1121
|
+
/**
|
|
1122
|
+
* @param data - The raw data received from the API for the emoji
|
|
1123
|
+
*/
|
|
1124
|
+
constructor(data: Partialize<APIEmoji, Omitted>);
|
|
1125
|
+
/**
|
|
1126
|
+
* The emoji's id
|
|
1127
|
+
*/
|
|
1128
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIEmoji[T] : never : never;
|
|
1129
|
+
/**
|
|
1130
|
+
* The name of the emoji
|
|
1131
|
+
*
|
|
1132
|
+
* @remarks can be null only in reaction emoji objects
|
|
1133
|
+
*/
|
|
1134
|
+
get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIEmoji[T] : never : never;
|
|
1135
|
+
/**
|
|
1136
|
+
* Whether this emoji must be wrapped in colons
|
|
1137
|
+
*/
|
|
1138
|
+
get requireColons(): ("require_colons" extends infer T ? T extends "require_colons" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1139
|
+
/**
|
|
1140
|
+
* Whether the emoji is managed
|
|
1141
|
+
*/
|
|
1142
|
+
get managed(): ("managed" extends infer T ? T extends "managed" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1143
|
+
/**
|
|
1144
|
+
* Whether the emoji is animated
|
|
1145
|
+
*/
|
|
1146
|
+
get animated(): ("animated" extends infer T ? T extends "animated" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1147
|
+
/**
|
|
1148
|
+
* Whether the emoji can be used
|
|
1149
|
+
*
|
|
1150
|
+
* @remarks May be false due to loss of server boosts
|
|
1151
|
+
*/
|
|
1152
|
+
get available(): ("available" extends infer T ? T extends "available" ? T extends Omitted ? unknown : APIEmoji[T] : never : never) | undefined;
|
|
1153
|
+
/**
|
|
1154
|
+
* The timestamp the emoji was created at
|
|
1155
|
+
*/
|
|
1156
|
+
get createdTimestamp(): number | null;
|
|
1157
|
+
/**
|
|
1158
|
+
* The time the emoji was created at
|
|
1159
|
+
*/
|
|
1160
|
+
get createdAt(): Date | null;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* Represents any entitlement on Discord.
|
|
1165
|
+
*
|
|
1166
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
1167
|
+
*/
|
|
1168
|
+
declare class Entitlement<Omitted extends keyof APIEntitlement | '' = 'ends_at' | 'starts_at'> extends Structure<APIEntitlement, Omitted> {
|
|
1169
|
+
/**
|
|
1170
|
+
* The template used for removing data from the raw data stored for each entitlement
|
|
1171
|
+
*
|
|
1172
|
+
* @remarks This template has defaults, if you want to remove additional data and keep the defaults,
|
|
1173
|
+
* use `Object.defineProperties`. To override the defaults, set this value directly.
|
|
1174
|
+
*/
|
|
1175
|
+
static readonly DataTemplate: Partial<APIEntitlement>;
|
|
1176
|
+
protected [kStartsTimestamp]: number | null;
|
|
1177
|
+
protected [kEndsTimestamp]: number | null;
|
|
1178
|
+
/**
|
|
1179
|
+
* @param data - The raw data received from the API for the entitlement
|
|
1180
|
+
*/
|
|
1181
|
+
constructor(data: Partialize<APIEntitlement, Omitted>);
|
|
1182
|
+
/**
|
|
1183
|
+
* {@inheritDoc Structure.optimizeData}
|
|
1184
|
+
*/
|
|
1185
|
+
protected optimizeData(data: Partial<APIEntitlement>): void;
|
|
1186
|
+
/**
|
|
1187
|
+
* The id of the entitlement
|
|
1188
|
+
*/
|
|
1189
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1190
|
+
/**
|
|
1191
|
+
* The id of the SKU
|
|
1192
|
+
*/
|
|
1193
|
+
get skuId(): "sku_id" extends infer T ? T extends "sku_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1194
|
+
/**
|
|
1195
|
+
* The id of the parent application
|
|
1196
|
+
*/
|
|
1197
|
+
get applicationId(): "application_id" extends infer T ? T extends "application_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1198
|
+
/**
|
|
1199
|
+
* The id of the user that is granted access to the entitlement's SKU
|
|
1200
|
+
*/
|
|
1201
|
+
get userId(): ("user_id" extends infer T ? T extends "user_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never) | undefined;
|
|
1202
|
+
/**
|
|
1203
|
+
* Type of entitlement
|
|
1204
|
+
*
|
|
1205
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types}
|
|
1206
|
+
*/
|
|
1207
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1208
|
+
/**
|
|
1209
|
+
* Whether the entitlement was deleted
|
|
1210
|
+
*/
|
|
1211
|
+
get deleted(): "deleted" extends infer T ? T extends "deleted" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never;
|
|
1212
|
+
/**
|
|
1213
|
+
* Start date at which the entitlement is valid
|
|
1214
|
+
*/
|
|
1215
|
+
get startsAt(): Date | null;
|
|
1216
|
+
/**
|
|
1217
|
+
* Timestamp of the start date at which the entitlement is valid
|
|
1218
|
+
*/
|
|
1219
|
+
get startsTimestamp(): number | null;
|
|
1220
|
+
/**
|
|
1221
|
+
* End date at which the entitlement is valid
|
|
1222
|
+
*/
|
|
1223
|
+
get endsAt(): Date | null;
|
|
1224
|
+
/**
|
|
1225
|
+
* Timestamp of the end date at which the entitlement is valid
|
|
1226
|
+
*/
|
|
1227
|
+
get endsTimestamp(): number | null;
|
|
1228
|
+
/**
|
|
1229
|
+
* Id of the guild that is granted access to the entitlement's SKU
|
|
1230
|
+
*/
|
|
1231
|
+
get guildId(): ("guild_id" extends infer T ? T extends "guild_id" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never) | undefined;
|
|
1232
|
+
/**
|
|
1233
|
+
* For consumable items, whether the entitlement has been consumed
|
|
1234
|
+
*/
|
|
1235
|
+
get consumed(): ("consumed" extends infer T ? T extends "consumed" ? T extends Omitted ? unknown : APIEntitlement[T] : never : never) | undefined;
|
|
1236
|
+
/**
|
|
1237
|
+
* The timestamp the entitlement was created at
|
|
1238
|
+
*/
|
|
1239
|
+
get createdTimestamp(): number | null;
|
|
1240
|
+
/**
|
|
1241
|
+
* The time the entitlement was created at
|
|
1242
|
+
*/
|
|
1243
|
+
get createdAt(): Date | null;
|
|
1244
|
+
/**
|
|
1245
|
+
* {@inheritDoc Structure.toJSON}
|
|
1246
|
+
*/
|
|
1247
|
+
toJSON(): APIEntitlement;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1107
1250
|
/**
|
|
1108
1251
|
* Represents data for users, members, channels, and roles in the message's auto-populated select menus.
|
|
1109
1252
|
*
|
|
@@ -2944,4 +3087,4 @@ declare function extendTemplate<SuperTemplate extends Record<string, unknown>>(s
|
|
|
2944
3087
|
*/
|
|
2945
3088
|
declare function dateToDiscordISOTimestamp(date: Date): string;
|
|
2946
3089
|
|
|
2947
|
-
export { type APIActualInvite, ActionRowComponent, AnnouncementChannel, AnnouncementThreadChannel, ApplicationCommandInteractionMetadata, AppliedTagsMixin, Attachment, AttachmentFlagsBitField, AvatarDecorationData, BitField, type BitFieldResolvable, ButtonComponent, type ButtonDataType, CategoryChannel, Channel, type ChannelDataType, ChannelFlagsBitField, ChannelMention, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelPinMixin, ChannelSelectMenuComponent, ChannelSlowmodeMixin, ChannelTopicMixin, ChannelWebhookMixin, type CollapseUnion, Component, type ComponentDataType, ComponentEmoji, Connection, ContainerComponent, DMChannel, DMChannelMixin, DataTemplatePropertyName, Embed, EmbedAuthor, EmbedField, EmbedFooter, EmbedImage, EmbedProvider, EmbedThumbnail, EmbedVideo, type EnumLike, FileComponent, FileUploadComponent, ForumChannel, ForumTag, GroupDMChannel, GroupDMMixin, GuildChannelMixin, type If, InteractionMetadata, type InteractionMetadataType, InteractiveButtonComponent, Invite, LabeledButtonComponent, LinkButtonComponent, MediaChannel, MediaGalleryComponent, MediaGalleryItem, MentionableSelectMenuComponent, type MergePrototype, type MergePrototypes, Message, MessageActivity, MessageCall, MessageComponentInteractionMetadata, MessageFlagsBitField, MessageReference, Mixin, type MixinBase, type MixinTypes, type Mixinable, ModalSubmitInteractionMetadata, type NonAbstract, OptimizeDataPropertyName, type OptionalPropertyNames, type PartialChannel, type Partialize, PermissionOverwrite, PermissionsBitField, Poll, PollAnswer, PollAnswerCount, PollMedia, PollResults, PremiumButtonComponent, PrivateThreadChannel, PublicThreadChannel, Reaction, ReactionCountDetails, type RecursiveReadonlyArray, type ReplaceOmittedWithUnknown, ResolvedInteractionData, RoleSelectMenuComponent, RoleSubscriptionData, SectionComponent, SelectMenuComponent, SelectMenuDefaultValue, SeparatorComponent, StageChannel, Sticker, StringSelectMenuComponent, StringSelectMenuOption, Structure, TextChannel, TextChannelMixin, TextDisplayComponent, TextInputComponent, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, ThumbnailComponent, UnfurledMediaItem, User, UserSelectMenuComponent, VoiceChannel, VoiceChannelMixin, dateToDiscordISOTimestamp, extendTemplate };
|
|
3090
|
+
export { type APIActualInvite, ActionRowComponent, AnnouncementChannel, AnnouncementThreadChannel, ApplicationCommandInteractionMetadata, AppliedTagsMixin, Attachment, AttachmentFlagsBitField, AvatarDecorationData, BitField, type BitFieldResolvable, ButtonComponent, type ButtonDataType, CategoryChannel, Channel, type ChannelDataType, ChannelFlagsBitField, ChannelMention, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelPinMixin, ChannelSelectMenuComponent, ChannelSlowmodeMixin, ChannelTopicMixin, ChannelWebhookMixin, type CollapseUnion, Component, type ComponentDataType, ComponentEmoji, Connection, ContainerComponent, DMChannel, DMChannelMixin, DataTemplatePropertyName, Embed, EmbedAuthor, EmbedField, EmbedFooter, EmbedImage, EmbedProvider, EmbedThumbnail, EmbedVideo, Emoji, Entitlement, type EnumLike, FileComponent, FileUploadComponent, ForumChannel, ForumTag, GroupDMChannel, GroupDMMixin, GuildChannelMixin, type If, InteractionMetadata, type InteractionMetadataType, InteractiveButtonComponent, Invite, LabeledButtonComponent, LinkButtonComponent, MediaChannel, MediaGalleryComponent, MediaGalleryItem, MentionableSelectMenuComponent, type MergePrototype, type MergePrototypes, Message, MessageActivity, MessageCall, MessageComponentInteractionMetadata, MessageFlagsBitField, MessageReference, Mixin, type MixinBase, type MixinTypes, type Mixinable, ModalSubmitInteractionMetadata, type NonAbstract, OptimizeDataPropertyName, type OptionalPropertyNames, type PartialChannel, type Partialize, PermissionOverwrite, PermissionsBitField, Poll, PollAnswer, PollAnswerCount, PollMedia, PollResults, PremiumButtonComponent, PrivateThreadChannel, PublicThreadChannel, Reaction, ReactionCountDetails, type RecursiveReadonlyArray, type ReplaceOmittedWithUnknown, ResolvedInteractionData, RoleSelectMenuComponent, RoleSubscriptionData, SectionComponent, SelectMenuComponent, SelectMenuDefaultValue, SeparatorComponent, StageChannel, Sticker, StringSelectMenuComponent, StringSelectMenuOption, Structure, TextChannel, TextChannelMixin, TextDisplayComponent, TextInputComponent, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, ThumbnailComponent, UnfurledMediaItem, User, UserSelectMenuComponent, VoiceChannel, VoiceChannelMixin, dateToDiscordISOTimestamp, extendTemplate };
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,8 @@ __export(index_exports, {
|
|
|
58
58
|
EmbedProvider: () => EmbedProvider,
|
|
59
59
|
EmbedThumbnail: () => EmbedThumbnail,
|
|
60
60
|
EmbedVideo: () => EmbedVideo,
|
|
61
|
+
Emoji: () => Emoji,
|
|
62
|
+
Entitlement: () => Entitlement,
|
|
61
63
|
FileComponent: () => FileComponent,
|
|
62
64
|
FileUploadComponent: () => FileUploadComponent,
|
|
63
65
|
ForumChannel: () => ForumChannel,
|
|
@@ -404,6 +406,8 @@ var kEndedTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.endedTimestamp"
|
|
|
404
406
|
var kCreatedTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.createdTimestamp");
|
|
405
407
|
var kEditedTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.editedTimestamp");
|
|
406
408
|
var kArchiveTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.archiveTimestamp");
|
|
409
|
+
var kStartsTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.startsTimestamp");
|
|
410
|
+
var kEndsTimestamp = /* @__PURE__ */ Symbol.for("djs.structures.endsTimestamp");
|
|
407
411
|
var kAllow = /* @__PURE__ */ Symbol.for("djs.structures.allow");
|
|
408
412
|
var kDeny = /* @__PURE__ */ Symbol.for("djs.structures.deny");
|
|
409
413
|
var kBurstColors = /* @__PURE__ */ Symbol.for("djs.structures.burstColors");
|
|
@@ -1532,21 +1536,79 @@ Mixin(VoiceChannel, [
|
|
|
1532
1536
|
VoiceChannelMixin
|
|
1533
1537
|
]);
|
|
1534
1538
|
|
|
1535
|
-
// src/
|
|
1536
|
-
var
|
|
1539
|
+
// src/emojis/Emoji.ts
|
|
1540
|
+
var import_snowflake2 = require("@sapphire/snowflake");
|
|
1541
|
+
var Emoji = class extends Structure {
|
|
1537
1542
|
static {
|
|
1538
|
-
__name(this, "
|
|
1543
|
+
__name(this, "Emoji");
|
|
1539
1544
|
}
|
|
1540
1545
|
/**
|
|
1541
|
-
*
|
|
1546
|
+
* The template used for removing data from the raw data stored for each emoji
|
|
1547
|
+
*/
|
|
1548
|
+
static DataTemplate = {};
|
|
1549
|
+
/**
|
|
1550
|
+
* @param data - The raw data received from the API for the emoji
|
|
1542
1551
|
*/
|
|
1543
1552
|
constructor(data) {
|
|
1544
1553
|
super(data);
|
|
1545
1554
|
}
|
|
1555
|
+
/**
|
|
1556
|
+
* The emoji's id
|
|
1557
|
+
*/
|
|
1558
|
+
get id() {
|
|
1559
|
+
return this[kData].id;
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* The name of the emoji
|
|
1563
|
+
*
|
|
1564
|
+
* @remarks can be null only in reaction emoji objects
|
|
1565
|
+
*/
|
|
1566
|
+
get name() {
|
|
1567
|
+
return this[kData].name;
|
|
1568
|
+
}
|
|
1569
|
+
/**
|
|
1570
|
+
* Whether this emoji must be wrapped in colons
|
|
1571
|
+
*/
|
|
1572
|
+
get requireColons() {
|
|
1573
|
+
return this[kData].require_colons;
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Whether the emoji is managed
|
|
1577
|
+
*/
|
|
1578
|
+
get managed() {
|
|
1579
|
+
return this[kData].managed;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Whether the emoji is animated
|
|
1583
|
+
*/
|
|
1584
|
+
get animated() {
|
|
1585
|
+
return this[kData].animated;
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
* Whether the emoji can be used
|
|
1589
|
+
*
|
|
1590
|
+
* @remarks May be false due to loss of server boosts
|
|
1591
|
+
*/
|
|
1592
|
+
get available() {
|
|
1593
|
+
return this[kData].available;
|
|
1594
|
+
}
|
|
1595
|
+
/**
|
|
1596
|
+
* The timestamp the emoji was created at
|
|
1597
|
+
*/
|
|
1598
|
+
get createdTimestamp() {
|
|
1599
|
+
return isIdSet(this.id) ? import_snowflake2.DiscordSnowflake.timestampFrom(this.id) : null;
|
|
1600
|
+
}
|
|
1601
|
+
/**
|
|
1602
|
+
* The time the emoji was created at
|
|
1603
|
+
*/
|
|
1604
|
+
get createdAt() {
|
|
1605
|
+
const createdTimestamp = this.createdTimestamp;
|
|
1606
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
1607
|
+
}
|
|
1546
1608
|
};
|
|
1547
1609
|
|
|
1548
|
-
// src/
|
|
1549
|
-
var
|
|
1610
|
+
// src/entitlements/Entitlement.ts
|
|
1611
|
+
var import_snowflake3 = require("@sapphire/snowflake");
|
|
1550
1612
|
|
|
1551
1613
|
// src/utils/optimization.ts
|
|
1552
1614
|
function extendTemplate(superTemplate, additions) {
|
|
@@ -1558,7 +1620,164 @@ function dateToDiscordISOTimestamp(date) {
|
|
|
1558
1620
|
}
|
|
1559
1621
|
__name(dateToDiscordISOTimestamp, "dateToDiscordISOTimestamp");
|
|
1560
1622
|
|
|
1623
|
+
// src/entitlements/Entitlement.ts
|
|
1624
|
+
var Entitlement = class extends Structure {
|
|
1625
|
+
static {
|
|
1626
|
+
__name(this, "Entitlement");
|
|
1627
|
+
}
|
|
1628
|
+
/**
|
|
1629
|
+
* The template used for removing data from the raw data stored for each entitlement
|
|
1630
|
+
*
|
|
1631
|
+
* @remarks This template has defaults, if you want to remove additional data and keep the defaults,
|
|
1632
|
+
* use `Object.defineProperties`. To override the defaults, set this value directly.
|
|
1633
|
+
*/
|
|
1634
|
+
static DataTemplate = {
|
|
1635
|
+
set starts_at(_) {
|
|
1636
|
+
},
|
|
1637
|
+
set ends_at(_) {
|
|
1638
|
+
}
|
|
1639
|
+
};
|
|
1640
|
+
[kStartsTimestamp] = null;
|
|
1641
|
+
[kEndsTimestamp] = null;
|
|
1642
|
+
/**
|
|
1643
|
+
* @param data - The raw data received from the API for the entitlement
|
|
1644
|
+
*/
|
|
1645
|
+
constructor(data) {
|
|
1646
|
+
super(data);
|
|
1647
|
+
this.optimizeData(data);
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* {@inheritDoc Structure.optimizeData}
|
|
1651
|
+
*/
|
|
1652
|
+
optimizeData(data) {
|
|
1653
|
+
if (data.starts_at) {
|
|
1654
|
+
this[kStartsTimestamp] = Date.parse(data.starts_at);
|
|
1655
|
+
}
|
|
1656
|
+
if (data.ends_at) {
|
|
1657
|
+
this[kEndsTimestamp] = Date.parse(data.ends_at);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
/**
|
|
1661
|
+
* The id of the entitlement
|
|
1662
|
+
*/
|
|
1663
|
+
get id() {
|
|
1664
|
+
return this[kData].id;
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* The id of the SKU
|
|
1668
|
+
*/
|
|
1669
|
+
get skuId() {
|
|
1670
|
+
return this[kData].sku_id;
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* The id of the parent application
|
|
1674
|
+
*/
|
|
1675
|
+
get applicationId() {
|
|
1676
|
+
return this[kData].application_id;
|
|
1677
|
+
}
|
|
1678
|
+
/**
|
|
1679
|
+
* The id of the user that is granted access to the entitlement's SKU
|
|
1680
|
+
*/
|
|
1681
|
+
get userId() {
|
|
1682
|
+
return this[kData].user_id;
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Type of entitlement
|
|
1686
|
+
*
|
|
1687
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#entitlement-object-entitlement-types}
|
|
1688
|
+
*/
|
|
1689
|
+
get type() {
|
|
1690
|
+
return this[kData].type;
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* Whether the entitlement was deleted
|
|
1694
|
+
*/
|
|
1695
|
+
get deleted() {
|
|
1696
|
+
return this[kData].deleted;
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Start date at which the entitlement is valid
|
|
1700
|
+
*/
|
|
1701
|
+
get startsAt() {
|
|
1702
|
+
const timestamp = this.startsTimestamp;
|
|
1703
|
+
return timestamp ? new Date(timestamp) : null;
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Timestamp of the start date at which the entitlement is valid
|
|
1707
|
+
*/
|
|
1708
|
+
get startsTimestamp() {
|
|
1709
|
+
return this[kStartsTimestamp];
|
|
1710
|
+
}
|
|
1711
|
+
/**
|
|
1712
|
+
* End date at which the entitlement is valid
|
|
1713
|
+
*/
|
|
1714
|
+
get endsAt() {
|
|
1715
|
+
const timestamp = this.endsTimestamp;
|
|
1716
|
+
return timestamp ? new Date(timestamp) : null;
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* Timestamp of the end date at which the entitlement is valid
|
|
1720
|
+
*/
|
|
1721
|
+
get endsTimestamp() {
|
|
1722
|
+
return this[kEndsTimestamp];
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* Id of the guild that is granted access to the entitlement's SKU
|
|
1726
|
+
*/
|
|
1727
|
+
get guildId() {
|
|
1728
|
+
return this[kData].guild_id;
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* For consumable items, whether the entitlement has been consumed
|
|
1732
|
+
*/
|
|
1733
|
+
get consumed() {
|
|
1734
|
+
return this[kData].consumed;
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* The timestamp the entitlement was created at
|
|
1738
|
+
*/
|
|
1739
|
+
get createdTimestamp() {
|
|
1740
|
+
return isIdSet(this.id) ? import_snowflake3.DiscordSnowflake.timestampFrom(this.id) : null;
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* The time the entitlement was created at
|
|
1744
|
+
*/
|
|
1745
|
+
get createdAt() {
|
|
1746
|
+
const createdTimestamp = this.createdTimestamp;
|
|
1747
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
1748
|
+
}
|
|
1749
|
+
/**
|
|
1750
|
+
* {@inheritDoc Structure.toJSON}
|
|
1751
|
+
*/
|
|
1752
|
+
toJSON() {
|
|
1753
|
+
const clone = super.toJSON();
|
|
1754
|
+
const startsAtTimestamp = this[kStartsTimestamp];
|
|
1755
|
+
const endsAtTimestamp = this[kEndsTimestamp];
|
|
1756
|
+
if (startsAtTimestamp) {
|
|
1757
|
+
clone.starts_at = dateToDiscordISOTimestamp(new Date(startsAtTimestamp));
|
|
1758
|
+
}
|
|
1759
|
+
if (endsAtTimestamp) {
|
|
1760
|
+
clone.ends_at = dateToDiscordISOTimestamp(new Date(endsAtTimestamp));
|
|
1761
|
+
}
|
|
1762
|
+
return clone;
|
|
1763
|
+
}
|
|
1764
|
+
};
|
|
1765
|
+
|
|
1766
|
+
// src/interactions/ResolvedInteractionData.ts
|
|
1767
|
+
var ResolvedInteractionData = class extends Structure {
|
|
1768
|
+
static {
|
|
1769
|
+
__name(this, "ResolvedInteractionData");
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* @param data - The raw data received from the API for the connection
|
|
1773
|
+
*/
|
|
1774
|
+
constructor(data) {
|
|
1775
|
+
super(data);
|
|
1776
|
+
}
|
|
1777
|
+
};
|
|
1778
|
+
|
|
1561
1779
|
// src/invites/Invite.ts
|
|
1780
|
+
var import_v105 = require("discord-api-types/v10");
|
|
1562
1781
|
var Invite = class extends Structure {
|
|
1563
1782
|
static {
|
|
1564
1783
|
__name(this, "Invite");
|
|
@@ -3022,7 +3241,7 @@ var ChannelMention = class extends Structure {
|
|
|
3022
3241
|
};
|
|
3023
3242
|
|
|
3024
3243
|
// src/messages/Message.ts
|
|
3025
|
-
var
|
|
3244
|
+
var import_snowflake4 = require("@sapphire/snowflake");
|
|
3026
3245
|
var Message = class extends Structure {
|
|
3027
3246
|
static {
|
|
3028
3247
|
__name(this, "Message");
|
|
@@ -3076,7 +3295,7 @@ var Message = class extends Structure {
|
|
|
3076
3295
|
* The timestamp this message was created at
|
|
3077
3296
|
*/
|
|
3078
3297
|
get createdTimestamp() {
|
|
3079
|
-
return isIdSet(this.id) ?
|
|
3298
|
+
return isIdSet(this.id) ? import_snowflake4.DiscordSnowflake.timestampFrom(this.id) : null;
|
|
3080
3299
|
}
|
|
3081
3300
|
/**
|
|
3082
3301
|
* The time the message was created at
|
|
@@ -3729,7 +3948,7 @@ var AvatarDecorationData = class extends Structure {
|
|
|
3729
3948
|
};
|
|
3730
3949
|
|
|
3731
3950
|
// src/users/User.ts
|
|
3732
|
-
var
|
|
3951
|
+
var import_snowflake5 = require("@sapphire/snowflake");
|
|
3733
3952
|
var User = class extends Structure {
|
|
3734
3953
|
static {
|
|
3735
3954
|
__name(this, "User");
|
|
@@ -3852,7 +4071,7 @@ var User = class extends Structure {
|
|
|
3852
4071
|
* The timestamp the user was created at
|
|
3853
4072
|
*/
|
|
3854
4073
|
get createdTimestamp() {
|
|
3855
|
-
return isIdSet(this.id) ?
|
|
4074
|
+
return isIdSet(this.id) ? import_snowflake5.DiscordSnowflake.timestampFrom(this.id) : null;
|
|
3856
4075
|
}
|
|
3857
4076
|
/**
|
|
3858
4077
|
* The time the user was created at
|
|
@@ -3982,6 +4201,8 @@ var Connection = class extends Structure {
|
|
|
3982
4201
|
EmbedProvider,
|
|
3983
4202
|
EmbedThumbnail,
|
|
3984
4203
|
EmbedVideo,
|
|
4204
|
+
Emoji,
|
|
4205
|
+
Entitlement,
|
|
3985
4206
|
FileComponent,
|
|
3986
4207
|
FileUploadComponent,
|
|
3987
4208
|
ForumChannel,
|