@fluxerjs/core 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +134 -37
- package/dist/index.d.ts +134 -37
- package/dist/index.js +244 -100
- package/dist/index.mjs +227 -81
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -6,9 +6,15 @@ export { GatewayOpcodes, MessageAttachmentFlags, Routes } from '@fluxerjs/types'
|
|
|
6
6
|
import { Collection } from '@fluxerjs/collection';
|
|
7
7
|
import { EmbedBuilder } from '@fluxerjs/builders';
|
|
8
8
|
export { AttachmentBuilder, EmbedBuilder, MessagePayload } from '@fluxerjs/builders';
|
|
9
|
-
import { PermissionResolvable } from '@fluxerjs/util';
|
|
9
|
+
import { PermissionsBitField, PermissionResolvable, BitField } from '@fluxerjs/util';
|
|
10
10
|
export { PermissionFlags, PermissionResolvable, PermissionString, PermissionsBitField, UserFlagsBitField, UserFlagsBits, UserFlagsResolvable, UserFlagsString, parsePrefixCommand, parseUserMention, resolvePermissionsToBitfield, resolveTenorToImageUrl } from '@fluxerjs/util';
|
|
11
11
|
|
|
12
|
+
/** Resolved file data (after URL fetch). Used internally by REST layer. */
|
|
13
|
+
interface ResolvedMessageFile {
|
|
14
|
+
name: string;
|
|
15
|
+
data: Blob | ArrayBuffer | Uint8Array | Buffer;
|
|
16
|
+
filename?: string;
|
|
17
|
+
}
|
|
12
18
|
/** File data for message attachment uploads. Use `data` for buffers or `url` to fetch from a URL. */
|
|
13
19
|
type MessageFileData = {
|
|
14
20
|
name: string;
|
|
@@ -31,7 +37,7 @@ interface MessageAttachmentMeta {
|
|
|
31
37
|
/** Options for sending a message (content, embeds, files). Used by Message.send, Channel.send, ChannelManager.send.
|
|
32
38
|
* EmbedBuilder instances are auto-converted to API format—no need to call .toJSON().
|
|
33
39
|
*/
|
|
34
|
-
type MessageSendOptions =
|
|
40
|
+
type MessageSendOptions = {
|
|
35
41
|
content?: string;
|
|
36
42
|
/** EmbedBuilder instances are auto-converted; raw APIEmbed also supported. */
|
|
37
43
|
embeds?: (APIEmbed | EmbedBuilder)[];
|
|
@@ -39,7 +45,23 @@ type MessageSendOptions = string | {
|
|
|
39
45
|
files?: MessageFileData[];
|
|
40
46
|
/** Attachment metadata for files (id = index). Use when files are provided. */
|
|
41
47
|
attachments?: MessageAttachmentMeta[];
|
|
48
|
+
/** Message flags (e.g. MessageFlags.SuppressNotifications for reply without ping). */
|
|
49
|
+
flags?: number;
|
|
42
50
|
};
|
|
51
|
+
/** API-ready body from MessageSendOptions or text content (serializes EmbedBuilder, includes attachments when files present). */
|
|
52
|
+
interface SendBodyResult {
|
|
53
|
+
content?: string;
|
|
54
|
+
embeds?: APIEmbed[];
|
|
55
|
+
attachments?: Array<{
|
|
56
|
+
id: number;
|
|
57
|
+
filename: string;
|
|
58
|
+
title?: string | null;
|
|
59
|
+
description?: string | null;
|
|
60
|
+
flags?: number;
|
|
61
|
+
}>;
|
|
62
|
+
/** Message flags (e.g. SuppressNotifications for reply without ping). */
|
|
63
|
+
flags?: number;
|
|
64
|
+
}
|
|
43
65
|
|
|
44
66
|
/** Base class for all Fluxer structures. Provides the client reference. */
|
|
45
67
|
declare abstract class Base {
|
|
@@ -112,7 +134,7 @@ declare class Role extends Base {
|
|
|
112
134
|
name: string;
|
|
113
135
|
color: number;
|
|
114
136
|
position: number;
|
|
115
|
-
|
|
137
|
+
_permissions: string;
|
|
116
138
|
hoist: boolean;
|
|
117
139
|
mentionable: boolean;
|
|
118
140
|
unicodeEmoji: string | null;
|
|
@@ -122,19 +144,11 @@ declare class Role extends Base {
|
|
|
122
144
|
/** @param data - API role from GET /guilds/{id}/roles or gateway role events */
|
|
123
145
|
/** @param guildId - The guild this role belongs to */
|
|
124
146
|
constructor(client: Client, data: APIRole, guildId: string);
|
|
147
|
+
get permissions(): PermissionsBitField;
|
|
125
148
|
/** Update mutable fields from fresh API data. Used by edit and gateway events. */
|
|
126
149
|
_patch(data: Partial<APIRole>): void;
|
|
127
150
|
/** Returns a mention string (e.g. `<@&123456>`). */
|
|
128
151
|
toString(): string;
|
|
129
|
-
/**
|
|
130
|
-
* Check if this role has a permission. Administrator grants all permissions.
|
|
131
|
-
* @param permission - Permission flag, name, or resolvable
|
|
132
|
-
* @returns true if the role has the permission
|
|
133
|
-
* @example
|
|
134
|
-
* if (role.has(PermissionFlags.BanMembers)) { ... }
|
|
135
|
-
* if (role.has('ManageChannels')) { ... }
|
|
136
|
-
*/
|
|
137
|
-
has(permission: PermissionResolvable): boolean;
|
|
138
152
|
/**
|
|
139
153
|
* Edit this role.
|
|
140
154
|
* Requires Manage Roles permission.
|
|
@@ -314,9 +328,7 @@ declare class GuildMember extends Base {
|
|
|
314
328
|
* const perms = member.permissions;
|
|
315
329
|
* if (perms.has(PermissionFlags.BanMembers)) { ... }
|
|
316
330
|
*/
|
|
317
|
-
get permissions():
|
|
318
|
-
has(permission: PermissionResolvable): boolean;
|
|
319
|
-
};
|
|
331
|
+
get permissions(): BitField<"CreateInstantInvite" | "KickMembers" | "BanMembers" | "Administrator" | "ManageChannels" | "ManageGuild" | "AddReactions" | "ViewAuditLog" | "PrioritySpeaker" | "Stream" | "ViewChannel" | "SendMessages" | "SendTtsMessages" | "ManageMessages" | "EmbedLinks" | "AttachFiles" | "ReadMessageHistory" | "MentionEveryone" | "UseExternalEmojis" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "UseVad" | "ChangeNickname" | "ManageNicknames" | "ManageRoles" | "ManageWebhooks" | "ManageEmojisAndStickers" | "ManageExpressions" | "UseExternalStickers" | "ModerateMembers" | "CreateExpressions" | "PinMessages" | "BypassSlowmode" | "UpdateRtcRegion">;
|
|
320
332
|
/**
|
|
321
333
|
* Compute the member's effective permissions in a guild channel.
|
|
322
334
|
* Applies role permissions and channel overwrites.
|
|
@@ -326,9 +338,7 @@ declare class GuildMember extends Base {
|
|
|
326
338
|
* const perms = member.permissionsIn(channel);
|
|
327
339
|
* if (perms.has(PermissionFlags.SendMessages)) { ... }
|
|
328
340
|
*/
|
|
329
|
-
permissionsIn(channel: GuildChannel):
|
|
330
|
-
has(permission: PermissionResolvable): boolean;
|
|
331
|
-
};
|
|
341
|
+
permissionsIn(channel: GuildChannel): BitField<"CreateInstantInvite" | "KickMembers" | "BanMembers" | "Administrator" | "ManageChannels" | "ManageGuild" | "AddReactions" | "ViewAuditLog" | "PrioritySpeaker" | "Stream" | "ViewChannel" | "SendMessages" | "SendTtsMessages" | "ManageMessages" | "EmbedLinks" | "AttachFiles" | "ReadMessageHistory" | "MentionEveryone" | "UseExternalEmojis" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "UseVad" | "ChangeNickname" | "ManageNicknames" | "ManageRoles" | "ManageWebhooks" | "ManageEmojisAndStickers" | "ManageExpressions" | "UseExternalStickers" | "ModerateMembers" | "CreateExpressions" | "PinMessages" | "BypassSlowmode" | "UpdateRtcRegion">;
|
|
332
342
|
private _computeBasePermissions;
|
|
333
343
|
}
|
|
334
344
|
|
|
@@ -908,6 +918,23 @@ interface MessageEditOptions {
|
|
|
908
918
|
/** New embeds (replaces existing) */
|
|
909
919
|
embeds?: (APIEmbed | EmbedBuilder)[];
|
|
910
920
|
}
|
|
921
|
+
type MessagePayload = {
|
|
922
|
+
files?: ResolvedMessageFile[];
|
|
923
|
+
body: SendBodyResult & {
|
|
924
|
+
message_reference?: APIMessageReference;
|
|
925
|
+
flags?: number;
|
|
926
|
+
};
|
|
927
|
+
};
|
|
928
|
+
/** Options for message.reply() — ping toggle and reply-to-different-message. */
|
|
929
|
+
interface ReplyOptions {
|
|
930
|
+
/** Whether to ping the replied-to user (default true). Use false to suppress the mention notification. */
|
|
931
|
+
ping?: boolean;
|
|
932
|
+
/** Reply to a different message instead of this one. Default: this message. */
|
|
933
|
+
replyTo?: Message | {
|
|
934
|
+
channelId: string;
|
|
935
|
+
messageId: string;
|
|
936
|
+
};
|
|
937
|
+
}
|
|
911
938
|
|
|
912
939
|
/** Represents a message in a channel. */
|
|
913
940
|
declare class Message extends Base {
|
|
@@ -940,8 +967,11 @@ declare class Message extends Base {
|
|
|
940
967
|
readonly mentionRoles: string[];
|
|
941
968
|
/** Client-side nonce for acknowledgment. Null if not provided. */
|
|
942
969
|
readonly nonce: string | null;
|
|
943
|
-
/**
|
|
944
|
-
|
|
970
|
+
/**
|
|
971
|
+
* Channel where this message was sent. Resolved from cache; null if not cached.
|
|
972
|
+
* Messages can only exist in text-based channels (text, DM, announcement), so this always has send() when non-null.
|
|
973
|
+
*/
|
|
974
|
+
get channel(): (TextChannel | DMChannel | GuildChannel) | null;
|
|
945
975
|
/** Guild where this message was sent. Resolved from cache; null for DMs or if not cached. */
|
|
946
976
|
get guild(): Guild | null;
|
|
947
977
|
/**
|
|
@@ -965,7 +995,7 @@ declare class Message extends Base {
|
|
|
965
995
|
* await message.send({ embeds: [embed] }); // EmbedBuilder auto-converted
|
|
966
996
|
* await message.send({ content: 'File', files: [{ name: 'data.txt', data }] });
|
|
967
997
|
*/
|
|
968
|
-
send(options: MessageSendOptions): Promise<Message>;
|
|
998
|
+
send(options: string | MessageSendOptions): Promise<Message>;
|
|
969
999
|
/**
|
|
970
1000
|
* Send a message to a specific channel. Use for logging, forwarding, or sending to another channel in the guild.
|
|
971
1001
|
* @param channelId - Snowflake of the target channel (e.g. log channel ID)
|
|
@@ -977,12 +1007,21 @@ declare class Message extends Base {
|
|
|
977
1007
|
sendTo(channelId: string, options: MessageSendOptions): Promise<Message>;
|
|
978
1008
|
/**
|
|
979
1009
|
* Reply to this message (shows as a reply in the client).
|
|
980
|
-
* @param options - Text content or object with content, embeds, and/or
|
|
1010
|
+
* @param options - Text content or object with content, embeds, and/or reply options (ping, replyTo)
|
|
981
1011
|
* @example
|
|
982
1012
|
* await message.reply('Pong!');
|
|
983
1013
|
* await message.reply({ embeds: [embed] });
|
|
984
|
-
|
|
985
|
-
|
|
1014
|
+
* await message.reply('No ping!', { ping: false });
|
|
1015
|
+
* await message.reply({ content: 'Reply to other', replyTo: otherMessage });
|
|
1016
|
+
*/
|
|
1017
|
+
reply(options: string | (MessageSendOptions & ReplyOptions), replyOptions?: ReplyOptions): Promise<Message>;
|
|
1018
|
+
/** Exposed for testing purposes, use Message.reply() or send() for normal use */
|
|
1019
|
+
static _createMessageBody(content: string | MessageSendOptions, referenced_message?: {
|
|
1020
|
+
channel_id: string;
|
|
1021
|
+
message_id: string;
|
|
1022
|
+
guild_id?: string;
|
|
1023
|
+
}, ping?: boolean): Promise<MessagePayload>;
|
|
1024
|
+
_send(payload: MessagePayload): Promise<Message>;
|
|
986
1025
|
/**
|
|
987
1026
|
* Edit this message. Only the author (or admins) can edit.
|
|
988
1027
|
* @param options - New content and/or embeds
|
|
@@ -1077,15 +1116,23 @@ declare class Message extends Base {
|
|
|
1077
1116
|
/**
|
|
1078
1117
|
* Manages messages for a channel. Access via channel.messages.
|
|
1079
1118
|
* @example
|
|
1080
|
-
* const message =
|
|
1119
|
+
* const message = channel.messages.get(messageId); // from cache (if enabled)
|
|
1120
|
+
* const message = await channel.messages.fetch(messageId); // from API
|
|
1081
1121
|
* if (message) await message.edit({ content: 'Updated!' });
|
|
1082
1122
|
*/
|
|
1083
1123
|
declare class MessageManager {
|
|
1084
1124
|
private readonly client;
|
|
1085
1125
|
private readonly channelId;
|
|
1086
1126
|
constructor(client: Client, channelId: string);
|
|
1127
|
+
/**
|
|
1128
|
+
* Get a message from cache. Returns undefined if not cached or caching is disabled.
|
|
1129
|
+
* Requires options.cache.messages > 0.
|
|
1130
|
+
* @param messageId - Snowflake of the message
|
|
1131
|
+
*/
|
|
1132
|
+
get(messageId: string): Message | undefined;
|
|
1087
1133
|
/**
|
|
1088
1134
|
* Fetch a message by ID from this channel.
|
|
1135
|
+
* When message caching is enabled, the fetched message is added to the cache.
|
|
1089
1136
|
* @param messageId - Snowflake of the message
|
|
1090
1137
|
* @returns The message
|
|
1091
1138
|
* @throws FluxerError with MESSAGE_NOT_FOUND if the message does not exist
|
|
@@ -1162,11 +1209,12 @@ declare class Invite extends Base {
|
|
|
1162
1209
|
/** Base class for all channel types. */
|
|
1163
1210
|
declare abstract class Channel extends Base {
|
|
1164
1211
|
/** Whether this channel has a send method (TextChannel, DMChannel). */
|
|
1165
|
-
|
|
1212
|
+
isTextBased(): this is TextChannel | DMChannel;
|
|
1166
1213
|
/** Whether this channel is a DM or Group DM. */
|
|
1167
|
-
isDM():
|
|
1214
|
+
isDM(): this is DMChannel;
|
|
1168
1215
|
/** Whether this channel is voice-based (VoiceChannel). */
|
|
1169
|
-
isVoice():
|
|
1216
|
+
isVoice(): this is VoiceChannel;
|
|
1217
|
+
isLink(): this is LinkChannel;
|
|
1170
1218
|
/** Create a DM channel from API data (type DM or GroupDM). */
|
|
1171
1219
|
static createDM(client: Client, data: APIChannelPartial): DMChannel;
|
|
1172
1220
|
readonly client: Client;
|
|
@@ -1200,6 +1248,12 @@ declare abstract class Channel extends Base {
|
|
|
1200
1248
|
* Send a typing indicator to the channel. Lasts ~10 seconds.
|
|
1201
1249
|
*/
|
|
1202
1250
|
sendTyping(): Promise<void>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Whether the bot can send messages in this channel.
|
|
1253
|
+
* For DMs: always true (when the channel exists).
|
|
1254
|
+
* For guild channels: checks ViewChannel and SendMessages permissions via guild.members.me.
|
|
1255
|
+
*/
|
|
1256
|
+
canSendMessage(): boolean;
|
|
1203
1257
|
}
|
|
1204
1258
|
declare class GuildChannel extends Channel {
|
|
1205
1259
|
readonly guildId: string;
|
|
@@ -1249,6 +1303,17 @@ declare class GuildChannel extends Channel {
|
|
|
1249
1303
|
allow?: string;
|
|
1250
1304
|
deny?: string;
|
|
1251
1305
|
}): Promise<void>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Whether the bot can send messages in this channel.
|
|
1308
|
+
* Checks ViewChannel and SendMessages via guild.members.me permissions.
|
|
1309
|
+
* Returns false if guild or bot member not cached.
|
|
1310
|
+
*/
|
|
1311
|
+
canSendMessage(): boolean;
|
|
1312
|
+
/**
|
|
1313
|
+
* Send a message to this guild channel.
|
|
1314
|
+
* Works for text and announcement channels. Voice/category/link channels will fail at the API.
|
|
1315
|
+
*/
|
|
1316
|
+
send(options: MessageSendOptions): Promise<Message>;
|
|
1252
1317
|
/**
|
|
1253
1318
|
* Remove a permission overwrite. DELETE /channels/{id}/permissions/{overwriteId}.
|
|
1254
1319
|
*/
|
|
@@ -1326,7 +1391,7 @@ declare class VoiceChannel extends GuildChannel {
|
|
|
1326
1391
|
constructor(client: Client, data: APIChannel);
|
|
1327
1392
|
}
|
|
1328
1393
|
declare class LinkChannel extends GuildChannel {
|
|
1329
|
-
url
|
|
1394
|
+
url: string | null;
|
|
1330
1395
|
constructor(client: Client, data: APIChannel);
|
|
1331
1396
|
}
|
|
1332
1397
|
/** DM channel (direct message between bot and a user). */
|
|
@@ -1395,7 +1460,7 @@ declare class ChannelManager extends Collection<string, Channel | GuildChannel>
|
|
|
1395
1460
|
* @throws FluxerError with CHANNEL_NOT_FOUND if the channel does not exist
|
|
1396
1461
|
* @example
|
|
1397
1462
|
* const channel = await client.channels.resolve(message.channelId);
|
|
1398
|
-
* if (channel?.
|
|
1463
|
+
* if (channel?.isTextBased()) await channel.send('Hello!');
|
|
1399
1464
|
*/
|
|
1400
1465
|
resolve(channelId: string): Promise<Channel>;
|
|
1401
1466
|
/**
|
|
@@ -1405,7 +1470,7 @@ declare class ChannelManager extends Collection<string, Channel | GuildChannel>
|
|
|
1405
1470
|
* @throws FluxerError with CHANNEL_NOT_FOUND if the channel does not exist
|
|
1406
1471
|
* @example
|
|
1407
1472
|
* const channel = await client.channels.fetch(channelId);
|
|
1408
|
-
* if (channel?.
|
|
1473
|
+
* if (channel?.isTextBased()) await channel.send('Hello!');
|
|
1409
1474
|
*/
|
|
1410
1475
|
fetch(channelId: string): Promise<Channel>;
|
|
1411
1476
|
/**
|
|
@@ -1431,7 +1496,7 @@ declare class ChannelManager extends Collection<string, Channel | GuildChannel>
|
|
|
1431
1496
|
* await client.channels.send(channelId, { embeds: [embed] });
|
|
1432
1497
|
* await client.channels.send(channelId, { content: 'Report', files: [{ name: 'log.txt', data }] });
|
|
1433
1498
|
*/
|
|
1434
|
-
send(channelId: string, payload: MessageSendOptions): Promise<Message>;
|
|
1499
|
+
send(channelId: string, payload: string | MessageSendOptions): Promise<Message>;
|
|
1435
1500
|
}
|
|
1436
1501
|
|
|
1437
1502
|
/**
|
|
@@ -1479,6 +1544,8 @@ interface CacheSizeLimits {
|
|
|
1479
1544
|
channels?: number;
|
|
1480
1545
|
guilds?: number;
|
|
1481
1546
|
users?: number;
|
|
1547
|
+
/** Max messages per channel to cache. Enables channel.messages.get() and oldMessage in messageUpdate. 0 = disabled. */
|
|
1548
|
+
messages?: number;
|
|
1482
1549
|
}
|
|
1483
1550
|
interface ClientOptions {
|
|
1484
1551
|
rest?: Partial<ConstructorParameters<typeof REST>[0]>;
|
|
@@ -1486,6 +1553,8 @@ interface ClientOptions {
|
|
|
1486
1553
|
intents?: number;
|
|
1487
1554
|
/** Suppress the warning when intents are set (Fluxer does not support intents yet). */
|
|
1488
1555
|
suppressIntentWarning?: boolean;
|
|
1556
|
+
/** When true, delay the Ready event until all guilds from READY (including unavailable) have been received via GUILD_CREATE. Default: false. */
|
|
1557
|
+
waitForGuilds?: boolean;
|
|
1489
1558
|
/** Cache size limits (channels, guilds, users). When exceeded, oldest entries are evicted. Omit or 0 = unbounded. */
|
|
1490
1559
|
cache?: CacheSizeLimits;
|
|
1491
1560
|
/** Initial presence (status, custom_status, etc.) sent on identify. Can also update via PresenceUpdate after connect. */
|
|
@@ -1720,6 +1789,10 @@ declare class Client extends EventEmitter {
|
|
|
1720
1789
|
/** Timestamp when the client became ready. Null until READY is received. */
|
|
1721
1790
|
readyAt: Date | null;
|
|
1722
1791
|
private _ws;
|
|
1792
|
+
/** When waitForGuilds, set of guild IDs we're waiting for GUILD_CREATE on. Null when not waiting. */
|
|
1793
|
+
_pendingGuildIds: Set<string> | null;
|
|
1794
|
+
/** Per-channel message cache (channelId -> messageId -> APIMessage). Used when options.cache.messages > 0. */
|
|
1795
|
+
private _messageCaches;
|
|
1723
1796
|
/** @param options - Token, REST config, WebSocket, presence, etc. */
|
|
1724
1797
|
constructor(options?: ClientOptions);
|
|
1725
1798
|
/**
|
|
@@ -1762,11 +1835,25 @@ declare class Client extends EventEmitter {
|
|
|
1762
1835
|
/**
|
|
1763
1836
|
* Send a message to any channel by ID. Shorthand for client.channels.send().
|
|
1764
1837
|
* Works even when the channel is not cached.
|
|
1838
|
+
* @deprecated Use client.channels.send(channelId, payload).
|
|
1765
1839
|
*/
|
|
1766
|
-
sendToChannel(channelId: string, payload: string |
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1840
|
+
sendToChannel(channelId: string, payload: string | MessageSendOptions): Promise<Message>;
|
|
1841
|
+
/**
|
|
1842
|
+
* Get the message cache for a channel. Returns null if message caching is disabled.
|
|
1843
|
+
* Used by MessageManager.get() and event handlers.
|
|
1844
|
+
* @internal
|
|
1845
|
+
*/
|
|
1846
|
+
_getMessageCache(channelId: string): Map<string, APIMessage> | null;
|
|
1847
|
+
/**
|
|
1848
|
+
* Add a message to the channel cache. Evicts oldest (FIFO) when over limit.
|
|
1849
|
+
* @internal
|
|
1850
|
+
*/
|
|
1851
|
+
_addMessageToCache(channelId: string, data: APIMessage): void;
|
|
1852
|
+
/**
|
|
1853
|
+
* Remove a message from the channel cache.
|
|
1854
|
+
* @internal
|
|
1855
|
+
*/
|
|
1856
|
+
_removeMessageFromCache(channelId: string, messageId: string): void;
|
|
1770
1857
|
/**
|
|
1771
1858
|
* Get or create a User from API data. Caches in client.users.
|
|
1772
1859
|
* Updates existing user's username, avatar, etc. when fresh data is provided.
|
|
@@ -1786,6 +1873,16 @@ declare class Client extends EventEmitter {
|
|
|
1786
1873
|
* @param token - Bot token (e.g. from FLUXER_BOT_TOKEN)
|
|
1787
1874
|
*/
|
|
1788
1875
|
login(token: string): Promise<string>;
|
|
1876
|
+
/**
|
|
1877
|
+
* Called when all guilds have been received (or immediately if not waiting).
|
|
1878
|
+
* Sets readyAt, emits Ready, clears pending state.
|
|
1879
|
+
*/
|
|
1880
|
+
_finalizeReady(): void;
|
|
1881
|
+
/**
|
|
1882
|
+
* Called by GUILD_CREATE handler when waitForGuilds is enabled.
|
|
1883
|
+
* Removes guild from pending set; when empty, finalizes ready.
|
|
1884
|
+
*/
|
|
1885
|
+
_onGuildReceived(guildId: string): void;
|
|
1789
1886
|
/** Disconnect from the gateway and clear cached data. */
|
|
1790
1887
|
destroy(): Promise<void>;
|
|
1791
1888
|
/** Returns true if the client has received Ready and `user` is set. */
|
|
@@ -1891,4 +1988,4 @@ declare function cdnMemberBannerURL(guildId: string, userId: string, bannerHash:
|
|
|
1891
1988
|
*/
|
|
1892
1989
|
declare function cdnDefaultAvatarURL(userIdOrIndex: string | number): string;
|
|
1893
1990
|
|
|
1894
|
-
export { Base, CDN_URL, CategoryChannel, type CdnUrlOptions, Channel, ChannelManager, Client, type ClientEventMethods, type ClientEvents, ClientUser, type CollectedReaction, DMChannel, ErrorCodes, Events, type FetchedUserWithProfile, FluxerError, type FluxerErrorOptions, Guild, GuildBan, GuildChannel, GuildEmoji, GuildMember, GuildMemberManager, GuildMemberRoleManager, GuildSticker, Invite, LinkChannel, Message, MessageCollector, type MessageCollectorEndReason, type MessageCollectorOptions, type MessageEditOptions, MessageManager, MessageReaction, type MessageSendOptions, type PartialMessage, ReactionCollector, type ReactionCollectorEndReason, type ReactionCollectorOptions, Role, type RoleResolvable, STATIC_CDN_URL, TextChannel, User, UsersManager, VoiceChannel, Webhook, type WebhookSendOptions, cdnAvatarURL, cdnBannerURL, cdnDefaultAvatarURL, cdnDisplayAvatarURL, cdnMemberAvatarURL, cdnMemberBannerURL };
|
|
1991
|
+
export { Base, CDN_URL, CategoryChannel, type CdnUrlOptions, Channel, ChannelManager, Client, type ClientEventMethods, type ClientEvents, ClientUser, type CollectedReaction, DMChannel, ErrorCodes, Events, type FetchedUserWithProfile, FluxerError, type FluxerErrorOptions, Guild, GuildBan, GuildChannel, GuildEmoji, GuildMember, GuildMemberManager, GuildMemberRoleManager, GuildSticker, Invite, LinkChannel, Message, MessageCollector, type MessageCollectorEndReason, type MessageCollectorOptions, type MessageEditOptions, MessageManager, MessageReaction, type MessageSendOptions, type PartialMessage, ReactionCollector, type ReactionCollectorEndReason, type ReactionCollectorOptions, type ReplyOptions, Role, type RoleResolvable, STATIC_CDN_URL, TextChannel, User, UsersManager, VoiceChannel, Webhook, type WebhookSendOptions, cdnAvatarURL, cdnBannerURL, cdnDefaultAvatarURL, cdnDisplayAvatarURL, cdnMemberAvatarURL, cdnMemberBannerURL };
|