@wolfstar/plugin-gateway 0.13.0 → 0.14.0-next-20261009112235

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 CHANGED
@@ -221,7 +221,8 @@ without touching the cache again.
221
221
  - `client.replayDispatch({ t, d, s? }, shardId, state?)` emits `raw` and the matching event, with the same Structures
222
222
  and `old` arguments the connected client emitted. It never reads or writes the cache, and never emits `dispatch`.
223
223
  Dispatches of a guild replay in order, like on a connected client. `client.replayDispatchTypes` lists the types it
224
- handles: `READY` and `INTERACTION_CREATE` are not replayed, so `client.user` stays `null` until something sets it,
224
+ handles: `READY` and `INTERACTION_CREATE` are not replayed, so `client.user` stays `null` until something sets it (and
225
+ `client.application` partial until `fetch()`),
225
226
  and shard lifecycle events never fire. The promise rejects when a listener or the handler throws, which lets the
226
227
  caller retry the dispatch; async listeners are awaited.
227
228
 
@@ -684,7 +685,7 @@ already ships (`User`, `Message`, `Attachment`, `Embed`, `Reaction`, `Poll`, `Em
684
685
  cache, CDN URLs, and actions through the client. The ones it has no counterpart for yet (`Guild`,
685
686
  `GuildMember`, `Role`, `ThreadMember`, `GuildScheduledEvent`, ...) extend its base `Structure`.
686
687
  They live in one folder per domain, each with an `index.ts`, mirroring `@discordjs/structures`:
687
- `automoderation/`, `channels/` (and `channels/mixins/`), `emojis/`, `guilds/`, `invites/`,
688
+ `applications/`, `automoderation/`, `channels/` (and `channels/mixins/`), `emojis/`, `guilds/`, `invites/`,
688
689
  `messages/`, `polls/`, `presences/`, `soundboards/`, `stageInstances/`, `stickers/`, `users/`,
689
690
  `voice/`, and `webhooks/`.
690
691
 
@@ -1029,6 +1030,29 @@ await webhook.editMessage(message.id, "Awoo!");
1029
1030
  const fetched = await client.fetchWebhook(webhookId, token); // no bot authorization needed
1030
1031
  ```
1031
1032
 
1033
+ ### Application
1034
+
1035
+ `client.application` is a `ClientApplication`, the entry point for what the application owns rather than a guild.
1036
+ Unlike discord.js, where it is `null` until `READY`, it is never `null`: the client builds it from `clientId`, so it
1037
+ exists before `READY` and without a gateway connection (a client replaying another process's dispatches never sees
1038
+ `READY`, and keeps it that way). Until then it is `partial`: only `id` is known, `READY` patches the very same
1039
+ instance with the `flags`, and `fetch()` with everything else. It lives on the client, not in the cache.
1040
+
1041
+ ```ts
1042
+ client.application.partial; // true until fetch() or edit() resolves
1043
+ await client.application.fetch(); // GET /applications/@me
1044
+ client.application.name; // "Wolf"
1045
+ client.application.owner; // a Team, a User, or null
1046
+ client.application.iconURL();
1047
+
1048
+ await client.application.edit({ description: "Awoo", tags: ["wolf"] });
1049
+ await client.application.editRoleConnectionMetadataRecords(records);
1050
+ ```
1051
+
1052
+ `owner` is the `Team` (with its `members`, each a `TeamMember`) when a team owns the application, the owner `User`
1053
+ otherwise. `application.commands`, `application.emojis` and the entitlements will be added to `ClientApplication`
1054
+ by their own features, there are no placeholders for them.
1055
+
1032
1056
  ### Messages
1033
1057
 
1034
1058
  `Message` follows discord.js: `attachments`, `embeds`, `mentions` (`MessageMentions`), `reactions`
@@ -2,7 +2,7 @@ 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 as Cache$1, CacheEntityName, CacheEntityTypes, CacheFactory, CachePolicies, EntityCache, GatewaySessionStore, IterableEntityCache } from "@wolfstar/plugin-cache";
5
- import { APIActionRowComponent, APIAllowedMentions, APIApplication, APIApplicationCommand, APIAttachment, APIAuditLogChange, APIAuthorizingIntegrationOwnersMap, APIAutoModerationAction, APIAutoModerationRule, APIAutoModerationRuleTriggerMetadata, APIAvatarDecorationData, APIButtonComponentWithCustomId, APIButtonComponentWithSKUId, APIButtonComponentWithURL, APIChannel, APIChannelMention, APIChannelSelectComponent, APICheckboxComponent, APICheckboxGroupComponent, APICheckboxGroupOption, APICollectibles, APIComponentInActionRow, APIComponentInMessageActionRow, APIContainerComponent, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, APIEmoji, APIEntitlement, APIExtendedInvite, APIFileComponent, APIFileUploadComponent, APIGuild, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIGuildMember, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, APIGuildPreview, APIGuildScheduledEvent, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEventRecurrenceRule, APIGuildScheduledEventRecurrenceRuleNWeekday, APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetMember, APIIncidentsData, APIInviteChannel, APIInviteGuild, APILabelComponent, APIMediaGalleryComponent, APIMediaGalleryItem, APIMentionableSelectComponent, APIMessage, APIMessageActivity, APIMessageCall, APIMessageComponent, APIMessageComponentEmoji, APIMessageInteractionMetadata, APIMessageReference, APIMessageRoleSubscriptionData, APIMessageSharedClientTheme, APIMessageTopLevelComponent, APIModalComponent, APIOverwrite, APIPartialEmoji, APIPoll, APIPollAnswer, APIRadioGroupComponent, APIRadioGroupOption, APIReaction, APIRole, APIRoleSelectComponent, APIRoleTags, APISKU, APISectionComponent, APISelectMenuDefaultValue, APISelectMenuOption, APISeparatorComponent, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APIStringSelectComponent, APISubscription, APITemplate, APITextDisplayComponent, APITextInputComponent, APIThreadChannel, APIThreadMember, APIThumbnailComponent, APIUnfurledMediaItem, APIUser, APIUserPrimaryGuild, APIUserSelectComponent, APIVoiceRegion, APIWebhook, ActivityFlags, ActivityType, AllowedMentionsTypes, ApplicationCommandOptionType, ApplicationFlags, AttachmentFlags, AuditLogEvent, AutoModerationActionType, AutoModerationRuleEventType, AutoModerationRuleKeywordPresetType, AutoModerationRuleTriggerType, ButtonStyle, ChannelFlags, ChannelType, FileUploadType, ForumLayoutType, GatewayActivity, GatewayActivityAssets, GatewayActivityUpdateData, GatewayAutoModerationActionExecutionDispatchData, GatewayChannelInfoDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayDispatchEvents, GatewayDispatchPayload, GatewayGuildDeleteDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildSoundboardSoundDeleteDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntentBits, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayPresenceClientStatus, GatewayPresenceUpdateData, GatewayRateLimitedDispatchData, GatewayReadyDispatchData, GatewayRequestChannelInfoField, GatewayThreadDeleteDispatchData, GatewayThreadListSync, GatewayThreadMembersUpdateDispatchData, GatewayTypingStartDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildMemberFlags, GuildOnboardingMode, GuildOnboardingPromptType, GuildPremiumTier, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventRecurrenceRuleFrequency, GuildScheduledEventRecurrenceRuleMonth, GuildScheduledEventRecurrenceRuleWeekday, GuildScheduledEventStatus, GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle, InteractionType, InviteTargetType, InviteType, Locale, MessageActivityType, MessageFlags, MessageReferenceType, MessageSearchAuthorType, MessageSearchEmbedType, MessageSearchHasType, MessageSearchSortMode, NameplatePalette, OverwriteType, PermissionFlagsBits, PollLayoutType, PresenceUpdateReceiveStatus, PresenceUpdateStatus, RESTAPIPoll, RESTGetAPIGuildVanityUrlResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildJSONBody, RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIGuildsJSONBody, ReactionType, RoleFlags, SelectMenuDefaultValueType, SeparatorSpacingSize, Snowflake, SortOrderType, StageInstancePrivacyLevel, StickerFormatType, ThreadAutoArchiveDuration, ThreadChannelType, UserFlags, VideoQualityMode } from "discord-api-types/v10";
5
+ import { APIActionRowComponent, APIAllowedMentions, APIApplication, APIApplicationCommand, APIAttachment, APIAuditLogChange, APIAuthorizingIntegrationOwnersMap, APIAutoModerationAction, APIAutoModerationRule, APIAutoModerationRuleTriggerMetadata, APIAvatarDecorationData, APIButtonComponentWithCustomId, APIButtonComponentWithSKUId, APIButtonComponentWithURL, APIChannel, APIChannelMention, APIChannelSelectComponent, APICheckboxComponent, APICheckboxGroupComponent, APICheckboxGroupOption, APICollectibles, APIComponentInActionRow, APIComponentInMessageActionRow, APIContainerComponent, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, APIEmoji, APIEntitlement, APIExtendedInvite, APIFileComponent, APIFileUploadComponent, APIGuild, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIGuildMember, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, APIGuildPreview, APIGuildScheduledEvent, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEventRecurrenceRule, APIGuildScheduledEventRecurrenceRuleNWeekday, APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetMember, APIIncidentsData, APIInviteChannel, APIInviteGuild, APILabelComponent, APIMediaGalleryComponent, APIMediaGalleryItem, APIMentionableSelectComponent, APIMessage, APIMessageActivity, APIMessageCall, APIMessageComponent, APIMessageComponentEmoji, APIMessageInteractionMetadata, APIMessageReference, APIMessageRoleSubscriptionData, APIMessageSharedClientTheme, APIMessageTopLevelComponent, APIModalComponent, APIOverwrite, APIPartialEmoji, APIPoll, APIPollAnswer, APIRadioGroupComponent, APIRadioGroupOption, APIReaction, APIRole, APIRoleSelectComponent, APIRoleTags, APISKU, APISectionComponent, APISelectMenuDefaultValue, APISelectMenuOption, APISeparatorComponent, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APIStringSelectComponent, APISubscription, APITeam, APITeamMember, APITemplate, APITextDisplayComponent, APITextInputComponent, APIThreadChannel, APIThreadMember, APIThumbnailComponent, APIUnfurledMediaItem, APIUser, APIUserPrimaryGuild, APIUserSelectComponent, APIVoiceRegion, APIWebhook, ActivityFlags, ActivityType, AllowedMentionsTypes, ApplicationCommandOptionType, ApplicationFlags, ApplicationIntegrationType, ApplicationRoleConnectionMetadataType, ApplicationWebhookEventStatus, ApplicationWebhookEventType, AttachmentFlags, AuditLogEvent, AutoModerationActionType, AutoModerationRuleEventType, AutoModerationRuleKeywordPresetType, AutoModerationRuleTriggerType, ButtonStyle, ChannelFlags, ChannelType, FileUploadType, ForumLayoutType, GatewayActivity, GatewayActivityAssets, GatewayActivityUpdateData, GatewayAutoModerationActionExecutionDispatchData, GatewayChannelInfoDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayDispatchEvents, GatewayDispatchPayload, GatewayGuildDeleteDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildSoundboardSoundDeleteDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntentBits, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayPresenceClientStatus, GatewayPresenceUpdateData, GatewayRateLimitedDispatchData, GatewayReadyDispatchData, GatewayRequestChannelInfoField, GatewayThreadDeleteDispatchData, GatewayThreadListSync, GatewayThreadMembersUpdateDispatchData, GatewayTypingStartDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildMemberFlags, GuildOnboardingMode, GuildOnboardingPromptType, GuildPremiumTier, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventRecurrenceRuleFrequency, GuildScheduledEventRecurrenceRuleMonth, GuildScheduledEventRecurrenceRuleWeekday, GuildScheduledEventStatus, GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle, InteractionType, InviteTargetType, InviteType, Locale, LocalizationMap, MessageActivityType, MessageFlags, MessageReferenceType, MessageSearchAuthorType, MessageSearchEmbedType, MessageSearchHasType, MessageSearchSortMode, NameplatePalette, OAuth2Scopes, OverwriteType, PermissionFlagsBits, PollLayoutType, PresenceUpdateReceiveStatus, PresenceUpdateStatus, RESTAPIPoll, RESTGetAPIGuildVanityUrlResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIGuildJSONBody, RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIGuildsJSONBody, ReactionType, RoleFlags, SelectMenuDefaultValueType, SeparatorSpacingSize, Snowflake, SortOrderType, StageInstancePrivacyLevel, StickerFormatType, TeamMemberMembershipState, TeamMemberRole, ThreadAutoArchiveDuration, ThreadChannelType, UserFlags, VideoQualityMode } from "discord-api-types/v10";
6
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 as Partialize$1, 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
  import { Collection, ReadonlyCollection } from "@discordjs/collection";
