@wolfstar/plugin-gateway 0.6.0 → 0.7.0-next-20260928141845
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/README.md +29 -0
- package/dist/esm/index.d.ts +709 -8
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +964 -63
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { Client, ClientOptions, Listener } from "@wolfstar/http-framework";
|
|
|
2
2
|
import { OptionalWebSocketManagerOptions, ShardRange, WebSocketManager } from "@discordjs/ws";
|
|
3
3
|
import { API, Client as Client$1 } from "@discordjs/core";
|
|
4
4
|
import { Awaitable, Cache, CacheEntityName, CacheEntityTypes, CacheFactory, CachePolicies, EntityCache, GatewaySessionStore, IterableEntityCache } from "@wolfstar/plugin-cache";
|
|
5
|
-
import { APIAllowedMentions, APIApplication, APIApplicationCommand, APIAttachment, APIAuditLogChange, APIAutoModerationAction, APIAutoModerationRule, APIAutoModerationRuleTriggerMetadata, APIAvatarDecorationData, APIChannel, APIChannelMention, APICollectibles, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, APIEmoji, APIExtendedInvite, APIGuild, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIGuildMember, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, APIGuildPreview, APIGuildScheduledEvent, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEventRecurrenceRule, APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetMember, APIIncidentsData, APIInviteChannel, APIInviteGuild, APIMessage, APIMessageTopLevelComponent, APIOverwrite, APIPartialEmoji, APIPoll, APIPollAnswer, APIReaction, APIRole, APIRoleTags, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APITemplate, APIThreadChannel, APIThreadMember, APIUser, APIUserPrimaryGuild, APIVoiceRegion, APIWebhook, ActivityFlags, ActivityType, AllowedMentionsTypes, AttachmentFlags, AuditLogEvent, AutoModerationRuleEventType, AutoModerationRuleKeywordPresetType, AutoModerationRuleTriggerType, ChannelFlags, ChannelType, ForumLayoutType, GatewayActivity, GatewayActivityAssets, GatewayActivityUpdateData, GatewayAutoModerationActionExecutionDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayDispatchEvents, GatewayDispatchPayload, GatewayGuildDeleteDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildSoundboardSoundDeleteDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntentBits, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayPresenceClientStatus, GatewayPresenceUpdateData, GatewayRateLimitedDispatchData, GatewayReadyDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSync, GatewayThreadMembersUpdateDispatchData, GatewayTypingStartDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildMemberFlags, GuildOnboardingMode, GuildOnboardingPromptType, GuildPremiumTier, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventStatus, GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle, InviteTargetType, InviteType, Locale, MessageFlags, OverwriteType, PermissionFlagsBits, PollLayoutType, PresenceUpdateReceiveStatus, PresenceUpdateStatus, RESTAPIPoll, RESTGetAPIGuildVanityUrlResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIGuildsJSONBody, ReactionType, RoleFlags, Snowflake, SortOrderType, StageInstancePrivacyLevel, StickerFormatType, ThreadAutoArchiveDuration, ThreadChannelType, UserFlags, VideoQualityMode } from "discord-api-types/v10";
|
|
6
|
-
import { APIActualInvite, Activity as Activity$1, ActivityFlagsBitField as ActivityFlagsBitField$1, AnnouncementChannel as AnnouncementChannel$1, AnnouncementThreadChannel as AnnouncementThreadChannel$1, Attachment as Attachment$1, AttachmentFlagsBitField as AttachmentFlagsBitField$1, AutoModerationRule as AutoModerationRule$1, BitField, BitField as BitField$1, BitFieldResolvable, BitFieldResolvable as BitFieldResolvable$1, CategoryChannel as CategoryChannel$1, Channel as Channel$1, ChannelFlagsBitField as ChannelFlagsBitField$1, DMChannel as DMChannel$1, Embed as Embed$1, Emoji as Emoji$1, ForumChannel as ForumChannel$1, GroupDMChannel as GroupDMChannel$1, Invite, MediaChannel as MediaChannel$1, Message as Message$1, MessageFlagsBitField as MessageFlagsBitField$1, Partialize, PermissionsBitField, Poll as Poll$1, PollAnswer as PollAnswer$1, Presence as Presence$1, PrivateThreadChannel as PrivateThreadChannel$1, PublicThreadChannel as PublicThreadChannel$1, Reaction, SoundboardSound as SoundboardSound$1, StageChannel as StageChannel$1, StageInstance as StageInstance$1, Sticker as Sticker$1, StickerPack as StickerPack$1, Structure as Structure$1, TextChannel as TextChannel$1, User as User$1, VoiceChannel as VoiceChannel$1, VoiceState as VoiceState$1, Webhook as Webhook$1 } from "@discordjs/structures";
|
|
5
|
+
import { APIActionRowComponent, APIAllowedMentions, APIApplication, APIApplicationCommand, APIAttachment, APIAuditLogChange, APIAutoModerationAction, APIAutoModerationRule, APIAutoModerationRuleTriggerMetadata, APIAvatarDecorationData, APIButtonComponentWithCustomId, APIButtonComponentWithSKUId, APIButtonComponentWithURL, APIChannel, APIChannelMention, APIChannelSelectComponent, APICheckboxComponent, APICheckboxGroupComponent, APICheckboxGroupOption, APICollectibles, APIComponentInActionRow, APIContainerComponent, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, APIEmoji, APIExtendedInvite, APIFileComponent, APIFileUploadComponent, APIGuild, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIGuildMember, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, APIGuildPreview, APIGuildScheduledEvent, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEventRecurrenceRule, APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetMember, APIIncidentsData, APIInviteChannel, APIInviteGuild, APILabelComponent, APIMediaGalleryComponent, APIMediaGalleryItem, APIMentionableSelectComponent, APIMessage, APIMessageComponent, APIMessageComponentEmoji, APIMessageTopLevelComponent, APIModalComponent, APIOverwrite, APIPartialEmoji, APIPoll, APIPollAnswer, APIRadioGroupComponent, APIRadioGroupOption, APIReaction, APIRole, APIRoleSelectComponent, APIRoleTags, APISectionComponent, APISelectMenuDefaultValue, APISelectMenuOption, APISeparatorComponent, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APIStringSelectComponent, APITemplate, APITextDisplayComponent, APITextInputComponent, APIThreadChannel, APIThreadMember, APIThumbnailComponent, APIUnfurledMediaItem, APIUser, APIUserPrimaryGuild, APIUserSelectComponent, APIVoiceRegion, APIWebhook, ActivityFlags, ActivityType, AllowedMentionsTypes, AttachmentFlags, AuditLogEvent, AutoModerationRuleEventType, AutoModerationRuleKeywordPresetType, AutoModerationRuleTriggerType, ButtonStyle, ChannelFlags, ChannelType, FileUploadType, ForumLayoutType, GatewayActivity, GatewayActivityAssets, GatewayActivityUpdateData, GatewayAutoModerationActionExecutionDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayDispatchEvents, GatewayDispatchPayload, GatewayGuildDeleteDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildSoundboardSoundDeleteDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntentBits, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayPresenceClientStatus, GatewayPresenceUpdateData, GatewayRateLimitedDispatchData, GatewayReadyDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSync, GatewayThreadMembersUpdateDispatchData, GatewayTypingStartDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildMemberFlags, GuildOnboardingMode, GuildOnboardingPromptType, GuildPremiumTier, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventStatus, GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle, InviteTargetType, InviteType, Locale, MessageFlags, OverwriteType, PermissionFlagsBits, PollLayoutType, PresenceUpdateReceiveStatus, PresenceUpdateStatus, RESTAPIPoll, RESTGetAPIGuildVanityUrlResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIGuildsJSONBody, ReactionType, RoleFlags, SelectMenuDefaultValueType, SeparatorSpacingSize, Snowflake, SortOrderType, StageInstancePrivacyLevel, StickerFormatType, ThreadAutoArchiveDuration, ThreadChannelType, UserFlags, VideoQualityMode } from "discord-api-types/v10";
|
|
6
|
+
import { APIActualInvite, ActionRowComponent, Activity as Activity$1, ActivityFlagsBitField as ActivityFlagsBitField$1, AnnouncementChannel as AnnouncementChannel$1, AnnouncementThreadChannel as AnnouncementThreadChannel$1, Attachment as Attachment$1, AttachmentFlagsBitField as AttachmentFlagsBitField$1, AutoModerationRule as AutoModerationRule$1, BitField, BitField as BitField$1, BitFieldResolvable, BitFieldResolvable as BitFieldResolvable$1, CategoryChannel as CategoryChannel$1, Channel as Channel$1, ChannelFlagsBitField as ChannelFlagsBitField$1, ChannelSelectMenuComponent as ChannelSelectMenuComponent$1, Component as Component$1, ContainerComponent as ContainerComponent$1, DMChannel as DMChannel$1, Embed as Embed$1, Emoji as Emoji$1, FileComponent as FileComponent$1, FileUploadComponent as FileUploadComponent$1, ForumChannel as ForumChannel$1, GroupDMChannel as GroupDMChannel$1, InteractiveButtonComponent as InteractiveButtonComponent$1, Invite, LinkButtonComponent as LinkButtonComponent$1, MediaChannel as MediaChannel$1, MediaGalleryComponent as MediaGalleryComponent$1, MediaGalleryItem as MediaGalleryItem$1, MentionableSelectMenuComponent as MentionableSelectMenuComponent$1, Message as Message$1, MessageFlagsBitField as MessageFlagsBitField$1, Partialize, PermissionsBitField, Poll as Poll$1, PollAnswer as PollAnswer$1, PremiumButtonComponent as PremiumButtonComponent$1, Presence as Presence$1, PrivateThreadChannel as PrivateThreadChannel$1, PublicThreadChannel as PublicThreadChannel$1, Reaction, RoleSelectMenuComponent as RoleSelectMenuComponent$1, SectionComponent as SectionComponent$1, SeparatorComponent as SeparatorComponent$1, SoundboardSound as SoundboardSound$1, StageChannel as StageChannel$1, StageInstance as StageInstance$1, Sticker as Sticker$1, StickerPack as StickerPack$1, StringSelectMenuComponent as StringSelectMenuComponent$1, Structure as Structure$1, TextChannel as TextChannel$1, TextDisplayComponent as TextDisplayComponent$1, TextInputComponent as TextInputComponent$1, ThumbnailComponent as ThumbnailComponent$1, UnfurledMediaItem as UnfurledMediaItem$1, User as User$1, UserSelectMenuComponent as UserSelectMenuComponent$1, VoiceChannel as VoiceChannel$1, VoiceState as VoiceState$1, Webhook as Webhook$1 } from "@discordjs/structures";
|
|
7
7
|
import { BaseImageURLOptions, EmojiURLOptions, ImageURLOptions, REST, RawFile } from "@discordjs/rest";
|
|
8
8
|
//#region src/util/PermissionsBitField.d.ts
|
|
9
9
|
/**
|
|
@@ -3509,6 +3509,596 @@ export declare class ReactionManager {
|
|
|
3509
3509
|
removeAll(): Promise<void>;
|
|
3510
3510
|
}
|
|
3511
3511
|
//#endregion
|
|
3512
|
+
//#region src/structures/components/Component.d.ts
|
|
3513
|
+
/**
|
|
3514
|
+
* The raw data of any component, in a message or in a modal.
|
|
3515
|
+
*/
|
|
3516
|
+
export type APIAnyComponent = APIMessageComponent | APIModalComponent;
|
|
3517
|
+
/**
|
|
3518
|
+
* The members every component of this package shares, mixed into each of them.
|
|
3519
|
+
*/
|
|
3520
|
+
export declare class ComponentMixin {
|
|
3521
|
+
/**
|
|
3522
|
+
* Whether this component has the same data as another one, nested components included.
|
|
3523
|
+
*
|
|
3524
|
+
* @param other The component, or raw component data, to compare with.
|
|
3525
|
+
*/
|
|
3526
|
+
equals(other: Component | APIAnyComponent): boolean;
|
|
3527
|
+
}
|
|
3528
|
+
export interface Component<Data extends APIAnyComponent = APIAnyComponent> extends StructureMixin<Data>, ComponentMixin {}
|
|
3529
|
+
/**
|
|
3530
|
+
* A component of a message or a modal: `@discordjs/structures`' `Component`, like discord.js' `Component`.
|
|
3531
|
+
*
|
|
3532
|
+
* @remarks
|
|
3533
|
+
* Each component type has its own class, like `ActionRow` or `ButtonComponent`s, which `createComponent` picks for a raw
|
|
3534
|
+
* component. This class is only instantiated for the types it has no class for. Their raw data is kept as received,
|
|
3535
|
+
* nested components included, so `toJSON` serializes them back to the API.
|
|
3536
|
+
*
|
|
3537
|
+
* @typeParam Data The raw data of the component.
|
|
3538
|
+
*/
|
|
3539
|
+
export declare class Component<Data extends APIAnyComponent = APIAnyComponent> extends Component$1<Data, ""> {
|
|
3540
|
+
/**
|
|
3541
|
+
* Whether a value is a component of this package. Most components extend `@discordjs/structures`' own rather than
|
|
3542
|
+
* this class, so `instanceof Component` matches any `@discordjs/structures` component carrying
|
|
3543
|
+
* {@link StructureMixin}. Subclasses keep the default `instanceof` behavior.
|
|
3544
|
+
*
|
|
3545
|
+
* @param value The value to check.
|
|
3546
|
+
*/
|
|
3547
|
+
static [Symbol.hasInstance](value: unknown): boolean;
|
|
3548
|
+
/**
|
|
3549
|
+
* @param data The raw component.
|
|
3550
|
+
* @param relations The related structures, resolved from the cache.
|
|
3551
|
+
*/
|
|
3552
|
+
constructor(data: Data, relations?: object);
|
|
3553
|
+
}
|
|
3554
|
+
//#endregion
|
|
3555
|
+
//#region src/structures/components/ActionRow.d.ts
|
|
3556
|
+
export interface ActionRow<Child extends MessageActionRowComponent | ModalActionRowComponent = MessageActionRowComponent | ModalActionRowComponent> extends StructureMixin<APIActionRowComponent<APIComponentInActionRow>>, ComponentMixin {}
|
|
3557
|
+
/**
|
|
3558
|
+
* An action row, holding buttons, a select menu, or a text input: `@discordjs/structures`' `ActionRowComponent`, with
|
|
3559
|
+
* its components like discord.js' `ActionRow`.
|
|
3560
|
+
*
|
|
3561
|
+
* @typeParam Child The components of the row.
|
|
3562
|
+
*/
|
|
3563
|
+
export declare class ActionRow<Child extends MessageActionRowComponent | ModalActionRowComponent = MessageActionRowComponent | ModalActionRowComponent> extends ActionRowComponent<APIComponentInActionRow, ""> {
|
|
3564
|
+
/**
|
|
3565
|
+
* @param data The raw action row.
|
|
3566
|
+
* @param relations The related structures, resolved from the cache.
|
|
3567
|
+
*/
|
|
3568
|
+
constructor(data: APIActionRowComponent<APIComponentInActionRow>, relations?: object);
|
|
3569
|
+
/**
|
|
3570
|
+
* The components in this action row.
|
|
3571
|
+
*/
|
|
3572
|
+
get components(): Child[];
|
|
3573
|
+
}
|
|
3574
|
+
//#endregion
|
|
3575
|
+
//#region src/structures/components/ChannelSelectMenuComponent.d.ts
|
|
3576
|
+
export interface ChannelSelectMenuComponent extends StructureMixin<APIChannelSelectComponent>, ComponentMixin {}
|
|
3577
|
+
/**
|
|
3578
|
+
* A select menu of channels: `@discordjs/structures`' `ChannelSelectMenuComponent`, like discord.js'.
|
|
3579
|
+
*/
|
|
3580
|
+
export declare class ChannelSelectMenuComponent extends ChannelSelectMenuComponent$1<""> {
|
|
3581
|
+
/**
|
|
3582
|
+
* @param data The raw select menu.
|
|
3583
|
+
* @param relations The related structures, resolved from the cache.
|
|
3584
|
+
*/
|
|
3585
|
+
constructor(data: APIChannelSelectComponent, relations?: object);
|
|
3586
|
+
/**
|
|
3587
|
+
* Whether the select menu is disabled.
|
|
3588
|
+
*/
|
|
3589
|
+
get disabled(): boolean;
|
|
3590
|
+
/**
|
|
3591
|
+
* The values selected by default.
|
|
3592
|
+
*/
|
|
3593
|
+
get defaultValues(): readonly APISelectMenuDefaultValue<SelectMenuDefaultValueType>[];
|
|
3594
|
+
}
|
|
3595
|
+
//#endregion
|
|
3596
|
+
//#region src/structures/components/CheckboxComponent.d.ts
|
|
3597
|
+
/**
|
|
3598
|
+
* A modal component for a binary choice.
|
|
3599
|
+
*/
|
|
3600
|
+
export declare class CheckboxComponent extends Component<APICheckboxComponent> {
|
|
3601
|
+
/**
|
|
3602
|
+
* The custom ID of the checkbox.
|
|
3603
|
+
*/
|
|
3604
|
+
get customId(): string;
|
|
3605
|
+
/**
|
|
3606
|
+
* Whether the checkbox is checked by default.
|
|
3607
|
+
*/
|
|
3608
|
+
get default(): boolean;
|
|
3609
|
+
}
|
|
3610
|
+
//#endregion
|
|
3611
|
+
//#region src/structures/components/CheckboxGroupComponent.d.ts
|
|
3612
|
+
/**
|
|
3613
|
+
* A modal component to pick any of its options.
|
|
3614
|
+
*/
|
|
3615
|
+
export declare class CheckboxGroupComponent extends Component<APICheckboxGroupComponent> {
|
|
3616
|
+
/**
|
|
3617
|
+
* The custom ID of the checkbox group.
|
|
3618
|
+
*/
|
|
3619
|
+
get customId(): string;
|
|
3620
|
+
/**
|
|
3621
|
+
* The options of the checkbox group.
|
|
3622
|
+
*/
|
|
3623
|
+
get options(): readonly APICheckboxGroupOption[];
|
|
3624
|
+
/**
|
|
3625
|
+
* The minimum number of options to pick, `1` by default.
|
|
3626
|
+
*/
|
|
3627
|
+
get minValues(): number;
|
|
3628
|
+
/**
|
|
3629
|
+
* The maximum number of options to pick, the number of options by default.
|
|
3630
|
+
*/
|
|
3631
|
+
get maxValues(): number;
|
|
3632
|
+
/**
|
|
3633
|
+
* Whether picking options is required to submit the modal, `true` by default.
|
|
3634
|
+
*/
|
|
3635
|
+
get required(): boolean;
|
|
3636
|
+
}
|
|
3637
|
+
//#endregion
|
|
3638
|
+
//#region src/structures/components/ContainerComponent.d.ts
|
|
3639
|
+
export interface ContainerComponent extends StructureMixin<APIContainerComponent>, ComponentMixin {}
|
|
3640
|
+
/**
|
|
3641
|
+
* A container visually grouping components, like an embed: `@discordjs/structures`' `ContainerComponent`, with its
|
|
3642
|
+
* components like discord.js'.
|
|
3643
|
+
*/
|
|
3644
|
+
export declare class ContainerComponent extends ContainerComponent$1<""> {
|
|
3645
|
+
/**
|
|
3646
|
+
* @param data The raw container.
|
|
3647
|
+
* @param relations The related structures, resolved from the cache.
|
|
3648
|
+
*/
|
|
3649
|
+
constructor(data: APIContainerComponent, relations?: object);
|
|
3650
|
+
/**
|
|
3651
|
+
* The components in this container.
|
|
3652
|
+
*/
|
|
3653
|
+
get components(): ComponentInContainer[];
|
|
3654
|
+
/**
|
|
3655
|
+
* The accent color of the container, `null` when it has none.
|
|
3656
|
+
*/
|
|
3657
|
+
get accentColor(): number | null;
|
|
3658
|
+
/**
|
|
3659
|
+
* The accent color as a `#rrggbb` string, `null` when the container has none.
|
|
3660
|
+
*/
|
|
3661
|
+
get hexAccentColor(): `#${string}` | null;
|
|
3662
|
+
/**
|
|
3663
|
+
* Whether the container is marked as a spoiler.
|
|
3664
|
+
*/
|
|
3665
|
+
get spoiler(): boolean;
|
|
3666
|
+
}
|
|
3667
|
+
//#endregion
|
|
3668
|
+
//#region src/structures/components/UnfurledMediaItem.d.ts
|
|
3669
|
+
export interface UnfurledMediaItem extends StructureMixin<APIUnfurledMediaItem> {}
|
|
3670
|
+
/**
|
|
3671
|
+
* A media item of a thumbnail, file, or media gallery component: `@discordjs/structures`' `UnfurledMediaItem`, like
|
|
3672
|
+
* discord.js'.
|
|
3673
|
+
*/
|
|
3674
|
+
export declare class UnfurledMediaItem extends UnfurledMediaItem$1<""> {
|
|
3675
|
+
/**
|
|
3676
|
+
* @param data The raw media item.
|
|
3677
|
+
* @param relations The related structures, resolved from the cache.
|
|
3678
|
+
*/
|
|
3679
|
+
constructor(data: APIUnfurledMediaItem, relations?: object);
|
|
3680
|
+
}
|
|
3681
|
+
//#endregion
|
|
3682
|
+
//#region src/structures/components/FileComponent.d.ts
|
|
3683
|
+
export interface FileComponent extends StructureMixin<APIFileComponent>, ComponentMixin {}
|
|
3684
|
+
/**
|
|
3685
|
+
* An attached file: `@discordjs/structures`' `FileComponent`, with its media like discord.js'.
|
|
3686
|
+
*/
|
|
3687
|
+
export declare class FileComponent extends FileComponent$1<""> {
|
|
3688
|
+
/**
|
|
3689
|
+
* @param data The raw file component.
|
|
3690
|
+
* @param relations The related structures, resolved from the cache.
|
|
3691
|
+
*/
|
|
3692
|
+
constructor(data: APIFileComponent, relations?: object);
|
|
3693
|
+
/**
|
|
3694
|
+
* The file, an `attachment://` reference to an attachment of the message.
|
|
3695
|
+
*/
|
|
3696
|
+
get file(): UnfurledMediaItem;
|
|
3697
|
+
/**
|
|
3698
|
+
* Whether the file is marked as a spoiler.
|
|
3699
|
+
*/
|
|
3700
|
+
get spoiler(): boolean;
|
|
3701
|
+
}
|
|
3702
|
+
//#endregion
|
|
3703
|
+
//#region src/structures/components/FileUploadComponent.d.ts
|
|
3704
|
+
export interface FileUploadComponent extends StructureMixin<APIFileUploadComponent>, ComponentMixin {}
|
|
3705
|
+
/**
|
|
3706
|
+
* A file upload field of a modal: `@discordjs/structures`' `FileUploadComponent`, like discord.js'.
|
|
3707
|
+
*/
|
|
3708
|
+
export declare class FileUploadComponent extends FileUploadComponent$1<""> {
|
|
3709
|
+
/**
|
|
3710
|
+
* @param data The raw file upload.
|
|
3711
|
+
* @param relations The related structures, resolved from the cache.
|
|
3712
|
+
*/
|
|
3713
|
+
constructor(data: APIFileUploadComponent, relations?: object);
|
|
3714
|
+
/**
|
|
3715
|
+
* The types of files that can be uploaded, any when empty.
|
|
3716
|
+
*/
|
|
3717
|
+
get fileTypes(): readonly FileUploadType[];
|
|
3718
|
+
}
|
|
3719
|
+
//#endregion
|
|
3720
|
+
//#region src/structures/components/InteractiveButtonComponent.d.ts
|
|
3721
|
+
export interface InteractiveButtonComponent extends StructureMixin<APIButtonComponentWithCustomId>, ComponentMixin {}
|
|
3722
|
+
/**
|
|
3723
|
+
* A button sending an interaction when clicked, of the `Primary`, `Secondary`, `Success`, or `Danger` style:
|
|
3724
|
+
* `@discordjs/structures`' `InteractiveButtonComponent`, with discord.js' `ButtonComponent` helpers.
|
|
3725
|
+
*/
|
|
3726
|
+
export declare class InteractiveButtonComponent extends InteractiveButtonComponent$1<ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success, ""> {
|
|
3727
|
+
/**
|
|
3728
|
+
* @param data The raw button.
|
|
3729
|
+
* @param relations The related structures, resolved from the cache.
|
|
3730
|
+
*/
|
|
3731
|
+
constructor(data: APIButtonComponentWithCustomId, relations?: object);
|
|
3732
|
+
/**
|
|
3733
|
+
* Whether the button is disabled.
|
|
3734
|
+
*/
|
|
3735
|
+
get disabled(): boolean;
|
|
3736
|
+
/**
|
|
3737
|
+
* The emoji on the button.
|
|
3738
|
+
*/
|
|
3739
|
+
get emoji(): APIMessageComponentEmoji | null;
|
|
3740
|
+
}
|
|
3741
|
+
//#endregion
|
|
3742
|
+
//#region src/structures/components/LabelComponent.d.ts
|
|
3743
|
+
/**
|
|
3744
|
+
* A modal component associating a label and a description with another component, like discord.js' `LabelComponent`.
|
|
3745
|
+
*/
|
|
3746
|
+
export declare class LabelComponent extends Component<APILabelComponent> {
|
|
3747
|
+
/**
|
|
3748
|
+
* The label.
|
|
3749
|
+
*/
|
|
3750
|
+
get label(): string;
|
|
3751
|
+
/**
|
|
3752
|
+
* The description of the label.
|
|
3753
|
+
*/
|
|
3754
|
+
get description(): string | null;
|
|
3755
|
+
/**
|
|
3756
|
+
* The component the label is for.
|
|
3757
|
+
*/
|
|
3758
|
+
get component(): ComponentInLabel;
|
|
3759
|
+
}
|
|
3760
|
+
//#endregion
|
|
3761
|
+
//#region src/structures/components/LinkButtonComponent.d.ts
|
|
3762
|
+
export interface LinkButtonComponent extends StructureMixin<APIButtonComponentWithURL>, ComponentMixin {}
|
|
3763
|
+
/**
|
|
3764
|
+
* A button of the `Link` style, opening a URL: `@discordjs/structures`' `LinkButtonComponent`, with discord.js'
|
|
3765
|
+
* `ButtonComponent` helpers.
|
|
3766
|
+
*/
|
|
3767
|
+
export declare class LinkButtonComponent extends LinkButtonComponent$1<""> {
|
|
3768
|
+
/**
|
|
3769
|
+
* @param data The raw button.
|
|
3770
|
+
* @param relations The related structures, resolved from the cache.
|
|
3771
|
+
*/
|
|
3772
|
+
constructor(data: APIButtonComponentWithURL, relations?: object);
|
|
3773
|
+
/**
|
|
3774
|
+
* Whether the button is disabled.
|
|
3775
|
+
*/
|
|
3776
|
+
get disabled(): boolean;
|
|
3777
|
+
/**
|
|
3778
|
+
* The emoji on the button.
|
|
3779
|
+
*/
|
|
3780
|
+
get emoji(): APIMessageComponentEmoji | null;
|
|
3781
|
+
}
|
|
3782
|
+
//#endregion
|
|
3783
|
+
//#region src/structures/components/MediaGalleryItem.d.ts
|
|
3784
|
+
export interface MediaGalleryItem extends StructureMixin<APIMediaGalleryItem> {}
|
|
3785
|
+
/**
|
|
3786
|
+
* An item of a media gallery component: `@discordjs/structures`' `MediaGalleryItem`, with its media like discord.js'.
|
|
3787
|
+
*/
|
|
3788
|
+
export declare class MediaGalleryItem extends MediaGalleryItem$1<""> {
|
|
3789
|
+
/**
|
|
3790
|
+
* @param data The raw media gallery item.
|
|
3791
|
+
* @param relations The related structures, resolved from the cache.
|
|
3792
|
+
*/
|
|
3793
|
+
constructor(data: APIMediaGalleryItem, relations?: object);
|
|
3794
|
+
/**
|
|
3795
|
+
* The media of the item.
|
|
3796
|
+
*/
|
|
3797
|
+
get media(): UnfurledMediaItem;
|
|
3798
|
+
/**
|
|
3799
|
+
* The description of the item.
|
|
3800
|
+
*/
|
|
3801
|
+
get description(): string | undefined;
|
|
3802
|
+
/**
|
|
3803
|
+
* Whether the item is marked as a spoiler.
|
|
3804
|
+
*/
|
|
3805
|
+
get spoiler(): boolean;
|
|
3806
|
+
}
|
|
3807
|
+
//#endregion
|
|
3808
|
+
//#region src/structures/components/MediaGalleryComponent.d.ts
|
|
3809
|
+
export interface MediaGalleryComponent extends StructureMixin<APIMediaGalleryComponent>, ComponentMixin {}
|
|
3810
|
+
/**
|
|
3811
|
+
* A gallery of images and videos: `@discordjs/structures`' `MediaGalleryComponent`, with its items like discord.js'.
|
|
3812
|
+
*/
|
|
3813
|
+
export declare class MediaGalleryComponent extends MediaGalleryComponent$1<""> {
|
|
3814
|
+
/**
|
|
3815
|
+
* @param data The raw media gallery.
|
|
3816
|
+
* @param relations The related structures, resolved from the cache.
|
|
3817
|
+
*/
|
|
3818
|
+
constructor(data: APIMediaGalleryComponent, relations?: object);
|
|
3819
|
+
/**
|
|
3820
|
+
* The items of the gallery.
|
|
3821
|
+
*/
|
|
3822
|
+
get items(): MediaGalleryItem[];
|
|
3823
|
+
}
|
|
3824
|
+
//#endregion
|
|
3825
|
+
//#region src/structures/components/MentionableSelectMenuComponent.d.ts
|
|
3826
|
+
export interface MentionableSelectMenuComponent extends StructureMixin<APIMentionableSelectComponent>, ComponentMixin {}
|
|
3827
|
+
/**
|
|
3828
|
+
* A select menu of users and roles: `@discordjs/structures`' `MentionableSelectMenuComponent`, like discord.js'.
|
|
3829
|
+
*/
|
|
3830
|
+
export declare class MentionableSelectMenuComponent extends MentionableSelectMenuComponent$1<""> {
|
|
3831
|
+
/**
|
|
3832
|
+
* @param data The raw select menu.
|
|
3833
|
+
* @param relations The related structures, resolved from the cache.
|
|
3834
|
+
*/
|
|
3835
|
+
constructor(data: APIMentionableSelectComponent, relations?: object);
|
|
3836
|
+
/**
|
|
3837
|
+
* Whether the select menu is disabled.
|
|
3838
|
+
*/
|
|
3839
|
+
get disabled(): boolean;
|
|
3840
|
+
/**
|
|
3841
|
+
* The values selected by default.
|
|
3842
|
+
*/
|
|
3843
|
+
get defaultValues(): readonly APISelectMenuDefaultValue<SelectMenuDefaultValueType>[];
|
|
3844
|
+
}
|
|
3845
|
+
//#endregion
|
|
3846
|
+
//#region src/structures/components/PremiumButtonComponent.d.ts
|
|
3847
|
+
export interface PremiumButtonComponent extends StructureMixin<APIButtonComponentWithSKUId>, ComponentMixin {}
|
|
3848
|
+
/**
|
|
3849
|
+
* A button of the `Premium` style, purchasing a SKU: `@discordjs/structures`' `PremiumButtonComponent`.
|
|
3850
|
+
*/
|
|
3851
|
+
export declare class PremiumButtonComponent extends PremiumButtonComponent$1<""> {
|
|
3852
|
+
/**
|
|
3853
|
+
* @param data The raw button.
|
|
3854
|
+
* @param relations The related structures, resolved from the cache.
|
|
3855
|
+
*/
|
|
3856
|
+
constructor(data: APIButtonComponentWithSKUId, relations?: object);
|
|
3857
|
+
/**
|
|
3858
|
+
* Whether the button is disabled.
|
|
3859
|
+
*/
|
|
3860
|
+
get disabled(): boolean;
|
|
3861
|
+
}
|
|
3862
|
+
//#endregion
|
|
3863
|
+
//#region src/structures/components/RadioGroupComponent.d.ts
|
|
3864
|
+
/**
|
|
3865
|
+
* A modal component to pick one of its options.
|
|
3866
|
+
*/
|
|
3867
|
+
export declare class RadioGroupComponent extends Component<APIRadioGroupComponent> {
|
|
3868
|
+
/**
|
|
3869
|
+
* The custom ID of the radio group.
|
|
3870
|
+
*/
|
|
3871
|
+
get customId(): string;
|
|
3872
|
+
/**
|
|
3873
|
+
* The options of the radio group.
|
|
3874
|
+
*/
|
|
3875
|
+
get options(): readonly APIRadioGroupOption[];
|
|
3876
|
+
/**
|
|
3877
|
+
* Whether picking an option is required to submit the modal, `true` by default.
|
|
3878
|
+
*/
|
|
3879
|
+
get required(): boolean;
|
|
3880
|
+
}
|
|
3881
|
+
//#endregion
|
|
3882
|
+
//#region src/structures/components/RoleSelectMenuComponent.d.ts
|
|
3883
|
+
export interface RoleSelectMenuComponent extends StructureMixin<APIRoleSelectComponent>, ComponentMixin {}
|
|
3884
|
+
/**
|
|
3885
|
+
* A select menu of roles: `@discordjs/structures`' `RoleSelectMenuComponent`, like discord.js'.
|
|
3886
|
+
*/
|
|
3887
|
+
export declare class RoleSelectMenuComponent extends RoleSelectMenuComponent$1<""> {
|
|
3888
|
+
/**
|
|
3889
|
+
* @param data The raw select menu.
|
|
3890
|
+
* @param relations The related structures, resolved from the cache.
|
|
3891
|
+
*/
|
|
3892
|
+
constructor(data: APIRoleSelectComponent, relations?: object);
|
|
3893
|
+
/**
|
|
3894
|
+
* Whether the select menu is disabled.
|
|
3895
|
+
*/
|
|
3896
|
+
get disabled(): boolean;
|
|
3897
|
+
/**
|
|
3898
|
+
* The values selected by default.
|
|
3899
|
+
*/
|
|
3900
|
+
get defaultValues(): readonly APISelectMenuDefaultValue<SelectMenuDefaultValueType>[];
|
|
3901
|
+
}
|
|
3902
|
+
//#endregion
|
|
3903
|
+
//#region src/structures/components/ThumbnailComponent.d.ts
|
|
3904
|
+
export interface ThumbnailComponent extends StructureMixin<APIThumbnailComponent>, ComponentMixin {}
|
|
3905
|
+
/**
|
|
3906
|
+
* A small image, used as the accessory of a section: `@discordjs/structures`' `ThumbnailComponent`, with its media like
|
|
3907
|
+
* discord.js'.
|
|
3908
|
+
*/
|
|
3909
|
+
export declare class ThumbnailComponent extends ThumbnailComponent$1<""> {
|
|
3910
|
+
/**
|
|
3911
|
+
* @param data The raw thumbnail.
|
|
3912
|
+
* @param relations The related structures, resolved from the cache.
|
|
3913
|
+
*/
|
|
3914
|
+
constructor(data: APIThumbnailComponent, relations?: object);
|
|
3915
|
+
/**
|
|
3916
|
+
* The media of the thumbnail.
|
|
3917
|
+
*/
|
|
3918
|
+
get media(): UnfurledMediaItem;
|
|
3919
|
+
/**
|
|
3920
|
+
* The description of the thumbnail.
|
|
3921
|
+
*/
|
|
3922
|
+
get description(): string | undefined;
|
|
3923
|
+
/**
|
|
3924
|
+
* Whether the thumbnail is marked as a spoiler.
|
|
3925
|
+
*/
|
|
3926
|
+
get spoiler(): boolean;
|
|
3927
|
+
}
|
|
3928
|
+
//#endregion
|
|
3929
|
+
//#region src/structures/components/SectionComponent.d.ts
|
|
3930
|
+
export interface SectionComponent extends StructureMixin<APISectionComponent>, ComponentMixin {}
|
|
3931
|
+
/**
|
|
3932
|
+
* Text displayed alongside an accessory: `@discordjs/structures`' `SectionComponent`, with its components and accessory
|
|
3933
|
+
* like discord.js'.
|
|
3934
|
+
*/
|
|
3935
|
+
export declare class SectionComponent extends SectionComponent$1<""> {
|
|
3936
|
+
/**
|
|
3937
|
+
* @param data The raw section.
|
|
3938
|
+
* @param relations The related structures, resolved from the cache.
|
|
3939
|
+
*/
|
|
3940
|
+
constructor(data: APISectionComponent, relations?: object);
|
|
3941
|
+
/**
|
|
3942
|
+
* The text components in this section.
|
|
3943
|
+
*/
|
|
3944
|
+
get components(): ComponentInSection[];
|
|
3945
|
+
/**
|
|
3946
|
+
* The button or thumbnail shown next to the section.
|
|
3947
|
+
*/
|
|
3948
|
+
get accessory(): ButtonComponent | ThumbnailComponent;
|
|
3949
|
+
}
|
|
3950
|
+
//#endregion
|
|
3951
|
+
//#region src/structures/components/SeparatorComponent.d.ts
|
|
3952
|
+
export interface SeparatorComponent extends StructureMixin<APISeparatorComponent>, ComponentMixin {}
|
|
3953
|
+
/**
|
|
3954
|
+
* Vertical padding between components: `@discordjs/structures`' `SeparatorComponent`, with Discord's defaults like
|
|
3955
|
+
* discord.js'.
|
|
3956
|
+
*/
|
|
3957
|
+
export declare class SeparatorComponent extends SeparatorComponent$1<""> {
|
|
3958
|
+
/**
|
|
3959
|
+
* @param data The raw separator.
|
|
3960
|
+
* @param relations The related structures, resolved from the cache.
|
|
3961
|
+
*/
|
|
3962
|
+
constructor(data: APISeparatorComponent, relations?: object);
|
|
3963
|
+
/**
|
|
3964
|
+
* The size of the padding, `Small` by default.
|
|
3965
|
+
*/
|
|
3966
|
+
get spacing(): SeparatorSpacingSize;
|
|
3967
|
+
/**
|
|
3968
|
+
* Whether a divider line is shown, `true` by default.
|
|
3969
|
+
*/
|
|
3970
|
+
get divider(): boolean;
|
|
3971
|
+
}
|
|
3972
|
+
//#endregion
|
|
3973
|
+
//#region src/structures/components/StringSelectMenuComponent.d.ts
|
|
3974
|
+
export interface StringSelectMenuComponent extends StructureMixin<APIStringSelectComponent>, ComponentMixin {}
|
|
3975
|
+
/**
|
|
3976
|
+
* A select menu of predefined text options: `@discordjs/structures`' `StringSelectMenuComponent`, like discord.js'.
|
|
3977
|
+
*/
|
|
3978
|
+
export declare class StringSelectMenuComponent extends StringSelectMenuComponent$1<""> {
|
|
3979
|
+
/**
|
|
3980
|
+
* @param data The raw select menu.
|
|
3981
|
+
* @param relations The related structures, resolved from the cache.
|
|
3982
|
+
*/
|
|
3983
|
+
constructor(data: APIStringSelectComponent, relations?: object);
|
|
3984
|
+
/**
|
|
3985
|
+
* Whether the select menu is disabled.
|
|
3986
|
+
*/
|
|
3987
|
+
get disabled(): boolean;
|
|
3988
|
+
/**
|
|
3989
|
+
* The options of the select menu.
|
|
3990
|
+
*/
|
|
3991
|
+
get options(): readonly APISelectMenuOption[];
|
|
3992
|
+
}
|
|
3993
|
+
//#endregion
|
|
3994
|
+
//#region src/structures/components/TextDisplayComponent.d.ts
|
|
3995
|
+
export interface TextDisplayComponent extends StructureMixin<APITextDisplayComponent>, ComponentMixin {}
|
|
3996
|
+
/**
|
|
3997
|
+
* Markdown text: `@discordjs/structures`' `TextDisplayComponent`, like discord.js'.
|
|
3998
|
+
*/
|
|
3999
|
+
export declare class TextDisplayComponent extends TextDisplayComponent$1<""> {
|
|
4000
|
+
/**
|
|
4001
|
+
* @param data The raw text display.
|
|
4002
|
+
* @param relations The related structures, resolved from the cache.
|
|
4003
|
+
*/
|
|
4004
|
+
constructor(data: APITextDisplayComponent, relations?: object);
|
|
4005
|
+
}
|
|
4006
|
+
//#endregion
|
|
4007
|
+
//#region src/structures/components/TextInputComponent.d.ts
|
|
4008
|
+
export interface TextInputComponent extends StructureMixin<APITextInputComponent>, ComponentMixin {}
|
|
4009
|
+
/**
|
|
4010
|
+
* A text field of a modal: `@discordjs/structures`' `TextInputComponent`, like discord.js'.
|
|
4011
|
+
*/
|
|
4012
|
+
export declare class TextInputComponent extends TextInputComponent$1<""> {
|
|
4013
|
+
/**
|
|
4014
|
+
* @param data The raw text input.
|
|
4015
|
+
* @param relations The related structures, resolved from the cache.
|
|
4016
|
+
*/
|
|
4017
|
+
constructor(data: APITextInputComponent, relations?: object);
|
|
4018
|
+
}
|
|
4019
|
+
//#endregion
|
|
4020
|
+
//#region src/structures/components/UserSelectMenuComponent.d.ts
|
|
4021
|
+
export interface UserSelectMenuComponent extends StructureMixin<APIUserSelectComponent>, ComponentMixin {}
|
|
4022
|
+
/**
|
|
4023
|
+
* A select menu of users: `@discordjs/structures`' `UserSelectMenuComponent`, like discord.js'.
|
|
4024
|
+
*/
|
|
4025
|
+
export declare class UserSelectMenuComponent extends UserSelectMenuComponent$1<""> {
|
|
4026
|
+
/**
|
|
4027
|
+
* @param data The raw select menu.
|
|
4028
|
+
* @param relations The related structures, resolved from the cache.
|
|
4029
|
+
*/
|
|
4030
|
+
constructor(data: APIUserSelectComponent, relations?: object);
|
|
4031
|
+
/**
|
|
4032
|
+
* Whether the select menu is disabled.
|
|
4033
|
+
*/
|
|
4034
|
+
get disabled(): boolean;
|
|
4035
|
+
/**
|
|
4036
|
+
* The values selected by default.
|
|
4037
|
+
*/
|
|
4038
|
+
get defaultValues(): readonly APISelectMenuDefaultValue<SelectMenuDefaultValueType>[];
|
|
4039
|
+
}
|
|
4040
|
+
//#endregion
|
|
4041
|
+
//#region src/util/components.d.ts
|
|
4042
|
+
/**
|
|
4043
|
+
* A button, of any style.
|
|
4044
|
+
*/
|
|
4045
|
+
export type ButtonComponent = InteractiveButtonComponent | LinkButtonComponent | PremiumButtonComponent;
|
|
4046
|
+
/**
|
|
4047
|
+
* A select menu, of any type.
|
|
4048
|
+
*/
|
|
4049
|
+
export type SelectMenuComponent = ChannelSelectMenuComponent | MentionableSelectMenuComponent | RoleSelectMenuComponent | StringSelectMenuComponent | UserSelectMenuComponent;
|
|
4050
|
+
/**
|
|
4051
|
+
* A component of a message's action row.
|
|
4052
|
+
*/
|
|
4053
|
+
export type MessageActionRowComponent = ButtonComponent | SelectMenuComponent;
|
|
4054
|
+
/**
|
|
4055
|
+
* A component of a modal's action row.
|
|
4056
|
+
*/
|
|
4057
|
+
export type ModalActionRowComponent = TextInputComponent;
|
|
4058
|
+
/**
|
|
4059
|
+
* A component of a section.
|
|
4060
|
+
*/
|
|
4061
|
+
export type ComponentInSection = TextDisplayComponent;
|
|
4062
|
+
/**
|
|
4063
|
+
* A component of a container.
|
|
4064
|
+
*/
|
|
4065
|
+
export type ComponentInContainer = ActionRow<MessageActionRowComponent> | FileComponent | MediaGalleryComponent | SectionComponent | SeparatorComponent | TextDisplayComponent;
|
|
4066
|
+
/**
|
|
4067
|
+
* A top-level component of a message.
|
|
4068
|
+
*/
|
|
4069
|
+
export type MessageTopLevelComponent = ComponentInContainer | ContainerComponent;
|
|
4070
|
+
/**
|
|
4071
|
+
* A component of a label.
|
|
4072
|
+
*/
|
|
4073
|
+
export type ComponentInLabel = CheckboxComponent | CheckboxGroupComponent | FileUploadComponent | RadioGroupComponent | SelectMenuComponent | TextInputComponent;
|
|
4074
|
+
/**
|
|
4075
|
+
* The component {@link createComponent} builds for some raw component data, {@link Component} for the types this
|
|
4076
|
+
* package has no class for.
|
|
4077
|
+
*
|
|
4078
|
+
* @typeParam Data The raw component data.
|
|
4079
|
+
*/
|
|
4080
|
+
export type ComponentOf<Data extends APIAnyComponent> = Data extends APIActionRowComponent<infer Child> ? ActionRow<Extract<ComponentOf<Child>, MessageActionRowComponent | ModalActionRowComponent>> : Data extends APIButtonComponentWithCustomId ? InteractiveButtonComponent : Data extends APIButtonComponentWithURL ? LinkButtonComponent : Data extends APIButtonComponentWithSKUId ? PremiumButtonComponent : Data extends APIStringSelectComponent ? StringSelectMenuComponent : Data extends APIUserSelectComponent ? UserSelectMenuComponent : Data extends APIRoleSelectComponent ? RoleSelectMenuComponent : Data extends APIMentionableSelectComponent ? MentionableSelectMenuComponent : Data extends APIChannelSelectComponent ? ChannelSelectMenuComponent : Data extends APITextInputComponent ? TextInputComponent : Data extends APISectionComponent ? SectionComponent : Data extends APITextDisplayComponent ? TextDisplayComponent : Data extends APIThumbnailComponent ? ThumbnailComponent : Data extends APIMediaGalleryComponent ? MediaGalleryComponent : Data extends APIFileComponent ? FileComponent : Data extends APISeparatorComponent ? SeparatorComponent : Data extends APIContainerComponent ? ContainerComponent : Data extends APILabelComponent ? LabelComponent : Data extends APIFileUploadComponent ? FileUploadComponent : Data extends APIRadioGroupComponent ? RadioGroupComponent : Data extends APICheckboxGroupComponent ? CheckboxGroupComponent : Data extends APICheckboxComponent ? CheckboxComponent : Component;
|
|
4081
|
+
/**
|
|
4082
|
+
* Any component of this package.
|
|
4083
|
+
*/
|
|
4084
|
+
export type AnyComponent = ComponentOf<APIAnyComponent>;
|
|
4085
|
+
/**
|
|
4086
|
+
* Builds the component class matching some raw component data, like discord.js' `createComponent`: an `ActionRow` for
|
|
4087
|
+
* an action row, a `LinkButtonComponent` for a link button, and so on. Nested components are built too, when accessed.
|
|
4088
|
+
*
|
|
4089
|
+
* @param data The raw component data, or a component, which is returned as is.
|
|
4090
|
+
* @returns The component.
|
|
4091
|
+
*/
|
|
4092
|
+
export declare function createComponent<Data extends APIAnyComponent>(data: Data | ComponentOf<Data>): ComponentOf<Data>;
|
|
4093
|
+
/**
|
|
4094
|
+
* Finds a component by its custom ID in a component tree, like discord.js' `findComponentByCustomId`.
|
|
4095
|
+
*
|
|
4096
|
+
* @param components The components, or raw component data, to search in, like a message's top-level components.
|
|
4097
|
+
* @param customId The custom ID.
|
|
4098
|
+
* @returns The component, as given, `null` when none has the custom ID.
|
|
4099
|
+
*/
|
|
4100
|
+
export declare function findComponentByCustomId(components: readonly (AnyComponent | APIAnyComponent)[], customId: string): AnyComponent | APIAnyComponent | null;
|
|
4101
|
+
//#endregion
|
|
3512
4102
|
//#region src/structures/messages/Attachment.d.ts
|
|
3513
4103
|
export interface Attachment extends StructureMixin<APIAttachment> {}
|
|
3514
4104
|
/**
|
|
@@ -3955,9 +4545,10 @@ export declare class Message extends Message$1<""> {
|
|
|
3955
4545
|
get attachments(): Attachment[];
|
|
3956
4546
|
get embeds(): Embed[];
|
|
3957
4547
|
/**
|
|
3958
|
-
* The
|
|
4548
|
+
* The top-level components of the message, like discord.js'. Their `toJSON` returns the raw components; build new
|
|
4549
|
+
* ones with `@discordjs/builders`.
|
|
3959
4550
|
*/
|
|
3960
|
-
get components():
|
|
4551
|
+
get components(): MessageTopLevelComponent[];
|
|
3961
4552
|
/**
|
|
3962
4553
|
* The raw sticker items of the message; fetch a full sticker with `client.fetchSticker(id)`.
|
|
3963
4554
|
*/
|
|
@@ -8830,6 +9421,116 @@ export declare namespace EventGatewayListener {
|
|
|
8830
9421
|
}
|
|
8831
9422
|
}
|
|
8832
9423
|
//#endregion
|
|
9424
|
+
//#region src/errors/Messages.d.ts
|
|
9425
|
+
/**
|
|
9426
|
+
* The message of every {@link GatewayErrorCode}: a string, or a function formatting the arguments passed to the
|
|
9427
|
+
* error's constructor.
|
|
9428
|
+
*/
|
|
9429
|
+
export declare const GatewayErrorMessages: {
|
|
9430
|
+
readonly ClientSessionStoreConflict: "sessionStore replaces gateway.retrieveSessionInfo and gateway.updateSessionInfo, pass one or the other";
|
|
9431
|
+
readonly ClientNotConstructed: "No GatewayClient has been constructed yet";
|
|
9432
|
+
readonly DispatchHandlerConflict: (event: string) => string;
|
|
9433
|
+
readonly DispatchTimeout: (type: string, shardId: number, partition: string | null, timeout: number) => string;
|
|
9434
|
+
readonly SessionStoreFailed: (operation: "get" | "set", shardId: number) => string;
|
|
9435
|
+
readonly SessionStoreTimeout: (timeout: number) => string;
|
|
9436
|
+
readonly CacheAsynchronous: (entity: string) => string;
|
|
9437
|
+
readonly CacheRelationsAsynchronous: (entity: string) => string;
|
|
9438
|
+
readonly CacheNotIterable: (entity: string) => string;
|
|
9439
|
+
readonly CacheKeyUnresolvable: (entity: string, reason: string) => string;
|
|
9440
|
+
readonly IdUnresolvable: "Cannot resolve an ID from a structure without one";
|
|
9441
|
+
readonly ChannelGuildUnknown: (channelId: string) => string;
|
|
9442
|
+
readonly ChannelTypeChanged: (channelId: string, from: number, to: number) => string;
|
|
9443
|
+
readonly ChannelLockPermissionsConflict: "Pass either lockPermissions or permissionOverwrites, not both";
|
|
9444
|
+
readonly GuildChannelOrphan: (channelId: string) => string;
|
|
9445
|
+
readonly ThreadParentUnknown: (threadId: string) => string;
|
|
9446
|
+
readonly ThreadOwnerUnknown: (threadId: string) => string;
|
|
9447
|
+
readonly ThreadMemberIdsMissing: (action: string) => string;
|
|
9448
|
+
readonly GuildIntegrationNotFound: (guildId: string, integrationId: string) => string;
|
|
9449
|
+
readonly GuildMemberUserUnknown: "This member has no user data: its ID is unknown";
|
|
9450
|
+
readonly GuildMembersQueryConflict: "Cannot request members by both query and userIds";
|
|
9451
|
+
readonly GuildMembersUserIdsLimit: "Cannot request more than 100 members by their IDs";
|
|
9452
|
+
readonly MemberFetchNonceLength: "The nonce of a members request cannot exceed 32 bytes";
|
|
9453
|
+
readonly GuildMembersNoncePending: (nonce: string) => string;
|
|
9454
|
+
readonly GuildMembersTimeout: (guildId: string, nonce: string, timeout: number) => string;
|
|
9455
|
+
readonly GuildMembersRateLimited: (guildId: string, nonce: string, retryAfter: number) => string;
|
|
9456
|
+
readonly PresenceNotFetchable: (guildId: string, userId: string) => string;
|
|
9457
|
+
readonly InviteGuildUnknown: (code: string) => string;
|
|
9458
|
+
readonly EmojiEmpty: "Cannot resolve an empty string to an emoji";
|
|
9459
|
+
readonly EmojiType: "Cannot resolve an emoji without an ID nor a name";
|
|
9460
|
+
readonly NotGuildSticker: "Only guild stickers can be edited or deleted";
|
|
9461
|
+
readonly NotGuildSoundboardSound: "Default soundboard sounds cannot be changed";
|
|
9462
|
+
readonly MessageContentType: "The content of a message must be a string";
|
|
9463
|
+
readonly MessageNonceLength: "A message nonce must be at most 25 characters long";
|
|
9464
|
+
readonly MessageNonceType: "A message nonce must be an integer";
|
|
9465
|
+
readonly MessageForwardChannelMissing: "Forwarding a message by ID needs its channel";
|
|
9466
|
+
readonly MessageReferenceMissing: (messageId: string) => string;
|
|
9467
|
+
readonly MessagePollMissing: (messageId: string) => string;
|
|
9468
|
+
readonly AttachmentDownloadFailed: (url: string, status: number) => string;
|
|
9469
|
+
readonly VoiceStateNotOwn: "Only the bot's own voice state can request to speak";
|
|
9470
|
+
readonly VoiceStateGuildUnknown: "This voice state does not belong to a guild";
|
|
9471
|
+
readonly WebhookTokenUnavailable: (webhookId: string) => string;
|
|
9472
|
+
};
|
|
9473
|
+
//#endregion
|
|
9474
|
+
//#region src/errors/ErrorCodes.d.ts
|
|
9475
|
+
/**
|
|
9476
|
+
* The code of an error thrown by this package, set as its `code`.
|
|
9477
|
+
*/
|
|
9478
|
+
export type GatewayErrorCode = keyof typeof GatewayErrorMessages;
|
|
9479
|
+
/**
|
|
9480
|
+
* Every {@link GatewayErrorCode}, keyed by itself, like discord.js's `DiscordjsErrorCodes`.
|
|
9481
|
+
*
|
|
9482
|
+
* @example
|
|
9483
|
+
* ```typescript
|
|
9484
|
+
* try {
|
|
9485
|
+
* await webhook.send("Awoo");
|
|
9486
|
+
* } catch (error) {
|
|
9487
|
+
* if (error instanceof GatewayError && error.code === GatewayErrorCodes.WebhookTokenUnavailable) {
|
|
9488
|
+
* // ...
|
|
9489
|
+
* }
|
|
9490
|
+
* }
|
|
9491
|
+
* ```
|
|
9492
|
+
*/
|
|
9493
|
+
export declare const GatewayErrorCodes: { readonly [Code in GatewayErrorCode]: Code; };
|
|
9494
|
+
//#endregion
|
|
9495
|
+
//#region src/errors/GatewayError.d.ts
|
|
9496
|
+
/**
|
|
9497
|
+
* The arguments the message of `Code` is formatted with, none when the message is a plain string.
|
|
9498
|
+
*/
|
|
9499
|
+
export type GatewayErrorArgs<Code extends GatewayErrorCode> = (typeof GatewayErrorMessages)[Code] extends ((...args: infer Args) => string) ? Args : [];
|
|
9500
|
+
/**
|
|
9501
|
+
* An {@link Error} carrying a {@link GatewayErrorCode}, like discord.js's `DiscordjsError`.
|
|
9502
|
+
*
|
|
9503
|
+
* @remarks
|
|
9504
|
+
* Its `name` is `GatewayError [<code>]`, and its message is the code's entry in {@link GatewayErrorMessages}.
|
|
9505
|
+
*/
|
|
9506
|
+
export declare class GatewayError<Code extends GatewayErrorCode = GatewayErrorCode> extends Error {
|
|
9507
|
+
/**
|
|
9508
|
+
* The code of the error.
|
|
9509
|
+
*/
|
|
9510
|
+
readonly code: Code;
|
|
9511
|
+
constructor(code: Code, ...args: GatewayErrorArgs<Code>);
|
|
9512
|
+
}
|
|
9513
|
+
/**
|
|
9514
|
+
* A {@link TypeError} carrying a {@link GatewayErrorCode}, like discord.js's `DiscordjsTypeError`.
|
|
9515
|
+
*/
|
|
9516
|
+
export declare class GatewayTypeError<Code extends GatewayErrorCode = GatewayErrorCode> extends TypeError {
|
|
9517
|
+
/**
|
|
9518
|
+
* The code of the error.
|
|
9519
|
+
*/
|
|
9520
|
+
readonly code: Code;
|
|
9521
|
+
constructor(code: Code, ...args: GatewayErrorArgs<Code>);
|
|
9522
|
+
}
|
|
9523
|
+
/**
|
|
9524
|
+
* A {@link RangeError} carrying a {@link GatewayErrorCode}, like discord.js's `DiscordjsRangeError`.
|
|
9525
|
+
*/
|
|
9526
|
+
export declare class GatewayRangeError<Code extends GatewayErrorCode = GatewayErrorCode> extends RangeError {
|
|
9527
|
+
/**
|
|
9528
|
+
* The code of the error.
|
|
9529
|
+
*/
|
|
9530
|
+
readonly code: Code;
|
|
9531
|
+
constructor(code: Code, ...args: GatewayErrorArgs<Code>);
|
|
9532
|
+
}
|
|
9533
|
+
//#endregion
|
|
8833
9534
|
//#region src/structures/invites/GroupDMInvite.d.ts
|
|
8834
9535
|
/**
|
|
8835
9536
|
* An invite to a group direct message. Its channel (name, icon, recipients) is exposed as `channel`.
|
|
@@ -8952,7 +9653,7 @@ export declare function isDeepEqual(a: unknown, b: unknown): boolean;
|
|
|
8952
9653
|
* event order is preserved. The error only reports that the partition is stuck, usually on a slow or unreachable
|
|
8953
9654
|
* cache.
|
|
8954
9655
|
*/
|
|
8955
|
-
export declare class DispatchTimeoutError extends
|
|
9656
|
+
export declare class DispatchTimeoutError extends GatewayError<"DispatchTimeout"> {
|
|
8956
9657
|
/**
|
|
8957
9658
|
* The type of the slow dispatch, e.g. `MESSAGE_CREATE`.
|
|
8958
9659
|
*/
|
|
@@ -8977,7 +9678,7 @@ export declare class DispatchTimeoutError extends Error {
|
|
|
8977
9678
|
* @remarks
|
|
8978
9679
|
* The request is dropped: chunks arriving later still update the cache and emit `guildMembersChunk`.
|
|
8979
9680
|
*/
|
|
8980
|
-
export declare class GuildMembersTimeoutError extends
|
|
9681
|
+
export declare class GuildMembersTimeoutError extends GatewayError<"GuildMembersTimeout"> {
|
|
8981
9682
|
/**
|
|
8982
9683
|
* The ID of the guild whose members were requested.
|
|
8983
9684
|
*/
|
|
@@ -8995,7 +9696,7 @@ export declare class GuildMembersTimeoutError extends Error {
|
|
|
8995
9696
|
/**
|
|
8996
9697
|
* Thrown by `GuildMemberManager#request` when Discord answers with `RATE_LIMITED` instead of the members' chunks.
|
|
8997
9698
|
*/
|
|
8998
|
-
export declare class GuildMembersRateLimitError extends
|
|
9699
|
+
export declare class GuildMembersRateLimitError extends GatewayError<"GuildMembersRateLimited"> {
|
|
8999
9700
|
/**
|
|
9000
9701
|
* The ID of the guild whose members were requested.
|
|
9001
9702
|
*/
|
|
@@ -9017,7 +9718,7 @@ export declare class GuildMembersRateLimitError extends Error {
|
|
|
9017
9718
|
* Neither failure stops the shard: a failed (or timed out) read identifies instead of resuming, and a failed write
|
|
9018
9719
|
* only means the session may not be resumed after a restart. The store's error is the `cause`.
|
|
9019
9720
|
*/
|
|
9020
|
-
export declare class GatewaySessionStoreError extends
|
|
9721
|
+
export declare class GatewaySessionStoreError extends GatewayError<"SessionStoreFailed"> {
|
|
9021
9722
|
/**
|
|
9022
9723
|
* Whether the store failed to read (`"get"`) or write (`"set"`) the session.
|
|
9023
9724
|
*/
|