@discordjs/structures 1.0.0-dev.1786968995-99af6d8be → 1.0.0-dev.1788538586-ecea9ed57
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 +340 -28
- package/dist/index.d.ts +340 -28
- package/dist/index.js +495 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +471 -54
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
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 { APIAutoModerationAction, APIAutoModerationActionMetadata, APIAutoModerationRule, APIAutoModerationRuleTriggerMetadata, AttachmentFlags, ChannelFlags, MessageFlags, PermissionFlagsBits, SKUFlags, 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, APIMessageSharedClientTheme, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, APISKU, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APITeam, APITeamMember, APIAvatarDecorationData, APIUser, APIConnection, APIWebhook, APIVoiceState, APIVoiceRegion, APISubscription } from 'discord-api-types/v10';
|
|
2
|
+
import { APIAutoModerationAction, APIAutoModerationActionMetadata, APIAutoModerationRule, APIAutoModerationRuleTriggerMetadata, ActivityFlags, AttachmentFlags, ChannelFlags, MessageFlags, PermissionFlagsBits, SKUFlags, 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, APIMessageSharedClientTheme, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, GatewayActivity, GatewayActivityAssets, ApplicationAssetFormat, GatewayActivityButton, GatewayActivityParty, GatewayActivitySecrets, GatewayActivityTimestamps, GatewayPresenceClientStatus, GatewayGuildMembersChunkPresence, APISKU, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APITeam, APITeamMember, APIAvatarDecorationData, APIUser, APIConnection, APIWebhook, APIVoiceState, APIVoiceRegion, APISubscription } from 'discord-api-types/v10';
|
|
3
3
|
|
|
4
4
|
declare const kData: unique symbol;
|
|
5
5
|
declare const kClone: unique symbol;
|
|
@@ -437,6 +437,17 @@ declare abstract class BitField<Flags extends string> {
|
|
|
437
437
|
static resolve<Flags extends string = string>(bit: BitFieldResolvable<Flags>): bigint;
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Data structure that makes it easy to interact with an {@link ActivityFlags} bitfield.
|
|
442
|
+
*/
|
|
443
|
+
declare class ActivityFlagsBitField extends BitField<keyof typeof ActivityFlags> {
|
|
444
|
+
/**
|
|
445
|
+
* Numeric gateway presence activity flags.
|
|
446
|
+
*/
|
|
447
|
+
static readonly Flags: typeof ActivityFlags;
|
|
448
|
+
toJSON(): string | number;
|
|
449
|
+
}
|
|
450
|
+
|
|
440
451
|
/**
|
|
441
452
|
* Data structure that makes it easy to interact with a {@link Attachment#flags} bitfield.
|
|
442
453
|
*/
|
|
@@ -797,7 +808,7 @@ declare class Channel<Type extends ChannelType | 'unknown' = ChannelType, Omitte
|
|
|
797
808
|
/**
|
|
798
809
|
* The time the channel was created at
|
|
799
810
|
*/
|
|
800
|
-
get
|
|
811
|
+
get createdDate(): Date | null;
|
|
801
812
|
/**
|
|
802
813
|
* Indicates whether this channel is a thread channel
|
|
803
814
|
*
|
|
@@ -900,7 +911,7 @@ declare class ChannelPinMixin<Type extends ChannelType.DM | ChannelType.GuildAnn
|
|
|
900
911
|
/**
|
|
901
912
|
* The Date of when the last pin in the channel happened
|
|
902
913
|
*/
|
|
903
|
-
get
|
|
914
|
+
get lastPinDate(): Date | null;
|
|
904
915
|
/**
|
|
905
916
|
* Adds data from optimized properties omitted from [kData].
|
|
906
917
|
*
|
|
@@ -947,7 +958,7 @@ declare class GroupDMMixin {
|
|
|
947
958
|
/**
|
|
948
959
|
* The application id of the group DM creator if it is bot-created.
|
|
949
960
|
*/
|
|
950
|
-
get applicationId(): string | undefined;
|
|
961
|
+
get applicationId(): string | null | undefined;
|
|
951
962
|
}
|
|
952
963
|
|
|
953
964
|
/**
|
|
@@ -1072,11 +1083,11 @@ declare class ThreadMetadata<Omitted extends keyof APIThreadMetadata | '' = 'arc
|
|
|
1072
1083
|
/**
|
|
1073
1084
|
* The time the thread was archived at
|
|
1074
1085
|
*/
|
|
1075
|
-
get
|
|
1086
|
+
get archivedDate(): Date | null;
|
|
1076
1087
|
/**
|
|
1077
1088
|
* The time the thread was created at
|
|
1078
1089
|
*/
|
|
1079
|
-
get
|
|
1090
|
+
get createdDate(): Date | null;
|
|
1080
1091
|
/**
|
|
1081
1092
|
* {@inheritDoc Structure.toJSON}
|
|
1082
1093
|
*/
|
|
@@ -1358,7 +1369,7 @@ declare class Emoji<Omitted extends keyof APIEmoji | '' = ''> extends Structure<
|
|
|
1358
1369
|
/**
|
|
1359
1370
|
* The time the emoji was created at
|
|
1360
1371
|
*/
|
|
1361
|
-
get
|
|
1372
|
+
get createdDate(): Date | null;
|
|
1362
1373
|
}
|
|
1363
1374
|
|
|
1364
1375
|
/**
|
|
@@ -1413,7 +1424,7 @@ declare class Entitlement<Omitted extends keyof APIEntitlement | '' = 'ends_at'
|
|
|
1413
1424
|
/**
|
|
1414
1425
|
* Start date at which the entitlement is valid
|
|
1415
1426
|
*/
|
|
1416
|
-
get
|
|
1427
|
+
get startsDate(): Date | null;
|
|
1417
1428
|
/**
|
|
1418
1429
|
* Timestamp of the start date at which the entitlement is valid
|
|
1419
1430
|
*/
|
|
@@ -1421,7 +1432,7 @@ declare class Entitlement<Omitted extends keyof APIEntitlement | '' = 'ends_at'
|
|
|
1421
1432
|
/**
|
|
1422
1433
|
* End date at which the entitlement is valid
|
|
1423
1434
|
*/
|
|
1424
|
-
get
|
|
1435
|
+
get endsDate(): Date | null;
|
|
1425
1436
|
/**
|
|
1426
1437
|
* Timestamp of the end date at which the entitlement is valid
|
|
1427
1438
|
*/
|
|
@@ -1441,7 +1452,7 @@ declare class Entitlement<Omitted extends keyof APIEntitlement | '' = 'ends_at'
|
|
|
1441
1452
|
/**
|
|
1442
1453
|
* The time the entitlement was created at
|
|
1443
1454
|
*/
|
|
1444
|
-
get
|
|
1455
|
+
get createdDate(): Date | null;
|
|
1445
1456
|
/**
|
|
1446
1457
|
* {@inheritDoc Structure.toJSON}
|
|
1447
1458
|
*/
|
|
@@ -1529,7 +1540,7 @@ declare class Invite<Omitted extends keyof APIActualInvite | '' = 'created_at' |
|
|
|
1529
1540
|
/**
|
|
1530
1541
|
* The time the invite will expire at
|
|
1531
1542
|
*/
|
|
1532
|
-
get
|
|
1543
|
+
get expiresDate(): Date | null;
|
|
1533
1544
|
/**
|
|
1534
1545
|
* The number of times this invite has been used
|
|
1535
1546
|
*/
|
|
@@ -1553,7 +1564,7 @@ declare class Invite<Omitted extends keyof APIActualInvite | '' = 'created_at' |
|
|
|
1553
1564
|
/**
|
|
1554
1565
|
* The time the invite was created at
|
|
1555
1566
|
*/
|
|
1556
|
-
get
|
|
1567
|
+
get createdDate(): Date | null;
|
|
1557
1568
|
/**
|
|
1558
1569
|
* The URL to the invite
|
|
1559
1570
|
*/
|
|
@@ -2648,7 +2659,7 @@ declare class Message<Omitted extends keyof APIMessage | '' = 'edited_timestamp'
|
|
|
2648
2659
|
/**
|
|
2649
2660
|
* The time the message was created at
|
|
2650
2661
|
*/
|
|
2651
|
-
get
|
|
2662
|
+
get createdDate(): Date | null;
|
|
2652
2663
|
/**
|
|
2653
2664
|
* The content of the message
|
|
2654
2665
|
*/
|
|
@@ -2660,7 +2671,7 @@ declare class Message<Omitted extends keyof APIMessage | '' = 'edited_timestamp'
|
|
|
2660
2671
|
/**
|
|
2661
2672
|
* The time the message was last edited at, or `null` if it never was edited
|
|
2662
2673
|
*/
|
|
2663
|
-
get
|
|
2674
|
+
get editedDate(): Date | null;
|
|
2664
2675
|
/**
|
|
2665
2676
|
* The flags of this message as a bit field
|
|
2666
2677
|
*/
|
|
@@ -2740,7 +2751,7 @@ declare class MessageCall<Omitted extends keyof APIMessageCall | '' = 'ended_tim
|
|
|
2740
2751
|
/**
|
|
2741
2752
|
* The time the call ended at, or `null` if it didn't end yet
|
|
2742
2753
|
*/
|
|
2743
|
-
get
|
|
2754
|
+
get endedDate(): Date | null;
|
|
2744
2755
|
/**
|
|
2745
2756
|
* {@inheritDoc Structure.toJSON}
|
|
2746
2757
|
*/
|
|
@@ -2989,7 +3000,7 @@ declare class Poll<Omitted extends keyof APIPoll | '' = ''> extends Structure<AP
|
|
|
2989
3000
|
/**
|
|
2990
3001
|
* The time the poll will expire at
|
|
2991
3002
|
*/
|
|
2992
|
-
get
|
|
3003
|
+
get expiresDate(): Date | null;
|
|
2993
3004
|
/**
|
|
2994
3005
|
* {@inheritDoc Structure.toJSON}
|
|
2995
3006
|
*/
|
|
@@ -3087,6 +3098,306 @@ declare class PollResults<Omitted extends keyof APIPollResults | '' = ''> extend
|
|
|
3087
3098
|
get isFinalized(): "is_finalized" extends infer T ? T extends "is_finalized" ? T extends Omitted ? unknown : APIPollResults[T] : never : never;
|
|
3088
3099
|
}
|
|
3089
3100
|
|
|
3101
|
+
/**
|
|
3102
|
+
* Represents any activity on Discord.
|
|
3103
|
+
*
|
|
3104
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`.
|
|
3105
|
+
* @remarks has substructures `ActivityTimestamps`, `ActivityParty`,`ActivityAssets`, `ActivitySecrets` which need to be instantiated
|
|
3106
|
+
* and stored by an extending class using it.
|
|
3107
|
+
* @remarks intentionally does not export `buttons` so that extending classes can resolve `string[]` to `ActivityButton[]`
|
|
3108
|
+
*/
|
|
3109
|
+
declare class Activity<Omitted extends keyof GatewayActivity | '' = ''> extends Structure<GatewayActivity, Omitted> {
|
|
3110
|
+
/**
|
|
3111
|
+
* The template used for removing data from the raw data stored for each activity
|
|
3112
|
+
*/
|
|
3113
|
+
static readonly DataTemplate: Partial<GatewayActivity>;
|
|
3114
|
+
/**
|
|
3115
|
+
* @param data - The raw data received from the API for the activity
|
|
3116
|
+
*/
|
|
3117
|
+
constructor(data: Partialize<GatewayActivity, Omitted>);
|
|
3118
|
+
/**
|
|
3119
|
+
* The name of the activity
|
|
3120
|
+
*/
|
|
3121
|
+
get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never;
|
|
3122
|
+
/**
|
|
3123
|
+
* The type of this activity
|
|
3124
|
+
*
|
|
3125
|
+
* @see {@link https://docs.discord.com/developers/events/gateway-events#activity-object-activity-types}
|
|
3126
|
+
*/
|
|
3127
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never;
|
|
3128
|
+
/**
|
|
3129
|
+
* Stream URL, is validated when type is {@link ActivityType.Streaming}
|
|
3130
|
+
*/
|
|
3131
|
+
get url(): ("url" extends infer T ? T extends "url" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3132
|
+
/**
|
|
3133
|
+
* Time of when the activity was added to the user's session
|
|
3134
|
+
*/
|
|
3135
|
+
get createdDate(): Date | null;
|
|
3136
|
+
/**
|
|
3137
|
+
* Unix timestamp (in milliseconds) of when the activity was added to the user's session
|
|
3138
|
+
*/
|
|
3139
|
+
get createdTimestamp(): "created_at" extends infer T ? T extends "created_at" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never;
|
|
3140
|
+
/**
|
|
3141
|
+
* Application id for the game
|
|
3142
|
+
*/
|
|
3143
|
+
get applicationId(): ("application_id" extends infer T ? T extends "application_id" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3144
|
+
/**
|
|
3145
|
+
* Controls which field is displayed in the user's status text in the member list
|
|
3146
|
+
*
|
|
3147
|
+
* @see {@link https://docs.discord.com/developers/events/gateway-events#activity-object-status-display-types}
|
|
3148
|
+
*/
|
|
3149
|
+
get statusDisplayType(): ("status_display_type" extends infer T ? T extends "status_display_type" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3150
|
+
/**
|
|
3151
|
+
* What the player is currently doing
|
|
3152
|
+
*/
|
|
3153
|
+
get details(): ("details" extends infer T ? T extends "details" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3154
|
+
/**
|
|
3155
|
+
* URL that is linked when clicking on the details text
|
|
3156
|
+
*/
|
|
3157
|
+
get detailsURL(): ("details_url" extends infer T ? T extends "details_url" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3158
|
+
/**
|
|
3159
|
+
* User's current party status, or text used for a custom status
|
|
3160
|
+
*/
|
|
3161
|
+
get state(): ("state" extends infer T ? T extends "state" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3162
|
+
/**
|
|
3163
|
+
* URL that is linked when clicking on the state text
|
|
3164
|
+
*/
|
|
3165
|
+
get stateURL(): ("state_url" extends infer T ? T extends "state_url" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3166
|
+
/**
|
|
3167
|
+
* Whether the activity is an instanced game session
|
|
3168
|
+
*/
|
|
3169
|
+
get instance(): ("instance" extends infer T ? T extends "instance" ? T extends Omitted ? unknown : GatewayActivity[T] : never : never) | undefined;
|
|
3170
|
+
/**
|
|
3171
|
+
* Activity flags `OR`d together, describes what the payload includes
|
|
3172
|
+
*
|
|
3173
|
+
* @see {@link https://docs.discord.com/developers/events/gateway-events#activity-object-activity-flags}
|
|
3174
|
+
*/
|
|
3175
|
+
get flags(): ActivityFlagsBitField | null;
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
/**
|
|
3179
|
+
* Represents any activity assets on Discord.
|
|
3180
|
+
*
|
|
3181
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3182
|
+
*/
|
|
3183
|
+
declare class ActivityAssets<Omitted extends keyof GatewayActivityAssets | '' = ''> extends Structure<GatewayActivityAssets, Omitted> {
|
|
3184
|
+
/**
|
|
3185
|
+
* The template used for removing data from the raw data stored for each activity assets
|
|
3186
|
+
*/
|
|
3187
|
+
static readonly DataTemplate: Partial<GatewayActivityAssets>;
|
|
3188
|
+
/**
|
|
3189
|
+
* @param data - The raw data received from the API for the activity assets
|
|
3190
|
+
*/
|
|
3191
|
+
constructor(data: Partialize<GatewayActivityAssets, Omitted>);
|
|
3192
|
+
/**
|
|
3193
|
+
* @see {@link https://docs.discord.com/developers/events/gateway-events#activity-object-activity-asset-image}
|
|
3194
|
+
*/
|
|
3195
|
+
get largeImage(): ("large_image" extends infer T ? T extends "large_image" ? T extends Omitted ? unknown : GatewayActivityAssets[T] : never : never) | undefined;
|
|
3196
|
+
/**
|
|
3197
|
+
* Returns the large image URL of this `largeImage`
|
|
3198
|
+
*
|
|
3199
|
+
* @param applicationId - The id of the application to whom this asset belongs to
|
|
3200
|
+
* @param imageFormat - The desired format of the returned image URL
|
|
3201
|
+
*/
|
|
3202
|
+
largeImageURL(applicationId: string, imageFormat?: ApplicationAssetFormat): string | null;
|
|
3203
|
+
/**
|
|
3204
|
+
* Text displayed when hovering over the large image of the activity
|
|
3205
|
+
*/
|
|
3206
|
+
get largeText(): ("large_text" extends infer T ? T extends "large_text" ? T extends Omitted ? unknown : GatewayActivityAssets[T] : never : never) | undefined;
|
|
3207
|
+
/**
|
|
3208
|
+
* URL that is opened when clicking on the large image
|
|
3209
|
+
*/
|
|
3210
|
+
get largeURL(): ("large_url" extends infer T ? T extends "large_url" ? T extends Omitted ? unknown : GatewayActivityAssets[T] : never : never) | undefined;
|
|
3211
|
+
/**
|
|
3212
|
+
* @see {@link https://docs.discord.com/developers/events/gateway-events#activity-object-activity-asset-image}
|
|
3213
|
+
*/
|
|
3214
|
+
get smallImage(): ("small_image" extends infer T ? T extends "small_image" ? T extends Omitted ? unknown : GatewayActivityAssets[T] : never : never) | undefined;
|
|
3215
|
+
/**
|
|
3216
|
+
* Returns the small image URL of this `smallImage`
|
|
3217
|
+
*
|
|
3218
|
+
* @param applicationId - The id of the application to whom this asset belongs to
|
|
3219
|
+
* @param imageFormat - The desired format of the returned image URL
|
|
3220
|
+
*/
|
|
3221
|
+
smallImageURL(applicationId: string, imageFormat?: ApplicationAssetFormat): string | null;
|
|
3222
|
+
/**
|
|
3223
|
+
* Text displayed when hovering over the small image of the activity
|
|
3224
|
+
*/
|
|
3225
|
+
get smallText(): ("small_text" extends infer T ? T extends "small_text" ? T extends Omitted ? unknown : GatewayActivityAssets[T] : never : never) | undefined;
|
|
3226
|
+
/**
|
|
3227
|
+
* URL that is opened when clicking on the small image
|
|
3228
|
+
*/
|
|
3229
|
+
get smallURL(): ("small_url" extends infer T ? T extends "small_url" ? T extends Omitted ? unknown : GatewayActivityAssets[T] : never : never) | undefined;
|
|
3230
|
+
/**
|
|
3231
|
+
* URL of the image which is displayed as a banner on a Game Invite
|
|
3232
|
+
*/
|
|
3233
|
+
get inviteCoverImage(): ("invite_cover_image" extends infer T ? T extends "invite_cover_image" ? T extends Omitted ? unknown : GatewayActivityAssets[T] : never : never) | undefined;
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* Represents any activity button on Discord.
|
|
3238
|
+
*
|
|
3239
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`.
|
|
3240
|
+
* @remarks When received over the gateway, the `buttons` field is an array of strings, which are the `button` labels. Bots cannot
|
|
3241
|
+
* access a user's activity button URLs. When sending, the buttons field must be an array of this structure.
|
|
3242
|
+
*/
|
|
3243
|
+
declare class ActivityButton<Omitted extends keyof GatewayActivityButton | '' = ''> extends Structure<GatewayActivityButton, Omitted> {
|
|
3244
|
+
/**
|
|
3245
|
+
* The template used for removing data from the raw data stored for each activity button
|
|
3246
|
+
*/
|
|
3247
|
+
static readonly DataTemplate: Partial<GatewayActivityButton>;
|
|
3248
|
+
/**
|
|
3249
|
+
* @param data - The raw data received from the API for the activity button
|
|
3250
|
+
*/
|
|
3251
|
+
constructor(data: Partialize<GatewayActivityButton, Omitted>);
|
|
3252
|
+
/**
|
|
3253
|
+
* Text shown on the button (1-32 characters)
|
|
3254
|
+
*/
|
|
3255
|
+
get label(): "label" extends infer T ? T extends "label" ? T extends Omitted ? unknown : GatewayActivityButton[T] : never : never;
|
|
3256
|
+
/**
|
|
3257
|
+
* URL opened when clicking the button (1-512 characters)
|
|
3258
|
+
*/
|
|
3259
|
+
get url(): "url" extends infer T ? T extends "url" ? T extends Omitted ? unknown : GatewayActivityButton[T] : never : never;
|
|
3260
|
+
}
|
|
3261
|
+
|
|
3262
|
+
/**
|
|
3263
|
+
* Represents any activity party on Discord.
|
|
3264
|
+
*
|
|
3265
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3266
|
+
*/
|
|
3267
|
+
declare class ActivityParty<Omitted extends keyof GatewayActivityParty | '' = ''> extends Structure<GatewayActivityParty, Omitted> {
|
|
3268
|
+
/**
|
|
3269
|
+
* The template used for removing data from the raw data stored for each activity party.
|
|
3270
|
+
*/
|
|
3271
|
+
static readonly DataTemplate: Partial<GatewayActivityParty>;
|
|
3272
|
+
/**
|
|
3273
|
+
* @param data - The raw data received from the API for the activity party.
|
|
3274
|
+
*/
|
|
3275
|
+
constructor(data: Partialize<GatewayActivityParty, Omitted>);
|
|
3276
|
+
/**
|
|
3277
|
+
* The id of the party.
|
|
3278
|
+
*
|
|
3279
|
+
* @remarks This is an application-defined id and is not a Discord snowflake.
|
|
3280
|
+
*/
|
|
3281
|
+
get id(): ("id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : GatewayActivityParty[T] : never : never) | undefined;
|
|
3282
|
+
/**
|
|
3283
|
+
* The current size of the party
|
|
3284
|
+
*/
|
|
3285
|
+
get currentSize(): "number" | null;
|
|
3286
|
+
/**
|
|
3287
|
+
* The maximum size of the party
|
|
3288
|
+
*/
|
|
3289
|
+
get maximumSize(): "number" | null;
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3292
|
+
/**
|
|
3293
|
+
* Represents any activity secrets on Discord.
|
|
3294
|
+
*
|
|
3295
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3296
|
+
*/
|
|
3297
|
+
declare class ActivitySecrets<Omitted extends keyof GatewayActivitySecrets | '' = ''> extends Structure<GatewayActivitySecrets, Omitted> {
|
|
3298
|
+
/**
|
|
3299
|
+
* The template used for removing data from the raw data stored for each activity's secrets.
|
|
3300
|
+
*/
|
|
3301
|
+
static readonly DataTemplate: Partial<GatewayActivitySecrets>;
|
|
3302
|
+
/**
|
|
3303
|
+
* @param data - The raw data received from the API for the activity's secrets.
|
|
3304
|
+
*/
|
|
3305
|
+
constructor(data: Partialize<GatewayActivitySecrets, Omitted>);
|
|
3306
|
+
/**
|
|
3307
|
+
* Secret for joining a party.
|
|
3308
|
+
*/
|
|
3309
|
+
get join(): ("join" extends infer T ? T extends "join" ? T extends Omitted ? unknown : GatewayActivitySecrets[T] : never : never) | undefined;
|
|
3310
|
+
/**
|
|
3311
|
+
* Secret for spectating a game.
|
|
3312
|
+
*/
|
|
3313
|
+
get spectate(): ("spectate" extends infer T ? T extends "spectate" ? T extends Omitted ? unknown : GatewayActivitySecrets[T] : never : never) | undefined;
|
|
3314
|
+
/**
|
|
3315
|
+
* Secret for a specific instanced match
|
|
3316
|
+
*/
|
|
3317
|
+
get match(): ("match" extends infer T ? T extends "match" ? T extends Omitted ? unknown : GatewayActivitySecrets[T] : never : never) | undefined;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
/**
|
|
3321
|
+
* Represents any activity timestamp on Discord.
|
|
3322
|
+
*
|
|
3323
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3324
|
+
*/
|
|
3325
|
+
declare class ActivityTimestamps<Omitted extends keyof GatewayActivityTimestamps | '' = ''> extends Structure<GatewayActivityTimestamps, Omitted> {
|
|
3326
|
+
/**
|
|
3327
|
+
* The template used for removing data from the raw data stored for each activity timestamp
|
|
3328
|
+
*/
|
|
3329
|
+
static readonly DataTemplate: Partial<GatewayActivityTimestamps>;
|
|
3330
|
+
/**
|
|
3331
|
+
* @param data - The raw data received from the API for the activity timestamp
|
|
3332
|
+
*/
|
|
3333
|
+
constructor(data: Partialize<GatewayActivityTimestamps, Omitted>);
|
|
3334
|
+
/**
|
|
3335
|
+
* Unix time (in milliseconds) of when the activity started.
|
|
3336
|
+
*/
|
|
3337
|
+
get startTimestamp(): ("start" extends infer T ? T extends "start" ? T extends Omitted ? unknown : GatewayActivityTimestamps[T] : never : never) | undefined;
|
|
3338
|
+
/**
|
|
3339
|
+
* Time of when the activity started.
|
|
3340
|
+
*/
|
|
3341
|
+
get startDate(): Date | null;
|
|
3342
|
+
/**
|
|
3343
|
+
* Unix time (in milliseconds) of when the activity ends.
|
|
3344
|
+
*/
|
|
3345
|
+
get endTimestamp(): ("end" extends infer T ? T extends "end" ? T extends Omitted ? unknown : GatewayActivityTimestamps[T] : never : never) | undefined;
|
|
3346
|
+
/**
|
|
3347
|
+
* Time of when the activity ended.
|
|
3348
|
+
*/
|
|
3349
|
+
get endDate(): Date | null;
|
|
3350
|
+
}
|
|
3351
|
+
|
|
3352
|
+
/**
|
|
3353
|
+
* Represents any client status on Discord.
|
|
3354
|
+
*
|
|
3355
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3356
|
+
*/
|
|
3357
|
+
declare class ClientStatus<Omitted extends keyof GatewayPresenceClientStatus | '' = ''> extends Structure<GatewayPresenceClientStatus, Omitted> {
|
|
3358
|
+
/**
|
|
3359
|
+
* The template used for removing data from the raw data stored for each client status
|
|
3360
|
+
*/
|
|
3361
|
+
static readonly DataTemplate: Partial<GatewayPresenceClientStatus>;
|
|
3362
|
+
/**
|
|
3363
|
+
* @param data - The raw data received from the API for the client status
|
|
3364
|
+
*/
|
|
3365
|
+
constructor(data: Partialize<GatewayPresenceClientStatus, Omitted>);
|
|
3366
|
+
/**
|
|
3367
|
+
* The user's status set for an active desktop (Windows, Linux, Mac) application session
|
|
3368
|
+
*/
|
|
3369
|
+
get desktop(): ("desktop" extends infer T ? T extends "desktop" ? T extends Omitted ? unknown : GatewayPresenceClientStatus[T] : never : never) | undefined;
|
|
3370
|
+
/**
|
|
3371
|
+
* The user's status set for an active mobile (iOS, Android) application session
|
|
3372
|
+
*/
|
|
3373
|
+
get mobile(): ("mobile" extends infer T ? T extends "mobile" ? T extends Omitted ? unknown : GatewayPresenceClientStatus[T] : never : never) | undefined;
|
|
3374
|
+
/**
|
|
3375
|
+
* The user's status set for an active web (browser, bot user) application session
|
|
3376
|
+
*/
|
|
3377
|
+
get web(): ("web" extends infer T ? T extends "web" ? T extends Omitted ? unknown : GatewayPresenceClientStatus[T] : never : never) | undefined;
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
/**
|
|
3381
|
+
* Represents any presence update on Discord.
|
|
3382
|
+
*
|
|
3383
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3384
|
+
* @remarks has substructures `Activity`, `ClientStatus` which need to be instantiated and stored by an extending class using it
|
|
3385
|
+
*/
|
|
3386
|
+
declare class Presence<Omitted extends keyof GatewayGuildMembersChunkPresence | '' = ''> extends Structure<GatewayGuildMembersChunkPresence, Omitted> {
|
|
3387
|
+
/**
|
|
3388
|
+
* The template used for removing data from the raw data stored for each presence update
|
|
3389
|
+
*/
|
|
3390
|
+
static readonly DataTemplate: Partial<GatewayGuildMembersChunkPresence>;
|
|
3391
|
+
/**
|
|
3392
|
+
* @param data - The raw data received from the API for the presence update
|
|
3393
|
+
*/
|
|
3394
|
+
constructor(data: Partialize<GatewayGuildMembersChunkPresence, Omitted>);
|
|
3395
|
+
/**
|
|
3396
|
+
* The user's new status
|
|
3397
|
+
*/
|
|
3398
|
+
get status(): ("status" extends infer T ? T extends "status" ? T extends Omitted ? unknown : GatewayGuildMembersChunkPresence[T] : never : never) | undefined;
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3090
3401
|
/**
|
|
3091
3402
|
* Represents any SKU (stock-keeping units) on Discord.
|
|
3092
3403
|
*
|
|
@@ -3183,7 +3494,7 @@ declare class SoundboardSound<Omitted extends keyof APISoundboardSound | '' = ''
|
|
|
3183
3494
|
*
|
|
3184
3495
|
* @remarks only available for guild soundboard sounds
|
|
3185
3496
|
*/
|
|
3186
|
-
get
|
|
3497
|
+
get createdDate(): Date | null;
|
|
3187
3498
|
}
|
|
3188
3499
|
|
|
3189
3500
|
/**
|
|
@@ -3231,7 +3542,7 @@ declare class StageInstance<Omitted extends keyof APIStageInstance | '' = ''> ex
|
|
|
3231
3542
|
/**
|
|
3232
3543
|
* The time the stage instance was created at
|
|
3233
3544
|
*/
|
|
3234
|
-
get
|
|
3545
|
+
get createdDate(): Date | null;
|
|
3235
3546
|
}
|
|
3236
3547
|
|
|
3237
3548
|
/**
|
|
@@ -3283,7 +3594,7 @@ declare class Sticker<Omitted extends keyof APISticker | '' = ''> extends Struct
|
|
|
3283
3594
|
/**
|
|
3284
3595
|
* The time the sticker was created at
|
|
3285
3596
|
*/
|
|
3286
|
-
get
|
|
3597
|
+
get createdDate(): Date | null;
|
|
3287
3598
|
}
|
|
3288
3599
|
|
|
3289
3600
|
/**
|
|
@@ -3334,7 +3645,7 @@ declare class StickerPack<Omitted extends keyof APIStickerPack | '' = ''> extend
|
|
|
3334
3645
|
/**
|
|
3335
3646
|
* The time the sticker pack was created at
|
|
3336
3647
|
*/
|
|
3337
|
-
get
|
|
3648
|
+
get createdDate(): Date | null;
|
|
3338
3649
|
}
|
|
3339
3650
|
|
|
3340
3651
|
/**
|
|
@@ -3375,7 +3686,7 @@ declare class Team<Omitted extends keyof APITeam | '' = ''> extends Structure<AP
|
|
|
3375
3686
|
/**
|
|
3376
3687
|
* The time the team was created at
|
|
3377
3688
|
*/
|
|
3378
|
-
get
|
|
3689
|
+
get createdDate(): Date | null;
|
|
3379
3690
|
}
|
|
3380
3691
|
|
|
3381
3692
|
/**
|
|
@@ -3531,7 +3842,7 @@ declare class User<Omitted extends keyof APIUser | '' = ''> extends Structure<AP
|
|
|
3531
3842
|
/**
|
|
3532
3843
|
* The time the user was created at
|
|
3533
3844
|
*/
|
|
3534
|
-
get
|
|
3845
|
+
get createdDate(): Date | null;
|
|
3535
3846
|
/**
|
|
3536
3847
|
* The hexadecimal version of the user accent color, with a leading hash
|
|
3537
3848
|
*
|
|
@@ -3654,7 +3965,7 @@ declare class Webhook<Omitted extends keyof APIWebhook | '' = ''> extends Struct
|
|
|
3654
3965
|
/**
|
|
3655
3966
|
* The time the webhook was created at
|
|
3656
3967
|
*/
|
|
3657
|
-
get
|
|
3968
|
+
get createdDate(): Date | null;
|
|
3658
3969
|
}
|
|
3659
3970
|
|
|
3660
3971
|
/**
|
|
@@ -3808,7 +4119,7 @@ declare class Subscription<Omitted extends keyof APISubscription | '' = 'cancele
|
|
|
3808
4119
|
/**
|
|
3809
4120
|
* The time at which the current subscription period will start
|
|
3810
4121
|
*/
|
|
3811
|
-
get
|
|
4122
|
+
get currentPeriodStartDate(): Date | null;
|
|
3812
4123
|
/**
|
|
3813
4124
|
* Timestamp of end of the current subscription period
|
|
3814
4125
|
*/
|
|
@@ -3816,7 +4127,7 @@ declare class Subscription<Omitted extends keyof APISubscription | '' = 'cancele
|
|
|
3816
4127
|
/**
|
|
3817
4128
|
* The time at which the current subscription period will end
|
|
3818
4129
|
*/
|
|
3819
|
-
get
|
|
4130
|
+
get currentPeriodEndDate(): Date | null;
|
|
3820
4131
|
/**
|
|
3821
4132
|
* The {@link discord-api-types/v10#SubscriptionStatus} of the current subscription
|
|
3822
4133
|
*/
|
|
@@ -3830,7 +4141,7 @@ declare class Subscription<Omitted extends keyof APISubscription | '' = 'cancele
|
|
|
3830
4141
|
*
|
|
3831
4142
|
* @remarks This is populated when the {@link Subscription.status} transitions to {@link discord-api-types/v10#SubscriptionStatus.Ending}.
|
|
3832
4143
|
*/
|
|
3833
|
-
get
|
|
4144
|
+
get canceledDate(): Date | null;
|
|
3834
4145
|
/**
|
|
3835
4146
|
* ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.
|
|
3836
4147
|
*/
|
|
@@ -3842,7 +4153,7 @@ declare class Subscription<Omitted extends keyof APISubscription | '' = 'cancele
|
|
|
3842
4153
|
/**
|
|
3843
4154
|
* The time the subscription was created at
|
|
3844
4155
|
*/
|
|
3845
|
-
get
|
|
4156
|
+
get createdDate(): Date | null;
|
|
3846
4157
|
/**
|
|
3847
4158
|
* {@inheritDoc Structure.toJSON}
|
|
3848
4159
|
*/
|
|
@@ -3854,9 +4165,10 @@ declare function extendTemplate<SuperTemplate extends Record<string, unknown>>(s
|
|
|
3854
4165
|
* Turns a JavaScript Date object into the timestamp format used by Discord in payloads.
|
|
3855
4166
|
* E.g. `2025-11-16T14:09:25.239000+00:00`
|
|
3856
4167
|
*
|
|
4168
|
+
* @internal
|
|
3857
4169
|
* @param date - a Date instance
|
|
3858
4170
|
* @returns an ISO8601 timestamp with microseconds precision and explicit +00:00 timezone
|
|
3859
4171
|
*/
|
|
3860
4172
|
declare function dateToDiscordISOTimestamp(date: Date): string;
|
|
3861
4173
|
|
|
3862
|
-
export { type APIActualInvite, ActionRowComponent, AnnouncementChannel, AnnouncementThreadChannel, ApplicationCommandInteractionMetadata, AppliedTagsMixin, Attachment, AttachmentFlagsBitField, AutoModerationAction, AutoModerationActionMetadata, AutoModerationRule, AutoModerationRuleTriggerMetadata, 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, SKU, SKUFlagsBitField, SectionComponent, SelectMenuComponent, SelectMenuDefaultValue, SeparatorComponent, SharedClientTheme, SoundboardSound, StageChannel, StageInstance, Sticker, StickerPack, StringSelectMenuComponent, StringSelectMenuOption, Structure, Subscription, Team, TeamMember, TextChannel, TextChannelMixin, TextDisplayComponent, TextInputComponent, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, ThumbnailComponent, UnfurledMediaItem, User, UserSelectMenuComponent, VoiceChannel, VoiceChannelMixin, VoiceRegion, VoiceState, Webhook, dateToDiscordISOTimestamp, extendTemplate };
|
|
4174
|
+
export { type APIActualInvite, ActionRowComponent, Activity, ActivityAssets, ActivityButton, ActivityFlagsBitField, ActivityParty, ActivitySecrets, ActivityTimestamps, AnnouncementChannel, AnnouncementThreadChannel, ApplicationCommandInteractionMetadata, AppliedTagsMixin, Attachment, AttachmentFlagsBitField, AutoModerationAction, AutoModerationActionMetadata, AutoModerationRule, AutoModerationRuleTriggerMetadata, AvatarDecorationData, BitField, type BitFieldResolvable, ButtonComponent, type ButtonDataType, CategoryChannel, Channel, type ChannelDataType, ChannelFlagsBitField, ChannelMention, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelPinMixin, ChannelSelectMenuComponent, ChannelSlowmodeMixin, ChannelTopicMixin, ChannelWebhookMixin, ClientStatus, 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, Presence, PrivateThreadChannel, PublicThreadChannel, Reaction, ReactionCountDetails, type RecursiveReadonlyArray, type ReplaceOmittedWithUnknown, ResolvedInteractionData, RoleSelectMenuComponent, RoleSubscriptionData, SKU, SKUFlagsBitField, SectionComponent, SelectMenuComponent, SelectMenuDefaultValue, SeparatorComponent, SharedClientTheme, SoundboardSound, StageChannel, StageInstance, Sticker, StickerPack, StringSelectMenuComponent, StringSelectMenuOption, Structure, Subscription, Team, TeamMember, TextChannel, TextChannelMixin, TextDisplayComponent, TextInputComponent, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, ThumbnailComponent, UnfurledMediaItem, User, UserSelectMenuComponent, VoiceChannel, VoiceChannelMixin, VoiceRegion, VoiceState, Webhook, dateToDiscordISOTimestamp, extendTemplate };
|