@@ -3851,6 +3851,20 @@ export declare class GuildEmojiManager extends CachedManager<"emojis", GuildEmoj
3851
3851
  * @throws {TypeError} When the store cannot enumerate its entries.
3852
3852
  */
3853
3853
  listCached(): Promise<GuildEmoji[]>;
3854
+ /**
3855
+ * Finds a custom emoji by its ID across every guild held in the cache, without calling the API.
3856
+ *
3857
+ * @remarks
3858
+ * Emojis are keyed by guild and ID, so it enumerates the whole entity cache like {@link GuildEmojiManager.listCached}.
3859
+ * The manager's own guild plays no part in the lookup.
3860
+ *
3861
+ * @param emojiId The ID of the emoji.
3862
+ * @returns The cached emoji, `null` when no guild has it or this entity is not cached.
3863
+ * @throws {TypeError} When the store cannot enumerate its entries.
3864
+ * @internal
3865
+ */
3866
+ findCachedInAnyGuild(emojiId: string): Promise<GuildEmoji | null>;
3867
+ private collectCached;
3854
3868
  protected fetchRaw(emojiId: string): Promise<{
3855
3869
  id: import("discord-api-types/globals").Snowflake | null;
3856
3870
  name: string | null;
@@ -10672,6 +10686,303 @@ export declare class UserManager extends CachedManager<"users", User, [userId: s
10672
10686
  private requireId;
10673
10687
  }
10674
10688
  //#endregion
10689
+ //#region src/structures/applications/Application.d.ts
10690
+ /**
10691
+ * The raw fields of an application: its ID, and any of the others. `READY` only carries the ID and flags, so a
10692
+ * partial application holds just these.
10693
+ */
10694
+ export type ApplicationData = Pick<APIApplication, "id"> & Partial<Omit<APIApplication, "id">>;
10695
+ /**
10696
+ * The public attributes of an application, like discord.js's `Application`.
10697
+ *
10698
+ * @typeParam Data The raw application data this structure wraps.
10699
+ */
10700
+ export declare class Application<Data extends ApplicationData = ApplicationData> extends Structure<Data> {
10701
+ get id(): string;
10702
+ /**
10703
+ * The name of the application, or `null` while it is not known.
10704
+ */
10705
+ get name(): string | null;
10706
+ /**
10707
+ * The description of the application, or `null` if it has none or is not known.
10708
+ */
10709
+ get description(): string | null;
10710
+ /**
10711
+ * The hash of the application's icon, or `null` if it has none or is not known.
10712
+ */
10713
+ get icon(): string | null;
10714
+ /**
10715
+ * The hash of the application's cover image, or `null` if it has none or is not known.
10716
+ */
10717
+ get cover(): string | null;
10718
+ get createdTimestamp(): number;
10719
+ get createdAt(): Date;
10720
+ /**
10721
+ * Gets the URL of the application's icon, or `null` if it has none.
10722
+ *
10723
+ * @param options The image options.
10724
+ */
10725
+ iconURL(options?: BaseImageURLOptions): string | null;
10726
+ /**
10727
+ * Gets the URL of the application's cover image, or `null` if it has none.
10728
+ *
10729
+ * @param options The image options.
10730
+ */
10731
+ coverURL(options?: BaseImageURLOptions): string | null;
10732
+ /**
10733
+ * The name of the application, its ID while the name is not known.
10734
+ */
10735
+ toString(): string;
10736
+ }
10737
+ //#endregion
10738
+ //#region src/structures/applications/TeamMember.d.ts
10739
+ /**
10740
+ * The relations of a {@link TeamMember}, set by its {@link Team}.
10741
+ */
10742
+ export interface TeamMemberRelations {
10743
+ team?: Team | null;
10744
+ }
10745
+ /**
10746
+ * A member of a {@link Team}, like discord.js's `TeamMember`.
10747
+ */
10748
+ export declare class TeamMember extends Structure<APITeamMember> {
10749
+ #private;
10750
+ [kRelations]: TeamMemberRelations;
10751
+ /**
10752
+ * @param data The raw team member.
10753
+ * @param relations The team the member belongs to, set by the team itself.
10754
+ */
10755
+ constructor(data: APITeamMember, relations?: TeamMemberRelations);
10756
+ /**
10757
+ * The ID of the member's user.
10758
+ */
10759
+ get id(): string;
10760
+ /**
10761
+ * The team the member belongs to, or `null` when the member was built by hand.
10762
+ */
10763
+ get team(): Team | null;
10764
+ /**
10765
+ * The permissions of the member in the team. Discord only ever sends `["*"]`.
10766
+ */
10767
+ get permissions(): readonly string[];
10768
+ /**
10769
+ * Whether the member accepted the invite to the team, or is still invited.
10770
+ */
10771
+ get membershipState(): TeamMemberMembershipState;
10772
+ /**
10773
+ * The role of the member in the team.
10774
+ */
10775
+ get role(): TeamMemberRole;
10776
+ /**
10777
+ * The user of the member.
10778
+ */
10779
+ get user(): User;
10780
+ /**
10781
+ * The mention of the member's user.
10782
+ */
10783
+ toString(): string;
10784
+ }
10785
+ //#endregion
10786
+ //#region src/structures/applications/Team.d.ts
10787
+ /**
10788
+ * A team of developers owning an application, like discord.js's `Team`.
10789
+ */
10790
+ export declare class Team extends Structure<APITeam> {
10791
+ #private;
10792
+ get id(): string;
10793
+ get name(): string;
10794
+ /**
10795
+ * The hash of the team's icon, or `null` if it has none.
10796
+ */
10797
+ get icon(): string | null;
10798
+ /**
10799
+ * The ID of the user owning the team.
10800
+ */
10801
+ get ownerId(): string;
10802
+ /**
10803
+ * The members of the team, by the ID of their user.
10804
+ */
10805
+ get members(): Collection<string, TeamMember>;
10806
+ /**
10807
+ * The member owning the team, if it is among {@link Team.members}.
10808
+ */
10809
+ get owner(): TeamMember | null;
10810
+ get createdTimestamp(): number;
10811
+ get createdAt(): Date;
10812
+ /**
10813
+ * Gets the URL of the team's icon, or `null` if it has none.
10814
+ *
10815
+ * @param options The image options.
10816
+ */
10817
+ iconURL(options?: BaseImageURLOptions): string | null;
10818
+ toString(): string;
10819
+ }
10820
+ //#endregion
10821
+ //#region src/structures/applications/ClientApplication.d.ts
10822
+ /**
10823
+ * The install parameters of an application: the scopes and permissions it asks for when it is added.
10824
+ */
10825
+ export interface ApplicationInstallParams {
10826
+ scopes: OAuth2Scopes[];
10827
+ permissions: Readonly<PermissionsBitField>;
10828
+ }
10829
+ /**
10830
+ * The install parameters of an application for each integration type (guild or user install).
10831
+ */
10832
+ export type ApplicationIntegrationTypesConfig = { [Type in ApplicationIntegrationType]?: {
10833
+ oauth2InstallParams: ApplicationInstallParams | null;
10834
+ }; };
10835
+ /**
10836
+ * The install parameters to set, with permissions in any form a `PermissionsBitField` resolves.
10837
+ */
10838
+ export interface ApplicationInstallParamsOptions {
10839
+ scopes: OAuth2Scopes[];
10840
+ permissions: PermissionResolvable;
10841
+ }
10842
+ /**
10843
+ * The options to edit the application with.
10844
+ *
10845
+ * @remarks
10846
+ * Omitted fields are left unchanged. Images are data URIs (`data:image/png;base64,...`) or anything `resolveImage`
10847
+ * reads (contents, a path, a URL, a stream, a blob), `null` removes them.
10848
+ */
10849
+ export interface ClientApplicationEditOptions {
10850
+ customInstallURL?: string;
10851
+ description?: string;
10852
+ eventWebhooksURL?: string | null;
10853
+ eventWebhooksStatus?: ApplicationWebhookEventStatus;
10854
+ eventWebhooksTypes?: ApplicationWebhookEventType[];
10855
+ flags?: ApplicationFlagsResolvable;
10856
+ icon?: ImageResolvable | null;
10857
+ coverImage?: ImageResolvable | null;
10858
+ interactionsEndpointURL?: string | null;
10859
+ roleConnectionsVerificationURL?: string | null;
10860
+ tags?: string[];
10861
+ installParams?: ApplicationInstallParamsOptions;
10862
+ integrationTypesConfig?: { [Type in ApplicationIntegrationType]?: {
10863
+ oauth2InstallParams?: ApplicationInstallParamsOptions;
10864
+ }; };
10865
+ }
10866
+ /**
10867
+ * A role connection metadata record of an application, with camelCased fields like discord.js.
10868
+ */
10869
+ export interface ApplicationRoleConnectionMetadata {
10870
+ name: string;
10871
+ nameLocalizations?: LocalizationMap;
10872
+ description: string;
10873
+ descriptionLocalizations?: LocalizationMap;
10874
+ key: string;
10875
+ type: ApplicationRoleConnectionMetadataType;
10876
+ }
10877
+ /**
10878
+ * The application of the bot, the entry point for everything owned by the application rather than by a guild, like
10879
+ * discord.js's `ClientApplication`.
10880
+ *
10881
+ * @remarks
10882
+ * Unlike discord.js, `client.application` exists from the construction of the client, with only its ID known until
10883
+ * `READY` patches in the flags, and {@link ClientApplication.fetch} the rest: check {@link ClientApplication.partial}
10884
+ * before relying on the other fields.
10885
+ */
10886
+ export declare class ClientApplication extends Application {
10887
+ #private;
10888
+ /**
10889
+ * Whether only the ID and flags of the application are known: it has neither been fetched nor edited yet.
10890
+ */
10891
+ get partial(): boolean;
10892
+ /**
10893
+ * The flags of the application.
10894
+ */
10895
+ get flags(): Readonly<ApplicationFlagsBitField>;
10896
+ /**
10897
+ * The tags describing the application, at most five.
10898
+ */
10899
+ get tags(): string[];
10900
+ /**
10901
+ * The scopes and permissions the application asks for when it is added to a guild, or `null` if it sets none.
10902
+ */
10903
+ get installParams(): ApplicationInstallParams | null;
10904
+ /**
10905
+ * The install parameters of the application for each integration type, or `null` if it sets none.
10906
+ */
10907
+ get integrationTypesConfig(): ApplicationIntegrationTypesConfig | null;
10908
+ /**
10909
+ * The URL the application is installed through, instead of Discord's own install link.
10910
+ */
10911
+ get customInstallURL(): string | null;
10912
+ /**
10913
+ * The team owning the application, else the user who does, `null` while it is not known.
10914
+ */
10915
+ get owner(): Team | User | null;
10916
+ /**
10917
+ * Whether anyone can add the bot to a guild, or `null` if it is not known.
10918
+ */
10919
+ get botPublic(): boolean | null;
10920
+ /**
10921
+ * Whether the bot only joins guilds after the full OAuth2 code grant flow, or `null` if it is not known.
10922
+ */
10923
+ get botRequireCodeGrant(): boolean | null;
10924
+ /**
10925
+ * The ID of the guild linked to the application, or `null` if there is none.
10926
+ */
10927
+ get guildId(): string | null;
10928
+ /**
10929
+ * The guild linked to the application, from the cache.
10930
+ */
10931
+ get guild(): Guild | null;
10932
+ /**
10933
+ * The approximate number of guilds the bot is in, or `null` if it is not known.
10934
+ */
10935
+ get approximateGuildCount(): number | null;
10936
+ /**
10937
+ * The approximate number of users who installed the application, or `null` if it is not known.
10938
+ */
10939
+ get approximateUserInstallCount(): number | null;
10940
+ /**
10941
+ * The URL interactions are sent to, or `null` if there is none.
10942
+ */
10943
+ get interactionsEndpointURL(): string | null;
10944
+ /**
10945
+ * The URL of the role connections verification, or `null` if there is none.
10946
+ */
10947
+ get roleConnectionsVerificationURL(): string | null;
10948
+ /**
10949
+ * The URL event webhooks are sent to, or `null` if there is none.
10950
+ */
10951
+ get eventWebhooksURL(): string | null;
10952
+ /**
10953
+ * Whether event webhooks are enabled, or `null` if it is not known.
10954
+ */
10955
+ get eventWebhooksStatus(): ApplicationWebhookEventStatus | null;
10956
+ /**
10957
+ * The event types sent to {@link ClientApplication.eventWebhooksURL}, or `null` if it is not known.
10958
+ */
10959
+ get eventWebhooksTypes(): ApplicationWebhookEventType[] | null;
10960
+ /**
10961
+ * Fetches the application from the API, and patches this structure with it.
10962
+ *
10963
+ * @returns This application.
10964
+ */
10965
+ fetch(): Promise<this>;
10966
+ /**
10967
+ * Edits the application, and patches this structure with the result.
10968
+ *
10969
+ * @param options The fields to edit.
10970
+ * @returns This application.
10971
+ */
10972
+ edit(options: ClientApplicationEditOptions): Promise<this>;
10973
+ /**
10974
+ * Fetches the role connection metadata records of the application.
10975
+ */
10976
+ fetchRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnectionMetadata[]>;
10977
+ /**
10978
+ * Replaces the role connection metadata records of the application.
10979
+ *
10980
+ * @param records The records to set, up to five. Records left out are removed.
10981
+ * @returns The records as stored.
10982
+ */
10983
+ editRoleConnectionMetadataRecords(records: readonly ApplicationRoleConnectionMetadata[]): Promise<ApplicationRoleConnectionMetadata[]>;
10984
+ }
10985
+ //#endregion
10675
10986
  //#region src/structures/users/ClientUser.d.ts
10676
10987
  /**
10677
10988
  * The presence to set for the bot user. Omitted fields keep their current value.
@@ -11467,6 +11778,17 @@ export declare class GatewayClient extends Client {
11467
11778
  * `null` if neither source answers (the failure is reported through `error`).
11468
11779
  */
11469
11780
  user: ClientUser | null;
11781
+ /**
11782
+ * The application of the bot, like discord.js's `Client#application`.
11783
+ *
11784
+ * @remarks
11785
+ * Unlike discord.js, it is never `null`: it is built from {@link GatewayClientOptions.clientId} when the client is,
11786
+ * so it exists before `READY` and without any gateway connection. It is then partial, see
11787
+ * {@link ClientApplication.partial}: `READY` patches the same instance with the application's flags, and
11788
+ * {@link ClientApplication.fetch} with the rest. It is kept on the client, not in the cache: it is a single small
11789
+ * object, and every process gets the same `READY`.
11790
+ */
11791
+ readonly application: ClientApplication;
11470
11792
  readonly users: UserManager;
11471
11793
  readonly guilds: GuildManager;
11472
11794
  readonly channels: ChannelManager;
@@ -13228,6 +13550,19 @@ export declare function basename(path: string, ext?: string): string;
13228
13550
  * @param thing The file.
13229
13551
  */
13230
13552
  export declare function findName(thing: unknown): string;
13553
+ /**
13554
+ * Finds a custom emoji by its ID in the cache of every guild, like discord.js's `resolveGuildEmoji`.
13555
+ *
13556
+ * @remarks
13557
+ * Emojis are cached per guild, so it enumerates the whole emoji cache: it needs a store able to list its entries, and
13558
+ * never calls the API.
13559
+ *
13560
+ * @param client The client whose cache to search.
13561
+ * @param emojiId The ID of the emoji.
13562
+ * @returns The emoji, `null` when no cached guild has it.
13563
+ * @throws {TypeError} When the emoji cache cannot enumerate its entries.
13564
+ */
13565
+ export declare function resolveGuildEmoji(client: GatewayClient, emojiId: Snowflake): Promise<GuildEmoji | null>;
13231
13566
  /**
13232
13567
  * Resolves a SKU, or its ID, to its ID.
13233
13568
  *