@discordjs/structures 0.2.0-dev.1769601701-c71228aab → 0.2.0-dev.1770595415-a3e189df0
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 +67 -2
- package/dist/index.d.ts +67 -2
- package/dist/index.js +93 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +92 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
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 { 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, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, APISKU, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APITeam, APITeamMember, APIAvatarDecorationData, APIUser, APIConnection, APIVoiceState, APIVoiceRegion, APISubscription } 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, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, 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;
|
|
@@ -3556,6 +3556,71 @@ declare class Connection<Omitted extends keyof APIConnection | '' = ''> extends
|
|
|
3556
3556
|
get visibility(): "visibility" extends infer T ? T extends "visibility" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
3557
3557
|
}
|
|
3558
3558
|
|
|
3559
|
+
/**
|
|
3560
|
+
* Represents any webhook on Discord.
|
|
3561
|
+
*
|
|
3562
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3563
|
+
* @remarks has substructures `User`, `Guild`, `Channel` which need to be instantiated and stored by an extending class using it
|
|
3564
|
+
*/
|
|
3565
|
+
declare class Webhook<Omitted extends keyof APIWebhook | '' = ''> extends Structure<APIWebhook, Omitted> {
|
|
3566
|
+
/**
|
|
3567
|
+
* The template used for removing data from the raw data stored for each webhook
|
|
3568
|
+
*/
|
|
3569
|
+
static readonly DataTemplate: Partial<APIWebhook>;
|
|
3570
|
+
/**
|
|
3571
|
+
* @param data - The raw data received from the API for the webhook
|
|
3572
|
+
*/
|
|
3573
|
+
constructor(data: Partialize<APIWebhook, Omitted>);
|
|
3574
|
+
/**
|
|
3575
|
+
* The id of the webhook
|
|
3576
|
+
*/
|
|
3577
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3578
|
+
/**
|
|
3579
|
+
* The type of the webhook
|
|
3580
|
+
*
|
|
3581
|
+
* @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types}
|
|
3582
|
+
*/
|
|
3583
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3584
|
+
/**
|
|
3585
|
+
* The guild id this webhook is for, if any
|
|
3586
|
+
*/
|
|
3587
|
+
get guildId(): ("guild_id" extends infer T ? T extends "guild_id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never) | undefined;
|
|
3588
|
+
/**
|
|
3589
|
+
* The channel id this webhook is for, if any
|
|
3590
|
+
*/
|
|
3591
|
+
get channelId(): "channel_id" extends infer T ? T extends "channel_id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3592
|
+
/**
|
|
3593
|
+
* The default name of the webhook
|
|
3594
|
+
*/
|
|
3595
|
+
get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3596
|
+
/**
|
|
3597
|
+
* The default user avatar hash of the webhook
|
|
3598
|
+
*
|
|
3599
|
+
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
|
|
3600
|
+
*/
|
|
3601
|
+
get avatar(): "avatar" extends infer T ? T extends "avatar" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3602
|
+
/**
|
|
3603
|
+
* The secure token of the webhook (returned for incoming webhooks)
|
|
3604
|
+
*/
|
|
3605
|
+
get token(): ("token" extends infer T ? T extends "token" ? T extends Omitted ? unknown : APIWebhook[T] : never : never) | undefined;
|
|
3606
|
+
/**
|
|
3607
|
+
* The id of the bot/OAuth2 application that created this webhook
|
|
3608
|
+
*/
|
|
3609
|
+
get applicationId(): "application_id" extends infer T ? T extends "application_id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3610
|
+
/**
|
|
3611
|
+
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
|
|
3612
|
+
*/
|
|
3613
|
+
get url(): ("url" extends infer T ? T extends "url" ? T extends Omitted ? unknown : APIWebhook[T] : never : never) | undefined;
|
|
3614
|
+
/**
|
|
3615
|
+
* The timestamp the webhook was created at
|
|
3616
|
+
*/
|
|
3617
|
+
get createdTimestamp(): number | null;
|
|
3618
|
+
/**
|
|
3619
|
+
* The time the webhook was created at
|
|
3620
|
+
*/
|
|
3621
|
+
get createdAt(): Date | null;
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3559
3624
|
/**
|
|
3560
3625
|
* Represents any voice state on Discord.
|
|
3561
3626
|
*
|
|
@@ -3755,4 +3820,4 @@ declare function extendTemplate<SuperTemplate extends Record<string, unknown>>(s
|
|
|
3755
3820
|
*/
|
|
3756
3821
|
declare function dateToDiscordISOTimestamp(date: Date): string;
|
|
3757
3822
|
|
|
3758
|
-
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, 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, dateToDiscordISOTimestamp, extendTemplate };
|
|
3823
|
+
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, 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 };
|
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, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, APISKU, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APITeam, APITeamMember, APIAvatarDecorationData, APIUser, APIConnection, APIVoiceState, APIVoiceRegion, APISubscription } 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, APIPoll, APIPollAnswer, APIPollAnswerCount, APIPollMedia, APIPollResults, 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;
|
|
@@ -3556,6 +3556,71 @@ declare class Connection<Omitted extends keyof APIConnection | '' = ''> extends
|
|
|
3556
3556
|
get visibility(): "visibility" extends infer T ? T extends "visibility" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
|
|
3557
3557
|
}
|
|
3558
3558
|
|
|
3559
|
+
/**
|
|
3560
|
+
* Represents any webhook on Discord.
|
|
3561
|
+
*
|
|
3562
|
+
* @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
|
|
3563
|
+
* @remarks has substructures `User`, `Guild`, `Channel` which need to be instantiated and stored by an extending class using it
|
|
3564
|
+
*/
|
|
3565
|
+
declare class Webhook<Omitted extends keyof APIWebhook | '' = ''> extends Structure<APIWebhook, Omitted> {
|
|
3566
|
+
/**
|
|
3567
|
+
* The template used for removing data from the raw data stored for each webhook
|
|
3568
|
+
*/
|
|
3569
|
+
static readonly DataTemplate: Partial<APIWebhook>;
|
|
3570
|
+
/**
|
|
3571
|
+
* @param data - The raw data received from the API for the webhook
|
|
3572
|
+
*/
|
|
3573
|
+
constructor(data: Partialize<APIWebhook, Omitted>);
|
|
3574
|
+
/**
|
|
3575
|
+
* The id of the webhook
|
|
3576
|
+
*/
|
|
3577
|
+
get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3578
|
+
/**
|
|
3579
|
+
* The type of the webhook
|
|
3580
|
+
*
|
|
3581
|
+
* @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types}
|
|
3582
|
+
*/
|
|
3583
|
+
get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3584
|
+
/**
|
|
3585
|
+
* The guild id this webhook is for, if any
|
|
3586
|
+
*/
|
|
3587
|
+
get guildId(): ("guild_id" extends infer T ? T extends "guild_id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never) | undefined;
|
|
3588
|
+
/**
|
|
3589
|
+
* The channel id this webhook is for, if any
|
|
3590
|
+
*/
|
|
3591
|
+
get channelId(): "channel_id" extends infer T ? T extends "channel_id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3592
|
+
/**
|
|
3593
|
+
* The default name of the webhook
|
|
3594
|
+
*/
|
|
3595
|
+
get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3596
|
+
/**
|
|
3597
|
+
* The default user avatar hash of the webhook
|
|
3598
|
+
*
|
|
3599
|
+
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
|
|
3600
|
+
*/
|
|
3601
|
+
get avatar(): "avatar" extends infer T ? T extends "avatar" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3602
|
+
/**
|
|
3603
|
+
* The secure token of the webhook (returned for incoming webhooks)
|
|
3604
|
+
*/
|
|
3605
|
+
get token(): ("token" extends infer T ? T extends "token" ? T extends Omitted ? unknown : APIWebhook[T] : never : never) | undefined;
|
|
3606
|
+
/**
|
|
3607
|
+
* The id of the bot/OAuth2 application that created this webhook
|
|
3608
|
+
*/
|
|
3609
|
+
get applicationId(): "application_id" extends infer T ? T extends "application_id" ? T extends Omitted ? unknown : APIWebhook[T] : never : never;
|
|
3610
|
+
/**
|
|
3611
|
+
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
|
|
3612
|
+
*/
|
|
3613
|
+
get url(): ("url" extends infer T ? T extends "url" ? T extends Omitted ? unknown : APIWebhook[T] : never : never) | undefined;
|
|
3614
|
+
/**
|
|
3615
|
+
* The timestamp the webhook was created at
|
|
3616
|
+
*/
|
|
3617
|
+
get createdTimestamp(): number | null;
|
|
3618
|
+
/**
|
|
3619
|
+
* The time the webhook was created at
|
|
3620
|
+
*/
|
|
3621
|
+
get createdAt(): Date | null;
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3559
3624
|
/**
|
|
3560
3625
|
* Represents any voice state on Discord.
|
|
3561
3626
|
*
|
|
@@ -3755,4 +3820,4 @@ declare function extendTemplate<SuperTemplate extends Record<string, unknown>>(s
|
|
|
3755
3820
|
*/
|
|
3756
3821
|
declare function dateToDiscordISOTimestamp(date: Date): string;
|
|
3757
3822
|
|
|
3758
|
-
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, 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, dateToDiscordISOTimestamp, extendTemplate };
|
|
3823
|
+
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, 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 };
|
package/dist/index.js
CHANGED
|
@@ -136,6 +136,7 @@ __export(index_exports, {
|
|
|
136
136
|
VoiceChannelMixin: () => VoiceChannelMixin,
|
|
137
137
|
VoiceRegion: () => VoiceRegion,
|
|
138
138
|
VoiceState: () => VoiceState,
|
|
139
|
+
Webhook: () => Webhook,
|
|
139
140
|
dateToDiscordISOTimestamp: () => dateToDiscordISOTimestamp,
|
|
140
141
|
extendTemplate: () => extendTemplate
|
|
141
142
|
});
|
|
@@ -4797,6 +4798,95 @@ var Connection = class extends Structure {
|
|
|
4797
4798
|
}
|
|
4798
4799
|
};
|
|
4799
4800
|
|
|
4801
|
+
// src/webhooks/Webhook.ts
|
|
4802
|
+
var import_snowflake11 = require("@sapphire/snowflake");
|
|
4803
|
+
var Webhook = class extends Structure {
|
|
4804
|
+
static {
|
|
4805
|
+
__name(this, "Webhook");
|
|
4806
|
+
}
|
|
4807
|
+
/**
|
|
4808
|
+
* The template used for removing data from the raw data stored for each webhook
|
|
4809
|
+
*/
|
|
4810
|
+
static DataTemplate = {};
|
|
4811
|
+
/**
|
|
4812
|
+
* @param data - The raw data received from the API for the webhook
|
|
4813
|
+
*/
|
|
4814
|
+
constructor(data) {
|
|
4815
|
+
super(data);
|
|
4816
|
+
}
|
|
4817
|
+
/**
|
|
4818
|
+
* The id of the webhook
|
|
4819
|
+
*/
|
|
4820
|
+
get id() {
|
|
4821
|
+
return this[kData].id;
|
|
4822
|
+
}
|
|
4823
|
+
/**
|
|
4824
|
+
* The type of the webhook
|
|
4825
|
+
*
|
|
4826
|
+
* @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types}
|
|
4827
|
+
*/
|
|
4828
|
+
get type() {
|
|
4829
|
+
return this[kData].type;
|
|
4830
|
+
}
|
|
4831
|
+
/**
|
|
4832
|
+
* The guild id this webhook is for, if any
|
|
4833
|
+
*/
|
|
4834
|
+
get guildId() {
|
|
4835
|
+
return this[kData].guild_id;
|
|
4836
|
+
}
|
|
4837
|
+
/**
|
|
4838
|
+
* The channel id this webhook is for, if any
|
|
4839
|
+
*/
|
|
4840
|
+
get channelId() {
|
|
4841
|
+
return this[kData].channel_id;
|
|
4842
|
+
}
|
|
4843
|
+
/**
|
|
4844
|
+
* The default name of the webhook
|
|
4845
|
+
*/
|
|
4846
|
+
get name() {
|
|
4847
|
+
return this[kData].name;
|
|
4848
|
+
}
|
|
4849
|
+
/**
|
|
4850
|
+
* The default user avatar hash of the webhook
|
|
4851
|
+
*
|
|
4852
|
+
* @see {@link https://discord.com/developers/docs/reference#image-formatting}
|
|
4853
|
+
*/
|
|
4854
|
+
get avatar() {
|
|
4855
|
+
return this[kData].avatar;
|
|
4856
|
+
}
|
|
4857
|
+
/**
|
|
4858
|
+
* The secure token of the webhook (returned for incoming webhooks)
|
|
4859
|
+
*/
|
|
4860
|
+
get token() {
|
|
4861
|
+
return this[kData].token;
|
|
4862
|
+
}
|
|
4863
|
+
/**
|
|
4864
|
+
* The id of the bot/OAuth2 application that created this webhook
|
|
4865
|
+
*/
|
|
4866
|
+
get applicationId() {
|
|
4867
|
+
return this[kData].application_id;
|
|
4868
|
+
}
|
|
4869
|
+
/**
|
|
4870
|
+
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
|
|
4871
|
+
*/
|
|
4872
|
+
get url() {
|
|
4873
|
+
return this[kData].url;
|
|
4874
|
+
}
|
|
4875
|
+
/**
|
|
4876
|
+
* The timestamp the webhook was created at
|
|
4877
|
+
*/
|
|
4878
|
+
get createdTimestamp() {
|
|
4879
|
+
return isIdSet(this.id) ? import_snowflake11.DiscordSnowflake.timestampFrom(this.id) : null;
|
|
4880
|
+
}
|
|
4881
|
+
/**
|
|
4882
|
+
* The time the webhook was created at
|
|
4883
|
+
*/
|
|
4884
|
+
get createdAt() {
|
|
4885
|
+
const createdTimestamp = this.createdTimestamp;
|
|
4886
|
+
return createdTimestamp ? new Date(createdTimestamp) : null;
|
|
4887
|
+
}
|
|
4888
|
+
};
|
|
4889
|
+
|
|
4800
4890
|
// src/voice/VoiceState.ts
|
|
4801
4891
|
var VoiceState = class extends Structure {
|
|
4802
4892
|
static {
|
|
@@ -4934,7 +5024,7 @@ var VoiceRegion = class extends Structure {
|
|
|
4934
5024
|
};
|
|
4935
5025
|
|
|
4936
5026
|
// src/subscriptions/Subscription.ts
|
|
4937
|
-
var
|
|
5027
|
+
var import_snowflake12 = require("@sapphire/snowflake");
|
|
4938
5028
|
var Subscription = class extends Structure {
|
|
4939
5029
|
static {
|
|
4940
5030
|
__name(this, "Subscription");
|
|
@@ -5066,7 +5156,7 @@ var Subscription = class extends Structure {
|
|
|
5066
5156
|
* The timestamp the subscription was created at
|
|
5067
5157
|
*/
|
|
5068
5158
|
get createdTimestamp() {
|
|
5069
|
-
return isIdSet(this.id) ?
|
|
5159
|
+
return isIdSet(this.id) ? import_snowflake12.DiscordSnowflake.timestampFrom(this.id) : null;
|
|
5070
5160
|
}
|
|
5071
5161
|
/**
|
|
5072
5162
|
* The time the subscription was created at
|
|
@@ -5193,6 +5283,7 @@ var Subscription = class extends Structure {
|
|
|
5193
5283
|
VoiceChannelMixin,
|
|
5194
5284
|
VoiceRegion,
|
|
5195
5285
|
VoiceState,
|
|
5286
|
+
Webhook,
|
|
5196
5287
|
dateToDiscordISOTimestamp,
|
|
5197
5288
|
extendTemplate
|
|
5198
5289
|
});
|