seyfert 1.1.1 → 1.2.0
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/lib/api/Routes/applications.d.ts +2 -2
- package/lib/api/Routes/channels.d.ts +2 -2
- package/lib/api/Routes/gateway.d.ts +2 -2
- package/lib/api/Routes/guilds.d.ts +2 -1
- package/lib/api/Routes/interactions.d.ts +2 -2
- package/lib/api/Routes/invites.d.ts +2 -2
- package/lib/api/Routes/stage-instances.d.ts +2 -2
- package/lib/api/Routes/stickers.d.ts +2 -2
- package/lib/api/Routes/users.d.ts +2 -2
- package/lib/api/Routes/voice.d.ts +2 -2
- package/lib/api/Routes/webhooks.d.ts +2 -2
- package/lib/builders/ActionRow.d.ts +2 -1
- package/lib/builders/ActionRow.js +3 -3
- package/lib/builders/Base.d.ts +1 -1
- package/lib/builders/Button.d.ts +2 -1
- package/lib/builders/Button.js +2 -2
- package/lib/builders/Embed.d.ts +2 -1
- package/lib/builders/Modal.d.ts +9 -2
- package/lib/builders/Modal.js +12 -3
- package/lib/builders/SelectMenu.d.ts +18 -1
- package/lib/builders/SelectMenu.js +36 -12
- package/lib/builders/index.d.ts +1 -1
- package/lib/builders/index.js +9 -9
- package/lib/builders/types.d.ts +1 -1
- package/lib/cache/index.d.ts +5 -5
- package/lib/cache/index.js +3 -3
- package/lib/cache/resources/default/base.d.ts +1 -1
- package/lib/cache/resources/default/guild-based.d.ts +1 -1
- package/lib/cache/resources/default/guild-related.d.ts +1 -1
- package/lib/cache/resources/presence.d.ts +1 -1
- package/lib/cache/resources/stage-instances.d.ts +1 -1
- package/lib/cache/resources/voice-states.d.ts +1 -1
- package/lib/client/base.d.ts +4 -3
- package/lib/client/client.d.ts +2 -1
- package/lib/client/client.js +2 -2
- package/lib/client/httpclient.d.ts +2 -1
- package/lib/client/httpclient.js +3 -3
- package/lib/client/oninteractioncreate.js +11 -12
- package/lib/client/onmessagecreate.js +2 -3
- package/lib/client/workerclient.d.ts +3 -2
- package/lib/client/workerclient.js +4 -3
- package/lib/commands/applications/chat.d.ts +3 -3
- package/lib/commands/applications/chat.js +4 -3
- package/lib/commands/applications/chatcontext.d.ts +6 -9
- package/lib/commands/applications/chatcontext.js +6 -17
- package/lib/commands/applications/menu.d.ts +2 -1
- package/lib/commands/applications/menucontext.d.ts +4 -8
- package/lib/commands/applications/menucontext.js +7 -20
- package/lib/commands/basecontex.d.ts +15 -0
- package/lib/commands/basecontex.js +34 -0
- package/lib/commands/decorators.d.ts +2 -1
- package/lib/commands/decorators.js +4 -4
- package/lib/commands/handler.js +4 -3
- package/lib/commands/optionresolver.d.ts +3 -3
- package/lib/commands/optionresolver.js +14 -14
- package/lib/common/index.d.ts +0 -1
- package/lib/common/index.js +0 -1
- package/lib/common/it/constants.d.ts +3 -1
- package/lib/common/it/constants.js +2 -0
- package/lib/common/shorters/channels.d.ts +1 -1
- package/lib/common/shorters/channels.js +4 -4
- package/lib/common/shorters/guilds.d.ts +1 -1
- package/lib/common/shorters/guilds.js +6 -1
- package/lib/common/shorters/members.d.ts +6 -1
- package/lib/common/shorters/members.js +25 -2
- package/lib/common/shorters/webhook.d.ts +2 -2
- package/lib/common/types/resolvables.d.ts +2 -1
- package/lib/common/types/util.d.ts +1 -1
- package/lib/common/types/write.d.ts +1 -1
- package/lib/components/ActionRow.d.ts +4 -3
- package/lib/components/ActionRow.js +6 -3
- package/lib/components/BaseComponent.d.ts +18 -0
- package/lib/components/BaseComponent.js +21 -0
- package/lib/components/BaseSelectMenuComponent.d.ts +10 -0
- package/lib/components/BaseSelectMenuComponent.js +22 -0
- package/lib/components/ButtonComponent.d.ts +14 -14
- package/lib/components/ButtonComponent.js +36 -25
- package/lib/components/ChannelSelectMenuComponent.d.ts +4 -4
- package/lib/components/ChannelSelectMenuComponent.js +6 -5
- package/lib/components/MentionableSelectMenuComponent.d.ts +3 -2
- package/lib/components/MentionableSelectMenuComponent.js +4 -1
- package/lib/components/RoleSelectMenuComponent.d.ts +3 -2
- package/lib/components/RoleSelectMenuComponent.js +4 -1
- package/lib/components/StringSelectMenuComponent.d.ts +3 -4
- package/lib/components/StringSelectMenuComponent.js +3 -5
- package/lib/components/TextInputComponent.d.ts +10 -5
- package/lib/components/TextInputComponent.js +24 -7
- package/lib/components/UserSelectMenuComponent.d.ts +3 -2
- package/lib/components/UserSelectMenuComponent.js +4 -1
- package/lib/components/command.d.ts +6 -5
- package/lib/components/command.js +4 -0
- package/lib/components/componentcontext.d.ts +42 -0
- package/lib/components/componentcontext.js +79 -0
- package/lib/components/handler.d.ts +3 -3
- package/lib/components/handler.js +9 -4
- package/lib/components/index.d.ts +2 -2
- package/lib/components/index.js +9 -9
- package/lib/events/handler.d.ts +2 -1
- package/lib/events/hooks/application_command.d.ts +2 -2
- package/lib/events/hooks/auto_moderation.d.ts +4 -4
- package/lib/events/hooks/channel.d.ts +1 -1
- package/lib/events/hooks/dispatch.d.ts +1 -1
- package/lib/events/hooks/entitlement.d.ts +4 -4
- package/lib/events/hooks/guild.d.ts +42 -42
- package/lib/events/hooks/integration.d.ts +19 -19
- package/lib/events/hooks/interactions.d.ts +2 -2
- package/lib/events/hooks/invite.d.ts +5 -5
- package/lib/events/hooks/message.d.ts +6 -5
- package/lib/events/hooks/presence.d.ts +7 -7
- package/lib/events/hooks/stage.d.ts +4 -4
- package/lib/events/hooks/thread.d.ts +49 -49
- package/lib/events/hooks/typing.d.ts +2 -2
- package/lib/events/hooks/user.d.ts +1 -1
- package/lib/events/hooks/voice.d.ts +2 -2
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +3 -6
- package/lib/index.js +6 -7
- package/lib/langs/handler.d.ts +2 -1
- package/lib/structures/AutoModerationRule.d.ts +3 -2
- package/lib/structures/ClientUser.d.ts +1 -1
- package/lib/structures/Guild.d.ts +27 -27
- package/lib/structures/GuildEmoji.d.ts +2 -1
- package/lib/structures/GuildMember.d.ts +15 -6
- package/lib/structures/GuildMember.js +32 -6
- package/lib/structures/GuildPreview.d.ts +1 -1
- package/lib/structures/GuildRole.d.ts +2 -1
- package/lib/structures/GuildTemplate.d.ts +3 -2
- package/lib/structures/Interaction.d.ts +3 -3
- package/lib/structures/Interaction.js +33 -33
- package/lib/structures/Message.d.ts +5 -4
- package/lib/structures/Sticker.d.ts +2 -1
- package/lib/structures/User.d.ts +6 -3
- package/lib/structures/Webhook.d.ts +63 -4
- package/lib/structures/Webhook.js +53 -0
- package/lib/structures/channels.d.ts +2 -2
- package/lib/structures/extra/BaseGuild.d.ts +2 -1
- package/lib/structures/extra/BaseGuild.js +3 -3
- package/lib/structures/extra/BitField.d.ts +2 -2
- package/lib/structures/extra/BitField.js +2 -2
- package/lib/structures/extra/Permissions.d.ts +1 -1
- package/lib/structures/extra/functions.d.ts +2 -1
- package/lib/structures/extra/functions.js +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +17 -0
- package/lib/websocket/SharedTypes.d.ts +2 -1
- package/lib/websocket/SharedTypes.js +1 -0
- package/lib/websocket/discord/shard.d.ts +2 -1
- package/lib/websocket/discord/shard.js +30 -41
- package/lib/websocket/discord/sharder.d.ts +3 -2
- package/lib/websocket/discord/sharder.js +7 -6
- package/lib/websocket/discord/shared.d.ts +2 -1
- package/lib/websocket/discord/worker.d.ts +1 -1
- package/lib/websocket/discord/workermanager.d.ts +3 -2
- package/lib/websocket/discord/workermanager.js +1 -1
- package/package.json +2 -2
|
@@ -1,42 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a Discord webhook.
|
|
3
|
+
*/
|
|
4
|
+
import type { APIWebhook, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery } from 'discord-api-types/v10';
|
|
1
5
|
import type { UsingClient } from '../commands';
|
|
2
|
-
import type {
|
|
6
|
+
import type { ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPayload, MessageWebhookUpdateBodyRequest, MethodContext, ObjectToLower } from '../common';
|
|
3
7
|
import { AnonymousGuild } from './AnonymousGuild';
|
|
4
8
|
import { User } from './User';
|
|
5
9
|
import { DiscordBase } from './extra/DiscordBase';
|
|
6
10
|
export interface Webhook extends DiscordBase, ObjectToLower<Omit<APIWebhook, 'user' | 'source_guild'>> {
|
|
7
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents a Discord webhook.
|
|
14
|
+
*/
|
|
8
15
|
export declare class Webhook extends DiscordBase {
|
|
16
|
+
/** The user associated with the webhook, if applicable. */
|
|
9
17
|
user?: User;
|
|
18
|
+
/** The source guild of the webhook, if applicable. */
|
|
10
19
|
sourceGuild?: Partial<AnonymousGuild>;
|
|
20
|
+
/** Methods related to interacting with messages through the webhook. */
|
|
11
21
|
messages: ReturnType<typeof Webhook.messages>;
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a new Webhook instance.
|
|
24
|
+
* @param client The Discord client instance.
|
|
25
|
+
* @param data The data representing the webhook.
|
|
26
|
+
*/
|
|
12
27
|
constructor(client: UsingClient, data: APIWebhook);
|
|
28
|
+
/**
|
|
29
|
+
* Fetches the guild associated with the webhook.
|
|
30
|
+
* @param force Whether to force fetching the guild even if it's already cached.
|
|
31
|
+
* @returns A promise that resolves to the guild associated with the webhook, or undefined if not applicable.
|
|
32
|
+
*/
|
|
13
33
|
guild(force?: boolean): Promise<import("./Guild").Guild<"cached"> | import("./Guild").Guild<"api">> | undefined;
|
|
14
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Fetches the channel associated with the webhook.
|
|
36
|
+
* @param force Whether to force fetching the channel even if it's already cached.
|
|
37
|
+
* @returns A promise that resolves to the channel associated with the webhook, or undefined if not applicable.
|
|
38
|
+
*/
|
|
39
|
+
channel(force?: boolean): Promise<import("./channels").BaseChannel<import("discord-api-types/v10").ChannelType> | import("./channels").DMChannel | import("./channels").CategoryChannel | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the avatar URL of the webhook.
|
|
42
|
+
* @param options The image options for the avatar.
|
|
43
|
+
* @returns The avatar URL of the webhook, or null if no avatar is set.
|
|
44
|
+
*/
|
|
15
45
|
avatarURL(options?: ImageOptions): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Fetches the webhook data from the Discord API.
|
|
48
|
+
* @returns A promise that resolves to the fetched webhook data.
|
|
49
|
+
*/
|
|
16
50
|
fetch(): Promise<Webhook>;
|
|
17
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Edits the webhook.
|
|
53
|
+
* @param body The new webhook data.
|
|
54
|
+
* @param reason The reason for editing the webhook.
|
|
55
|
+
* @returns A promise that resolves when the webhook is successfully edited.
|
|
56
|
+
*/
|
|
57
|
+
edit(body: RESTPatchAPIWebhookJSONBody | RESTPatchAPIWebhookWithTokenJSONBody, reason?: string): Promise<import("discord-api-types/v10").RESTGetAPIWebhookWithTokenResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Deletes the webhook.
|
|
60
|
+
* @param reason The reason for deleting the webhook.
|
|
61
|
+
* @returns A promise that resolves when the webhook is successfully deleted.
|
|
62
|
+
*/
|
|
18
63
|
delete(reason?: string): Promise<never>;
|
|
64
|
+
/**
|
|
65
|
+
* Static methods related to interacting with messages through webhooks.
|
|
66
|
+
*/
|
|
19
67
|
static messages({ client, webhookId, webhookToken }: MethodContext<{
|
|
20
68
|
webhookId: string;
|
|
21
69
|
webhookToken: string;
|
|
22
70
|
}>): {
|
|
71
|
+
/** Writes a message through the webhook. */
|
|
23
72
|
write: (payload: MessageWebhookMethodWriteParams) => Promise<import("./Message").WebhookMessage | null>;
|
|
73
|
+
/** Edits a message sent through the webhook. */
|
|
24
74
|
edit: (payload: MessageWebhookMethodEditParams) => Promise<import("./Message").WebhookMessage>;
|
|
75
|
+
/** Deletes a message sent through the webhook. */
|
|
25
76
|
delete: (messageId: string, reason?: string) => Promise<never>;
|
|
26
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Static methods related to managing webhooks.
|
|
80
|
+
*/
|
|
27
81
|
static methods({ client, webhookId, webhookToken }: MethodContext<{
|
|
28
82
|
webhookId: string;
|
|
29
83
|
webhookToken?: string;
|
|
30
84
|
}>): {
|
|
85
|
+
/** Deletes the webhook. */
|
|
31
86
|
delete: (reason?: string) => Promise<never>;
|
|
32
|
-
|
|
87
|
+
/** Edits the webhook. */
|
|
88
|
+
edit: (body: RESTPatchAPIWebhookWithTokenJSONBody | RESTPatchAPIWebhookJSONBody, reason?: string) => Promise<import("discord-api-types/v10").RESTGetAPIWebhookWithTokenResult>;
|
|
89
|
+
/** Fetches the webhook data from the Discord API. */
|
|
33
90
|
fetch: () => Promise<Webhook>;
|
|
34
91
|
};
|
|
35
92
|
}
|
|
93
|
+
/** Type definition for parameters of editing a message through a webhook. */
|
|
36
94
|
export type MessageWebhookMethodEditParams = MessageWebhookPayload<MessageWebhookUpdateBodyRequest, {
|
|
37
95
|
messageId: string;
|
|
38
96
|
query?: RESTGetAPIWebhookWithTokenMessageQuery;
|
|
39
97
|
}>;
|
|
98
|
+
/** Type definition for parameters of writing a message through a webhook. */
|
|
40
99
|
export type MessageWebhookMethodWriteParams = MessageWebhookPayload<MessageWebhookCreateBodyRequest, {
|
|
41
100
|
query?: RESTPostAPIWebhookWithTokenQuery;
|
|
42
101
|
}>;
|
|
@@ -4,10 +4,21 @@ exports.Webhook = void 0;
|
|
|
4
4
|
const AnonymousGuild_1 = require("./AnonymousGuild");
|
|
5
5
|
const User_1 = require("./User");
|
|
6
6
|
const DiscordBase_1 = require("./extra/DiscordBase");
|
|
7
|
+
/**
|
|
8
|
+
* Represents a Discord webhook.
|
|
9
|
+
*/
|
|
7
10
|
class Webhook extends DiscordBase_1.DiscordBase {
|
|
11
|
+
/** The user associated with the webhook, if applicable. */
|
|
8
12
|
user;
|
|
13
|
+
/** The source guild of the webhook, if applicable. */
|
|
9
14
|
sourceGuild;
|
|
15
|
+
/** Methods related to interacting with messages through the webhook. */
|
|
10
16
|
messages;
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a new Webhook instance.
|
|
19
|
+
* @param client The Discord client instance.
|
|
20
|
+
* @param data The data representing the webhook.
|
|
21
|
+
*/
|
|
11
22
|
constructor(client, data) {
|
|
12
23
|
super(client, data);
|
|
13
24
|
if (data.user) {
|
|
@@ -20,42 +31,84 @@ class Webhook extends DiscordBase_1.DiscordBase {
|
|
|
20
31
|
messages: Webhook.messages({ client, webhookId: this.id, webhookToken: this.token }),
|
|
21
32
|
});
|
|
22
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Fetches the guild associated with the webhook.
|
|
36
|
+
* @param force Whether to force fetching the guild even if it's already cached.
|
|
37
|
+
* @returns A promise that resolves to the guild associated with the webhook, or undefined if not applicable.
|
|
38
|
+
*/
|
|
23
39
|
guild(force = false) {
|
|
24
40
|
if (!this.sourceGuild?.id)
|
|
25
41
|
return;
|
|
26
42
|
return this.client.guilds.fetch(this.sourceGuild.id, force);
|
|
27
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Fetches the channel associated with the webhook.
|
|
46
|
+
* @param force Whether to force fetching the channel even if it's already cached.
|
|
47
|
+
* @returns A promise that resolves to the channel associated with the webhook, or undefined if not applicable.
|
|
48
|
+
*/
|
|
28
49
|
async channel(force = false) {
|
|
29
50
|
if (!this.sourceChannel?.id)
|
|
30
51
|
return;
|
|
31
52
|
return this.client.channels.fetch(this.sourceChannel.id, force);
|
|
32
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves the avatar URL of the webhook.
|
|
56
|
+
* @param options The image options for the avatar.
|
|
57
|
+
* @returns The avatar URL of the webhook, or null if no avatar is set.
|
|
58
|
+
*/
|
|
33
59
|
avatarURL(options) {
|
|
34
60
|
if (!this.avatar) {
|
|
35
61
|
return null;
|
|
36
62
|
}
|
|
37
63
|
return this.rest.cdn.avatar(this.id, this.avatar, options);
|
|
38
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Fetches the webhook data from the Discord API.
|
|
67
|
+
* @returns A promise that resolves to the fetched webhook data.
|
|
68
|
+
*/
|
|
39
69
|
async fetch() {
|
|
40
70
|
return this.client.webhooks.fetch(this.id, this.token);
|
|
41
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Edits the webhook.
|
|
74
|
+
* @param body The new webhook data.
|
|
75
|
+
* @param reason The reason for editing the webhook.
|
|
76
|
+
* @returns A promise that resolves when the webhook is successfully edited.
|
|
77
|
+
*/
|
|
42
78
|
async edit(body, reason) {
|
|
43
79
|
return this.client.webhooks.edit(this.id, body, { reason, token: this.token });
|
|
44
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Deletes the webhook.
|
|
83
|
+
* @param reason The reason for deleting the webhook.
|
|
84
|
+
* @returns A promise that resolves when the webhook is successfully deleted.
|
|
85
|
+
*/
|
|
45
86
|
delete(reason) {
|
|
46
87
|
return this.client.webhooks.delete(this.id, { token: this.token, reason });
|
|
47
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Static methods related to interacting with messages through webhooks.
|
|
91
|
+
*/
|
|
48
92
|
static messages({ client, webhookId, webhookToken }) {
|
|
49
93
|
return {
|
|
94
|
+
/** Writes a message through the webhook. */
|
|
50
95
|
write: (payload) => client.webhooks.writeMessage(webhookId, webhookToken, payload),
|
|
96
|
+
/** Edits a message sent through the webhook. */
|
|
51
97
|
edit: (payload) => client.webhooks.editMessage(webhookId, webhookToken, payload),
|
|
98
|
+
/** Deletes a message sent through the webhook. */
|
|
52
99
|
delete: (messageId, reason) => client.webhooks.deleteMessage(webhookId, webhookToken, messageId, reason),
|
|
53
100
|
};
|
|
54
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Static methods related to managing webhooks.
|
|
104
|
+
*/
|
|
55
105
|
static methods({ client, webhookId, webhookToken }) {
|
|
56
106
|
return {
|
|
107
|
+
/** Deletes the webhook. */
|
|
57
108
|
delete: (reason) => client.webhooks.delete(webhookId, { reason, token: webhookToken }),
|
|
109
|
+
/** Edits the webhook. */
|
|
58
110
|
edit: (body, reason) => client.webhooks.edit(webhookId, body, { token: webhookToken, reason }),
|
|
111
|
+
/** Fetches the webhook data from the Discord API. */
|
|
59
112
|
fetch: () => client.webhooks.fetch(webhookId, webhookToken),
|
|
60
113
|
};
|
|
61
114
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChannelType, VideoQualityMode, type APIDMChannel, type APIGuildCategoryChannel, type APIGuildForumChannel, type APIGuildMediaChannel, type APIGuildStageVoiceChannel, type APIGuildVoiceChannel, type APINewsChannel, type APITextChannel, type APIThreadChannel, type ThreadAutoArchiveDuration } from 'discord-api-types/v10';
|
|
1
|
+
import { type APIChannelBase, type APIGuildChannel, type APIGuildForumDefaultReactionEmoji, type APIGuildForumTag, ChannelType, type RESTGetAPIChannelMessageReactionUsersQuery, type RESTPatchAPIChannelJSONBody, type RESTPatchAPIGuildChannelPositionsJSONBody, type RESTPostAPIChannelWebhookJSONBody, type RESTPostAPIGuildChannelJSONBody, type SortOrderType, VideoQualityMode, type APIDMChannel, type APIGuildCategoryChannel, type APIGuildForumChannel, type APIGuildMediaChannel, type APIGuildStageVoiceChannel, type APIGuildVoiceChannel, type APINewsChannel, type APITextChannel, type APIThreadChannel, type ThreadAutoArchiveDuration } from 'discord-api-types/v10';
|
|
2
2
|
import type { UsingClient } from '../commands';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EmojiResolvable, MessageCreateBodyRequest, MessageUpdateBodyRequest, MethodContext, ObjectToLower, StringToNumber, ToClass } from '../common';
|
|
4
4
|
import type { GuildMember } from './GuildMember';
|
|
5
5
|
import type { GuildRole } from './GuildRole';
|
|
6
6
|
import { DiscordBase } from './extra/DiscordBase';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type APIPartialGuild } from 'discord-api-types/v10';
|
|
2
|
+
import type { ObjectToLower } from '../../common';
|
|
2
3
|
import type { ImageOptions } from '../../common/types/options';
|
|
3
4
|
import { DiscordBase } from './DiscordBase';
|
|
4
5
|
export interface BaseGuild extends ObjectToLower<APIPartialGuild> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseGuild = void 0;
|
|
4
|
-
const
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
5
5
|
const DiscordBase_1 = require("./DiscordBase");
|
|
6
6
|
/**
|
|
7
7
|
* Base guild class
|
|
@@ -11,7 +11,7 @@ class BaseGuild extends DiscordBase_1.DiscordBase {
|
|
|
11
11
|
if (!this.features) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
-
return this.features.includes(
|
|
14
|
+
return this.features.includes(v10_1.GuildFeature.Partnered);
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* If the guild is verified.
|
|
@@ -21,7 +21,7 @@ class BaseGuild extends DiscordBase_1.DiscordBase {
|
|
|
21
21
|
if (!this.features) {
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
|
-
return this.features.includes(
|
|
24
|
+
return this.features.includes(v10_1.GuildFeature.Verified);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Fetch guild on API
|
|
@@ -12,6 +12,6 @@ export declare class BitField<T extends object> {
|
|
|
12
12
|
missings(...bits: BitFieldResolvable<T>[]): bigint[];
|
|
13
13
|
equals(other: BitFieldResolvable<T>): boolean;
|
|
14
14
|
resolve(bits?: BitFieldResolvable<T>): bigint;
|
|
15
|
-
keys(
|
|
16
|
-
values(
|
|
15
|
+
keys(bits?: BitFieldResolvable<T>[]): string[];
|
|
16
|
+
values(bits?: BitFieldResolvable<T>[]): bigint[];
|
|
17
17
|
}
|
|
@@ -56,7 +56,7 @@ class BitField {
|
|
|
56
56
|
throw new TypeError(`Cannot resolve permission: ${typeof bits === 'symbol' ? String(bits) : bits}`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
keys(
|
|
59
|
+
keys(bits = [this.bits]) {
|
|
60
60
|
const bitsResolved = bits.map(bit => BigInt(this.resolve(bit)));
|
|
61
61
|
return Object.entries(this.Flags).reduce((acc, value) => {
|
|
62
62
|
if (bitsResolved.some(bit => (bit & value[1]) === value[1])) {
|
|
@@ -66,7 +66,7 @@ class BitField {
|
|
|
66
66
|
return acc;
|
|
67
67
|
}, []);
|
|
68
68
|
}
|
|
69
|
-
values(
|
|
69
|
+
values(bits = [this.bits]) {
|
|
70
70
|
const bitsResolved = bits.map(bit => BigInt(this.resolve(bit)));
|
|
71
71
|
return Object.entries(this.Flags).reduce((acc, value) => {
|
|
72
72
|
if (bitsResolved.some(bit => (bit & value[1]) === value[1])) {
|
|
@@ -53,7 +53,7 @@ export declare class PermissionsBitField extends BitField<typeof PermissionFlags
|
|
|
53
53
|
readonly SendVoiceMessages: bigint;
|
|
54
54
|
};
|
|
55
55
|
static All: bigint;
|
|
56
|
-
keys: (
|
|
56
|
+
keys: (bits: BitFieldResolvable<typeof PermissionFlagsBits>[]) => PermissionStrings;
|
|
57
57
|
has(...bits: BitFieldResolvable<typeof PermissionFlagsBits>[]): boolean;
|
|
58
58
|
strictHas(...bits: BitFieldResolvable<typeof PermissionFlagsBits>[]): boolean;
|
|
59
59
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { APIPartialEmoji } from 'discord-api-types/v10';
|
|
1
2
|
import type { Cache } from '../../cache';
|
|
2
|
-
import type {
|
|
3
|
+
import type { TypeArray } from '../../common';
|
|
3
4
|
import type { EmojiResolvable } from '../../common/types/resolvables';
|
|
4
5
|
/** * Convert a timestamp to a snowflake. * @param timestamp The timestamp to convert. * @returns The snowflake. */
|
|
5
6
|
export declare function snowflakeToTimestamp(id: string): bigint;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hasProps = exports.encodeEmoji = exports.resolveEmoji = exports.resolvePartialEmoji = exports.messageLink = exports.channelLink = exports.snowflakeToTimestamp = void 0;
|
|
4
|
+
const globals_1 = require("discord-api-types/globals");
|
|
4
5
|
const common_1 = require("../../common");
|
|
5
6
|
/** * Convert a timestamp to a snowflake. * @param timestamp The timestamp to convert. * @returns The snowflake. */
|
|
6
7
|
function snowflakeToTimestamp(id) {
|
|
@@ -17,7 +18,7 @@ function messageLink(channelId, messageId, guildId) {
|
|
|
17
18
|
exports.messageLink = messageLink;
|
|
18
19
|
function resolvePartialEmoji(emoji) {
|
|
19
20
|
if (typeof emoji === 'string') {
|
|
20
|
-
const groups = emoji.match(
|
|
21
|
+
const groups = emoji.match(globals_1.FormattingPatterns.Emoji)?.groups;
|
|
21
22
|
if (groups) {
|
|
22
23
|
return { animated: !!groups.animated, name: groups.name, id: groups.id };
|
|
23
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'discord-api-types/v10';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("discord-api-types/v10"), exports);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type APIAuditLogEntry, type APIAutoModerationRule, type APIChannel, type APIEntitlement, type APIGuild, type APIGuildMember, type APIGuildScheduledEvent, type APIStageInstance, type APIUser, type GatewayActivity, type GatewayAutoModerationActionExecutionDispatchData, type GatewayChannelPinsUpdateDispatchData, type GatewayChannelUpdateDispatchData, GatewayDispatchEvents, type GatewayGuildBanAddDispatchData, type GatewayGuildBanRemoveDispatchData, type GatewayGuildCreateDispatchData, type GatewayGuildDeleteDispatchData, type GatewayGuildEmojisUpdateDispatchData, type GatewayGuildIntegrationsUpdateDispatchData, type GatewayGuildMemberRemoveDispatchData, type GatewayGuildMemberUpdateDispatchData, type GatewayGuildMembersChunkDispatchData, type GatewayGuildRoleCreateDispatchData, type GatewayGuildRoleDeleteDispatchData, type GatewayGuildRoleUpdateDispatchData, type GatewayGuildScheduledEventUserRemoveDispatchData, type GatewayGuildStickersUpdateDispatchData, type GatewayIntegrationCreateDispatchData, type GatewayIntegrationDeleteDispatchData, type GatewayInteractionCreateDispatchData, type GatewayInviteCreateDispatchData, type GatewayInviteDeleteDispatchData, type GatewayMessageCreateDispatchData, type GatewayMessageDeleteBulkDispatchData, type GatewayMessageDeleteDispatchData, type GatewayMessageReactionAddDispatchData, type GatewayMessageReactionRemoveAllDispatchData, type GatewayMessageReactionRemoveDispatchData, type GatewayMessageReactionRemoveEmojiDispatchData, type GatewayMessageUpdateDispatchData, type GatewayPresenceUpdateData, type GatewayPresenceUpdateDispatchData, type GatewayReadyDispatchData, type GatewayRequestGuildMembersDataWithQuery, type GatewayRequestGuildMembersDataWithUserIds, type GatewayThreadCreateDispatchData, type GatewayThreadDeleteDispatchData, type GatewayThreadListSyncDispatchData, type GatewayThreadMemberUpdateDispatchData, type GatewayThreadMembersUpdateDispatchData, type GatewayTypingStartDispatchData, type GatewayUserUpdateDispatchData, type GatewayVoiceServerUpdateDispatchData, type GatewayVoiceStateUpdateData, type GatewayWebhooksUpdateDispatchData, type PresenceUpdateStatus } from 'discord-api-types/v10';
|
|
2
|
+
import type { RestToKeys } from '../common';
|
|
2
3
|
import type { GatewayGuildMemberAddDispatchDataFixed } from '../structures';
|
|
3
4
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
|
4
5
|
export interface StatusUpdate {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import type { GatewayReceivePayload, GatewaySendPayload } from 'discord-api-types/v10';
|
|
2
3
|
import type WS from 'ws';
|
|
3
4
|
import { type CloseEvent } from 'ws';
|
|
4
|
-
import type {
|
|
5
|
+
import type { Logger } from '../../common';
|
|
5
6
|
import { DynamicBucket, PriorityQueue } from '../structures';
|
|
6
7
|
import { ConnectTimeout } from '../structures/timeout';
|
|
7
8
|
import { BaseSocket } from './basesocket';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Shard = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const node_zlib_1 = require("node:zlib");
|
|
5
6
|
const ws_1 = require("ws");
|
|
6
|
-
const common_1 = require("../../common");
|
|
7
7
|
const constants_1 = require("../constants");
|
|
8
8
|
const structures_1 = require("../structures");
|
|
9
9
|
const timeout_1 = require("../structures/timeout");
|
|
@@ -77,7 +77,7 @@ class Shard {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
async send(priority, message) {
|
|
80
|
-
this.debugger?.info(`[Shard #${this.id}] Sending: ${
|
|
80
|
+
this.debugger?.info(`[Shard #${this.id}] Sending: ${v10_1.GatewayOpcodes[message.op]} ${JSON.stringify(message.d, (_, value) => {
|
|
81
81
|
if (typeof value === 'string')
|
|
82
82
|
return value.replace(this.options.token, v => {
|
|
83
83
|
const split = v.split('.');
|
|
@@ -92,7 +92,7 @@ class Shard {
|
|
|
92
92
|
}
|
|
93
93
|
async identify() {
|
|
94
94
|
await this.send(0, {
|
|
95
|
-
op:
|
|
95
|
+
op: v10_1.GatewayOpcodes.Identify,
|
|
96
96
|
d: {
|
|
97
97
|
token: `Bot ${this.options.token}`,
|
|
98
98
|
compress: this.options.compress,
|
|
@@ -108,7 +108,7 @@ class Shard {
|
|
|
108
108
|
}
|
|
109
109
|
async resume() {
|
|
110
110
|
await this.send(0, {
|
|
111
|
-
op:
|
|
111
|
+
op: v10_1.GatewayOpcodes.Resume,
|
|
112
112
|
d: {
|
|
113
113
|
seq: this.data.resumeSeq,
|
|
114
114
|
session_id: this.data.session_id,
|
|
@@ -127,7 +127,7 @@ class Shard {
|
|
|
127
127
|
}
|
|
128
128
|
this.heart.lastBeat = Date.now();
|
|
129
129
|
this.websocket.send(JSON.stringify({
|
|
130
|
-
op:
|
|
130
|
+
op: v10_1.GatewayOpcodes.Heartbeat,
|
|
131
131
|
d: this.data.resumeSeq ?? null,
|
|
132
132
|
}));
|
|
133
133
|
}
|
|
@@ -144,9 +144,9 @@ class Shard {
|
|
|
144
144
|
if (packet.s !== null) {
|
|
145
145
|
this.data.resumeSeq = packet.s;
|
|
146
146
|
}
|
|
147
|
-
this.debugger?.debug(`[Shard #${this.id}]`, packet.t ? packet.t :
|
|
147
|
+
this.debugger?.debug(`[Shard #${this.id}]`, packet.t ? packet.t : v10_1.GatewayOpcodes[packet.op], this.data.resumeSeq);
|
|
148
148
|
switch (packet.op) {
|
|
149
|
-
case
|
|
149
|
+
case v10_1.GatewayOpcodes.Hello:
|
|
150
150
|
{
|
|
151
151
|
clearInterval(this.heart.nodeInterval);
|
|
152
152
|
this.heart.interval = packet.d.heartbeat_interval;
|
|
@@ -158,17 +158,17 @@ class Shard {
|
|
|
158
158
|
await this.identify();
|
|
159
159
|
}
|
|
160
160
|
break;
|
|
161
|
-
case
|
|
161
|
+
case v10_1.GatewayOpcodes.HeartbeatAck:
|
|
162
162
|
this.heart.ack = true;
|
|
163
163
|
this.heart.lastAck = Date.now();
|
|
164
164
|
break;
|
|
165
|
-
case
|
|
165
|
+
case v10_1.GatewayOpcodes.Heartbeat:
|
|
166
166
|
this.heartbeat(true);
|
|
167
167
|
break;
|
|
168
|
-
case
|
|
168
|
+
case v10_1.GatewayOpcodes.Reconnect:
|
|
169
169
|
await this.reconnect();
|
|
170
170
|
break;
|
|
171
|
-
case
|
|
171
|
+
case v10_1.GatewayOpcodes.InvalidSession:
|
|
172
172
|
if (packet.d) {
|
|
173
173
|
if (!this.resumable) {
|
|
174
174
|
return this.debugger?.fatal(`[Shard #${this.id}] This is a completely unexpected error message.`);
|
|
@@ -181,14 +181,14 @@ class Shard {
|
|
|
181
181
|
await this.identify();
|
|
182
182
|
}
|
|
183
183
|
break;
|
|
184
|
-
case
|
|
184
|
+
case v10_1.GatewayOpcodes.Dispatch:
|
|
185
185
|
{
|
|
186
186
|
switch (packet.t) {
|
|
187
|
-
case
|
|
187
|
+
case v10_1.GatewayDispatchEvents.Resumed:
|
|
188
188
|
this.offlineSendQueue.toArray().map((resolve) => resolve());
|
|
189
189
|
this.options.handlePayload(this.id, packet);
|
|
190
190
|
break;
|
|
191
|
-
case
|
|
191
|
+
case v10_1.GatewayDispatchEvents.Ready: {
|
|
192
192
|
this.data.resume_gateway_url = packet.d.resume_gateway_url;
|
|
193
193
|
this.data.session_id = packet.d.session_id;
|
|
194
194
|
this.offlineSendQueue.toArray().map((resolve) => resolve());
|
|
@@ -205,7 +205,7 @@ class Shard {
|
|
|
205
205
|
}
|
|
206
206
|
async handleClosed(close) {
|
|
207
207
|
clearInterval(this.heart.nodeInterval);
|
|
208
|
-
this.debugger?.warn(`[Shard #${this.id}] ${shared_1.ShardSocketCloseCodes[close.code] ??
|
|
208
|
+
this.debugger?.warn(`[Shard #${this.id}] ${shared_1.ShardSocketCloseCodes[close.code] ?? v10_1.GatewayCloseCodes[close.code] ?? close.code} (${close.code})`);
|
|
209
209
|
switch (close.code) {
|
|
210
210
|
case shared_1.ShardSocketCloseCodes.Shutdown:
|
|
211
211
|
break;
|
|
@@ -213,23 +213,23 @@ class Shard {
|
|
|
213
213
|
case 1001:
|
|
214
214
|
case 1006:
|
|
215
215
|
case shared_1.ShardSocketCloseCodes.ZombiedConnection:
|
|
216
|
-
case
|
|
217
|
-
case
|
|
218
|
-
case
|
|
219
|
-
case
|
|
220
|
-
case
|
|
221
|
-
case
|
|
222
|
-
case
|
|
223
|
-
case
|
|
216
|
+
case v10_1.GatewayCloseCodes.UnknownError:
|
|
217
|
+
case v10_1.GatewayCloseCodes.UnknownOpcode:
|
|
218
|
+
case v10_1.GatewayCloseCodes.DecodeError:
|
|
219
|
+
case v10_1.GatewayCloseCodes.NotAuthenticated:
|
|
220
|
+
case v10_1.GatewayCloseCodes.AlreadyAuthenticated:
|
|
221
|
+
case v10_1.GatewayCloseCodes.InvalidSeq:
|
|
222
|
+
case v10_1.GatewayCloseCodes.RateLimited:
|
|
223
|
+
case v10_1.GatewayCloseCodes.SessionTimedOut:
|
|
224
224
|
this.debugger?.info(`[Shard #${this.id}] Trying to reconnect`);
|
|
225
225
|
await this.reconnect();
|
|
226
226
|
break;
|
|
227
|
-
case
|
|
228
|
-
case
|
|
229
|
-
case
|
|
230
|
-
case
|
|
231
|
-
case
|
|
232
|
-
case
|
|
227
|
+
case v10_1.GatewayCloseCodes.AuthenticationFailed:
|
|
228
|
+
case v10_1.GatewayCloseCodes.DisallowedIntents:
|
|
229
|
+
case v10_1.GatewayCloseCodes.InvalidAPIVersion:
|
|
230
|
+
case v10_1.GatewayCloseCodes.InvalidIntents:
|
|
231
|
+
case v10_1.GatewayCloseCodes.InvalidShard:
|
|
232
|
+
case v10_1.GatewayCloseCodes.ShardingRequired:
|
|
233
233
|
this.debugger?.fatal(`[Shard #${this.id}] cannot reconnect`);
|
|
234
234
|
break;
|
|
235
235
|
default:
|
|
@@ -249,18 +249,7 @@ class Shard {
|
|
|
249
249
|
if (data instanceof Buffer) {
|
|
250
250
|
data = (0, node_zlib_1.inflateSync)(data);
|
|
251
251
|
}
|
|
252
|
-
|
|
253
|
-
* Idk why, but Bun sends this event when websocket connects.
|
|
254
|
-
* MessageEvent {
|
|
255
|
-
* type: "message",
|
|
256
|
-
* data: "Already authenticated."
|
|
257
|
-
* }
|
|
258
|
-
*/
|
|
259
|
-
if (data.startsWith('{')) {
|
|
260
|
-
data = JSON.parse(data);
|
|
261
|
-
}
|
|
262
|
-
const packet = data;
|
|
263
|
-
return this.onpacket(packet);
|
|
252
|
+
return this.onpacket(JSON.parse(data));
|
|
264
253
|
}
|
|
265
254
|
checkOffline(priority) {
|
|
266
255
|
if (!this.isOpen) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type GatewaySendPayload, type GatewayUpdatePresence, type GatewayVoiceStateUpdate } from 'discord-api-types/v10';
|
|
2
|
+
import { Logger, type ObjectToLower } from '../../common';
|
|
2
3
|
import { ConnectQueue } from '../structures/timeout';
|
|
3
4
|
import { Shard } from './shard.js';
|
|
4
5
|
import type { ShardManagerOptions } from './shared';
|
|
@@ -13,7 +14,7 @@ export declare class ShardManager extends Map<number, Shard> {
|
|
|
13
14
|
get remaining(): number;
|
|
14
15
|
get concurrency(): number;
|
|
15
16
|
get latency(): number;
|
|
16
|
-
|
|
17
|
+
calculateShardId(guildId: string): number;
|
|
17
18
|
spawn(shardId: number): Shard;
|
|
18
19
|
spawnShards(): Promise<void>;
|
|
19
20
|
spawnBuckets(): Shard[][];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ShardManager = void 0;
|
|
4
|
+
const v10_1 = require("discord-api-types/v10");
|
|
4
5
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
5
6
|
const common_1 = require("../../common");
|
|
6
7
|
const constants_1 = require("../constants");
|
|
@@ -43,7 +44,7 @@ class ShardManager extends Map {
|
|
|
43
44
|
this.forEach(s => (acc += s.latency));
|
|
44
45
|
return acc / this.size;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
+
calculateShardId(guildId) {
|
|
47
48
|
return Number((BigInt(guildId) >> 22n) % BigInt(this.options.info.shards ?? 1));
|
|
48
49
|
}
|
|
49
50
|
spawn(shardId) {
|
|
@@ -109,7 +110,7 @@ class ShardManager extends Map {
|
|
|
109
110
|
setShardPresence(shardId, payload) {
|
|
110
111
|
this.debugger?.info(`Shard #${shardId} update presence`);
|
|
111
112
|
return this.send(shardId, {
|
|
112
|
-
op:
|
|
113
|
+
op: v10_1.GatewayOpcodes.PresenceUpdate,
|
|
113
114
|
d: payload,
|
|
114
115
|
});
|
|
115
116
|
}
|
|
@@ -122,10 +123,10 @@ class ShardManager extends Map {
|
|
|
122
123
|
});
|
|
123
124
|
}
|
|
124
125
|
joinVoice(guild_id, channel_id, options) {
|
|
125
|
-
const shardId = this.
|
|
126
|
+
const shardId = this.calculateShardId(guild_id);
|
|
126
127
|
this.debugger?.info(`Shard #${shardId} join voice ${channel_id} in ${guild_id}`);
|
|
127
128
|
return this.send(shardId, {
|
|
128
|
-
op:
|
|
129
|
+
op: v10_1.GatewayOpcodes.VoiceStateUpdate,
|
|
129
130
|
d: {
|
|
130
131
|
guild_id,
|
|
131
132
|
channel_id,
|
|
@@ -134,10 +135,10 @@ class ShardManager extends Map {
|
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
leaveVoice(guild_id) {
|
|
137
|
-
const shardId = this.
|
|
138
|
+
const shardId = this.calculateShardId(guild_id);
|
|
138
139
|
this.debugger?.info(`Shard #${shardId} leave voice in ${guild_id}`);
|
|
139
140
|
return this.send(shardId, {
|
|
140
|
-
op:
|
|
141
|
+
op: v10_1.GatewayOpcodes.VoiceStateUpdate,
|
|
141
142
|
d: {
|
|
142
143
|
guild_id,
|
|
143
144
|
channel_id: null,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { APIGatewayBotInfo, GatewayDispatchPayload, GatewayIntentBits, GatewayPresenceUpdateData
|
|
1
|
+
import type { APIGatewayBotInfo, GatewayDispatchPayload, GatewayIntentBits, GatewayPresenceUpdateData } from 'discord-api-types/v10';
|
|
2
|
+
import type { Logger } from '../../common';
|
|
2
3
|
import type { IdentifyProperties } from '../constants';
|
|
3
4
|
export interface ShardManagerOptions extends ShardDetails {
|
|
4
5
|
/** Important data which is used by the manager to connect shards to the gateway. */
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
/// <reference types="node" />
|
|
6
6
|
/// <reference types="node" />
|
|
7
7
|
/// <reference types="node" />
|
|
8
|
+
import type { GatewayPresenceUpdateData, GatewaySendPayload } from 'discord-api-types/v10';
|
|
8
9
|
import { type Worker as ClusterWorker } from 'node:cluster';
|
|
9
10
|
import { Worker as ThreadWorker } from 'node:worker_threads';
|
|
10
|
-
import { ApiHandler } from '../..';
|
|
11
|
+
import { ApiHandler, Logger } from '../..';
|
|
11
12
|
import { type Adapter } from '../../cache';
|
|
12
|
-
import {
|
|
13
|
+
import { type MakePartial } from '../../common';
|
|
13
14
|
import { ConnectQueue } from '../structures/timeout';
|
|
14
15
|
import { MemberUpdateHandler } from './events/memberUpdate';
|
|
15
16
|
import { PresenceUpdateHandler } from './events/presenceUpdate';
|