@fluxerjs/core 1.3.1 → 2.0.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/README.md +8 -1
- package/dist/client.d.mts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +4015 -2593
- package/dist/client.mjs +4009 -2584
- package/dist/cluster.d.mts +153 -0
- package/dist/cluster.d.ts +153 -0
- package/dist/cluster.js +5730 -0
- package/dist/cluster.mjs +5718 -0
- package/dist/index.d.mts +19 -36
- package/dist/index.d.ts +19 -36
- package/dist/index.js +4482 -2626
- package/dist/index.mjs +4445 -2612
- package/dist/message.d.mts +3 -3
- package/dist/message.d.ts +3 -3
- package/dist/message.js +388 -226
- package/dist/message.mjs +389 -224
- package/dist/subpath-message-Acbzr5HA.d.mts +2725 -0
- package/dist/subpath-message-Acbzr5HA.d.ts +2725 -0
- package/package.json +14 -9
- package/dist/subpath-message-CZC4oGko.d.mts +0 -2071
- package/dist/subpath-message-CZC4oGko.d.ts +0 -2071
|
@@ -0,0 +1,2725 @@
|
|
|
1
|
+
import { Collection } from '@fluxerjs/collection';
|
|
2
|
+
import * as _fluxerjs_types from '@fluxerjs/types';
|
|
3
|
+
import { RESTPostAPIEmbed, RESTPostAPIMessageUploadedAttachment, APIAllowedMentions, MessageReferenceType, APIMessageReference, OverwriteType, APIEmoji, APIUserPartial, APIBan, APISticker, InviteType, APIGuildPartial, APIChannelPartial, APIPackInviteInfo, APIInvite, APIRole, APIWebhook, APIGuild, SystemChannelFlagsValue, DefaultMessageNotifications, GuildVerificationLevel, GuildMFALevel, GuildExplicitContentFilter, SplashCardAlignment, GuildNSFWLevel, GuildFeature, ChannelCreateRequest, AuditLogActionType, APIGuildMember, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, APIMessageAttachment, MessageType, APIEmbed, APIMessageSticker, APIMessageReaction, APIMessageSnapshot, APIMessageCall, APIMessage, APIChannel, APIChannelOverwrite, ChannelType, APIInstanceEndpoints, APIInstance, GatewayPresenceUpdateData, PackType, APIPackSummary, GatewayVoiceStateUpdateDispatchData, GatewayVoiceStateAckDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayEntranceSoundPlayDispatchData, GatewayVoiceStatesSyncData, GatewayUserConnectionsUpdateDispatchData, GatewayWebAuthnCredentialsUpdateDispatchData, GatewayReceivePayload, APIGatewayBotResponse, APIEmojiMetadata, APIStickerMetadata, APIApplicationMe, APIOAuthApplication, APIUserTagCheck, APIPreloadMessagesResponse, APIBulkMessageFetchResponse, GatewaySendPayload, Routes } from '@fluxerjs/types';
|
|
4
|
+
import { EventEmitter } from 'events';
|
|
5
|
+
import { REST } from '@fluxerjs/rest';
|
|
6
|
+
import { WebSocketManager } from '@fluxerjs/ws';
|
|
7
|
+
import { EmbedBuilder, MessagePayload as MessagePayload$1 } from '@fluxerjs/builders';
|
|
8
|
+
import { PermissionResolvable, PermissionsBitField } from '@fluxerjs/util';
|
|
9
|
+
|
|
10
|
+
/** Resolved file data (after URL fetch). Used internally by REST layer. */
|
|
11
|
+
interface ResolvedMessageFile {
|
|
12
|
+
name: string;
|
|
13
|
+
data: Blob | ArrayBuffer | Uint8Array | Buffer;
|
|
14
|
+
filename?: string;
|
|
15
|
+
}
|
|
16
|
+
/** File data for message attachment uploads. Use `data` for buffers or `url` to fetch from a URL. */
|
|
17
|
+
type MessageFileData = {
|
|
18
|
+
name: string;
|
|
19
|
+
data: Blob | ArrayBuffer | Uint8Array | Buffer;
|
|
20
|
+
filename?: string;
|
|
21
|
+
} | {
|
|
22
|
+
name: string;
|
|
23
|
+
url: string;
|
|
24
|
+
filename?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Attachment metadata for file uploads (id matches FormData index). */
|
|
27
|
+
interface MessageAttachmentMeta {
|
|
28
|
+
id: number;
|
|
29
|
+
filename: string;
|
|
30
|
+
title?: string | null;
|
|
31
|
+
description?: string | null;
|
|
32
|
+
/** MessageAttachmentFlags: IS_SPOILER (8), CONTAINS_EXPLICIT_MEDIA (16), IS_ANIMATED (32) */
|
|
33
|
+
flags?: number;
|
|
34
|
+
}
|
|
35
|
+
/** SDK options for allowed mentions (camelCase). Converted to APIAllowedMentions on send. */
|
|
36
|
+
type AllowedMentionsOptions = {
|
|
37
|
+
/** Mention parse groups to allow (`users`, `roles`, `everyone`). Empty array suppresses all. */
|
|
38
|
+
parse?: APIAllowedMentions['parse'];
|
|
39
|
+
/** Explicit user IDs that may be mentioned. */
|
|
40
|
+
users?: string[];
|
|
41
|
+
/** Explicit role IDs that may be mentioned. */
|
|
42
|
+
roles?: string[];
|
|
43
|
+
/** Whether to @mention and notify the author of the replied-to message. */
|
|
44
|
+
repliedUser?: boolean;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Common allowed-mentions presets.
|
|
48
|
+
* @example
|
|
49
|
+
* await message.reply('Got it!', { ping: false });
|
|
50
|
+
* await message.reply({ content: 'Got it!', allowedMentions: AllowedMentions.suppressReplyPing });
|
|
51
|
+
*/
|
|
52
|
+
declare const AllowedMentions: {
|
|
53
|
+
readonly suppressReplyPing: {
|
|
54
|
+
repliedUser: false;
|
|
55
|
+
};
|
|
56
|
+
readonly none: {
|
|
57
|
+
parse: never[];
|
|
58
|
+
};
|
|
59
|
+
readonly all: {
|
|
60
|
+
parse: ("users" | "roles" | "everyone")[];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
/** Target message for `replyTo` / `forward` on send options. */
|
|
64
|
+
type MessageReplyTarget = {
|
|
65
|
+
/** Channel that owns the target message. */
|
|
66
|
+
channelId: string;
|
|
67
|
+
/** Target message snowflake. */
|
|
68
|
+
messageId: string;
|
|
69
|
+
/** Guild id when known (optional for DMs / partials). */
|
|
70
|
+
guildId?: string | null;
|
|
71
|
+
/** {@link MessageReferenceType.Default} = reply, {@link MessageReferenceType.Forward} = forward */
|
|
72
|
+
type?: MessageReferenceType;
|
|
73
|
+
/** Attachment ids to include when forwarding. */
|
|
74
|
+
attachmentIds?: string[];
|
|
75
|
+
/** Embed indices to include when forwarding. */
|
|
76
|
+
embedIndices?: number[];
|
|
77
|
+
};
|
|
78
|
+
/** Options for sending a message via channel/message helpers. */
|
|
79
|
+
type MessageSendOptions = {
|
|
80
|
+
/** Plain text body. */
|
|
81
|
+
content?: string;
|
|
82
|
+
/** Embed payloads or {@link EmbedBuilder} instances. */
|
|
83
|
+
embeds?: (RESTPostAPIEmbed | EmbedBuilder)[];
|
|
84
|
+
/** Local files or remote URLs to upload with the message. */
|
|
85
|
+
files?: MessageFileData[];
|
|
86
|
+
/** Attachment metadata aligned with uploaded `files` indices. */
|
|
87
|
+
attachments?: MessageAttachmentMeta[];
|
|
88
|
+
/** Already-uploaded CDN attachments (skip multipart). */
|
|
89
|
+
uploadedAttachments?: RESTPostAPIMessageUploadedAttachment[];
|
|
90
|
+
/** Who may be mentioned; see {@link AllowedMentionsOptions}. */
|
|
91
|
+
allowedMentions?: AllowedMentionsOptions;
|
|
92
|
+
/** Reply to an existing message (sets message_reference). */
|
|
93
|
+
replyTo?: MessageReplyTarget;
|
|
94
|
+
/** Forward an existing message into this channel. */
|
|
95
|
+
forward?: MessageReplyTarget;
|
|
96
|
+
/**
|
|
97
|
+
* Shortcut for reply pings. `false` sets `allowedMentions.repliedUser` to false.
|
|
98
|
+
* Prefer explicit {@link AllowedMentionsOptions} when you need full control.
|
|
99
|
+
*/
|
|
100
|
+
ping?: boolean;
|
|
101
|
+
/** Text-to-speech flag. */
|
|
102
|
+
tts?: boolean;
|
|
103
|
+
/** Sticker snowflakes to attach. */
|
|
104
|
+
stickerIds?: string[];
|
|
105
|
+
/** Client-generated nonce for deduplication. */
|
|
106
|
+
nonce?: string;
|
|
107
|
+
/** Favorite meme id when sending a saved meme. */
|
|
108
|
+
favoriteMemeId?: string;
|
|
109
|
+
/** Message flags bitfield. */
|
|
110
|
+
flags?: number;
|
|
111
|
+
};
|
|
112
|
+
/** API-ready body from MessageSendOptions. */
|
|
113
|
+
interface SendBodyResult {
|
|
114
|
+
content?: string;
|
|
115
|
+
embeds?: RESTPostAPIEmbed[];
|
|
116
|
+
attachments?: Array<{
|
|
117
|
+
id: number;
|
|
118
|
+
filename: string;
|
|
119
|
+
title?: string | null;
|
|
120
|
+
description?: string | null;
|
|
121
|
+
flags?: number;
|
|
122
|
+
} | RESTPostAPIMessageUploadedAttachment>;
|
|
123
|
+
allowed_mentions?: APIAllowedMentions;
|
|
124
|
+
message_reference?: APIMessageReference;
|
|
125
|
+
sticker_ids?: string[];
|
|
126
|
+
nonce?: string;
|
|
127
|
+
favorite_meme_id?: string;
|
|
128
|
+
tts?: boolean;
|
|
129
|
+
flags?: number;
|
|
130
|
+
}
|
|
131
|
+
/** REST post payload for POST /channels/{id}/messages. */
|
|
132
|
+
interface MessagePostPayload {
|
|
133
|
+
body: SendBodyResult;
|
|
134
|
+
files?: ResolvedMessageFile[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Optional client defaults applied when a send omits the matching field. */
|
|
138
|
+
type MessagePrepareDefaults = {
|
|
139
|
+
defaultAllowedMentions?: AllowedMentionsOptions;
|
|
140
|
+
};
|
|
141
|
+
/** Input accepted by {@link prepareMessagePostPayload} and channel send helpers. */
|
|
142
|
+
type MessagePrepareInput = string | MessageSendOptions | MessagePayload$1;
|
|
143
|
+
/**
|
|
144
|
+
* Build a full message POST payload (body + optional files) from send options
|
|
145
|
+
* or a builders {@link MessagePayload}.
|
|
146
|
+
* Applies {@link MessagePrepareDefaults.defaultAllowedMentions} when the call omits `allowedMentions`.
|
|
147
|
+
*/
|
|
148
|
+
declare function prepareMessagePostPayload(options: MessagePrepareInput, defaults?: MessagePrepareDefaults): Promise<MessagePostPayload>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* CamelCase SDK option types that serialize to OpenAPI wire bodies.
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
/** Options for {@link GuildMemberManager.search}. */
|
|
155
|
+
interface GuildMemberSearchOptions {
|
|
156
|
+
query?: string;
|
|
157
|
+
limit?: number;
|
|
158
|
+
offset?: number;
|
|
159
|
+
roleIds?: string[];
|
|
160
|
+
joinedAtGte?: number;
|
|
161
|
+
joinedAtLte?: number;
|
|
162
|
+
isBot?: boolean;
|
|
163
|
+
userCreatedAtGte?: number;
|
|
164
|
+
userCreatedAtLte?: number;
|
|
165
|
+
sortBy?: 'joinedAt' | 'relevance';
|
|
166
|
+
sortOrder?: 'asc' | 'desc';
|
|
167
|
+
}
|
|
168
|
+
/** Convert {@link GuildMemberSearchOptions} to the wire search body. */
|
|
169
|
+
declare function toMemberSearchBody(options: GuildMemberSearchOptions): Record<string, unknown>;
|
|
170
|
+
/** Single channel window for {@link Client.bulkFetchMessages}. */
|
|
171
|
+
interface BulkFetchMessagesRequest {
|
|
172
|
+
channelId: string;
|
|
173
|
+
limit: number;
|
|
174
|
+
before?: string;
|
|
175
|
+
after?: string;
|
|
176
|
+
around?: string;
|
|
177
|
+
}
|
|
178
|
+
/** Convert bulk-fetch requests to wire items. */
|
|
179
|
+
declare function toBulkFetchWire(requests: readonly BulkFetchMessagesRequest[]): Array<{
|
|
180
|
+
channel_id: string;
|
|
181
|
+
limit: number;
|
|
182
|
+
before?: string;
|
|
183
|
+
after?: string;
|
|
184
|
+
around?: string;
|
|
185
|
+
}>;
|
|
186
|
+
/** Options for {@link Webhook.edit}. */
|
|
187
|
+
interface WebhookEditOptions {
|
|
188
|
+
name?: string;
|
|
189
|
+
avatar?: string | null;
|
|
190
|
+
/** Move webhook to another channel (bot auth only). */
|
|
191
|
+
channelId?: string;
|
|
192
|
+
}
|
|
193
|
+
/** Options for creating/editing packs. */
|
|
194
|
+
interface PackCreateOptions {
|
|
195
|
+
name: string;
|
|
196
|
+
description?: string | null;
|
|
197
|
+
}
|
|
198
|
+
interface PackEditOptions {
|
|
199
|
+
name?: string;
|
|
200
|
+
description?: string | null;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Options for guild discovery apply/edit.
|
|
204
|
+
* Maps to OpenAPI: `description`, `category_type`, `custom_tags`.
|
|
205
|
+
*/
|
|
206
|
+
interface DiscoveryApplicationOptions {
|
|
207
|
+
description?: string;
|
|
208
|
+
/** Discovery category (`category_type` on the wire). */
|
|
209
|
+
primaryCategoryId?: number | string;
|
|
210
|
+
/** Custom search tags (`custom_tags` on the wire). */
|
|
211
|
+
keywords?: string[];
|
|
212
|
+
/** Primary language code (`primary_language` on the wire). */
|
|
213
|
+
primaryLanguage?: string;
|
|
214
|
+
}
|
|
215
|
+
/** Convert {@link DiscoveryApplicationOptions} to the discovery wire body. */
|
|
216
|
+
declare function toDiscoveryBody(options: DiscoveryApplicationOptions): Record<string, unknown>;
|
|
217
|
+
/** CamelCase presence for {@link ClientUser.setPresence}. */
|
|
218
|
+
interface PresenceUpdateOptions {
|
|
219
|
+
status: 'online' | 'idle' | 'dnd' | 'invisible';
|
|
220
|
+
since?: number | null;
|
|
221
|
+
afk?: boolean;
|
|
222
|
+
activities?: Array<{
|
|
223
|
+
name: string;
|
|
224
|
+
type: number;
|
|
225
|
+
url?: string | null;
|
|
226
|
+
}>;
|
|
227
|
+
customStatus?: {
|
|
228
|
+
text?: string | null;
|
|
229
|
+
emojiName?: string | null;
|
|
230
|
+
emojiId?: string | null;
|
|
231
|
+
} | null;
|
|
232
|
+
}
|
|
233
|
+
/** Convert presence options to gateway opcode 3 payload. */
|
|
234
|
+
declare function toPresenceWire(options: PresenceUpdateOptions): Record<string, unknown>;
|
|
235
|
+
/** Sudo / MFA verification for sensitive operations. */
|
|
236
|
+
interface SudoVerificationOptions {
|
|
237
|
+
password?: string;
|
|
238
|
+
mfaMethod?: 'totp' | 'webauthn';
|
|
239
|
+
mfaCode?: string;
|
|
240
|
+
webauthnResponse?: Record<string, unknown>;
|
|
241
|
+
webauthnChallenge?: string;
|
|
242
|
+
}
|
|
243
|
+
/** Convert {@link SudoVerificationOptions} to the wire sudo body. */
|
|
244
|
+
declare function toSudoBody(options: SudoVerificationOptions): Record<string, unknown>;
|
|
245
|
+
/** Options for creating a pack invite. */
|
|
246
|
+
interface PackInviteCreateOptions {
|
|
247
|
+
maxUses?: number;
|
|
248
|
+
maxAge?: number;
|
|
249
|
+
unique?: boolean;
|
|
250
|
+
}
|
|
251
|
+
/** Convert {@link PackInviteCreateOptions} to the pack invite wire body. */
|
|
252
|
+
declare function toPackInviteBody(options: PackInviteCreateOptions): Record<string, unknown>;
|
|
253
|
+
/** Options for creating a pack/guild emoji. */
|
|
254
|
+
interface ExpressionCreateOptions {
|
|
255
|
+
name: string;
|
|
256
|
+
image: string;
|
|
257
|
+
}
|
|
258
|
+
/** Convert {@link ExpressionCreateOptions} to the emoji create wire body. */
|
|
259
|
+
declare function toEmojiCreateBody(options: ExpressionCreateOptions): Record<string, unknown>;
|
|
260
|
+
/** Options for editing a pack/guild emoji. */
|
|
261
|
+
interface ExpressionEditOptions {
|
|
262
|
+
name: string;
|
|
263
|
+
}
|
|
264
|
+
/** Convert {@link ExpressionEditOptions} to the emoji edit wire body. */
|
|
265
|
+
declare function toEmojiEditBody(options: ExpressionEditOptions): Record<string, unknown>;
|
|
266
|
+
/** Options for creating a pack/guild sticker. */
|
|
267
|
+
interface StickerCreateOptions {
|
|
268
|
+
name: string;
|
|
269
|
+
/** Base64 image data (`image` on the wire). */
|
|
270
|
+
file: string;
|
|
271
|
+
description?: string | null;
|
|
272
|
+
tags?: string[];
|
|
273
|
+
}
|
|
274
|
+
/** Options for editing a pack/guild sticker. */
|
|
275
|
+
interface StickerEditOptions {
|
|
276
|
+
name?: string;
|
|
277
|
+
description?: string | null;
|
|
278
|
+
tags?: string[];
|
|
279
|
+
}
|
|
280
|
+
/** Convert {@link StickerCreateOptions} to the sticker create wire body. */
|
|
281
|
+
declare function toStickerCreateBody(options: StickerCreateOptions): Record<string, unknown>;
|
|
282
|
+
/** Convert {@link StickerEditOptions} to the sticker edit wire body. */
|
|
283
|
+
declare function toStickerEditBody(options: StickerEditOptions): Record<string, unknown>;
|
|
284
|
+
/** Options for {@link GuildMember.edit}. */
|
|
285
|
+
interface GuildMemberEditOptions {
|
|
286
|
+
nick?: string | null;
|
|
287
|
+
roles?: string[];
|
|
288
|
+
avatar?: string | null;
|
|
289
|
+
banner?: string | null;
|
|
290
|
+
bio?: string | null;
|
|
291
|
+
pronouns?: string | null;
|
|
292
|
+
accentColor?: number | null;
|
|
293
|
+
profileFlags?: number | null;
|
|
294
|
+
mute?: boolean;
|
|
295
|
+
deaf?: boolean;
|
|
296
|
+
communicationDisabledUntil?: string | null;
|
|
297
|
+
timeoutReason?: string | null;
|
|
298
|
+
channelId?: string | null;
|
|
299
|
+
connectionId?: string | null;
|
|
300
|
+
}
|
|
301
|
+
/** Convert {@link GuildMemberEditOptions} to the member PATCH wire body. */
|
|
302
|
+
declare function toMemberEditBody(options: GuildMemberEditOptions): Record<string, unknown>;
|
|
303
|
+
/** Permission overwrite in camelCase for channel edit. */
|
|
304
|
+
interface ChannelPermissionOverwriteOptions {
|
|
305
|
+
id: string;
|
|
306
|
+
type: OverwriteType;
|
|
307
|
+
allow?: string;
|
|
308
|
+
deny?: string;
|
|
309
|
+
}
|
|
310
|
+
/** Options for {@link GuildChannel.edit}. */
|
|
311
|
+
interface ChannelEditOptions {
|
|
312
|
+
name?: string | null;
|
|
313
|
+
topic?: string | null;
|
|
314
|
+
parentId?: string | null;
|
|
315
|
+
bitrate?: number | null;
|
|
316
|
+
userLimit?: number | null;
|
|
317
|
+
nsfw?: boolean;
|
|
318
|
+
rateLimitPerUser?: number;
|
|
319
|
+
rtcRegion?: string | null;
|
|
320
|
+
permissionOverwrites?: ChannelPermissionOverwriteOptions[];
|
|
321
|
+
}
|
|
322
|
+
/** Convert {@link ChannelEditOptions} to the channel PATCH wire body. */
|
|
323
|
+
declare function toChannelEditBody(options: ChannelEditOptions): Record<string, unknown>;
|
|
324
|
+
/** Options for {@link GuildChannel.createInvite}. */
|
|
325
|
+
interface ChannelInviteCreateOptions {
|
|
326
|
+
maxUses?: number;
|
|
327
|
+
maxAge?: number;
|
|
328
|
+
unique?: boolean;
|
|
329
|
+
temporary?: boolean;
|
|
330
|
+
}
|
|
331
|
+
/** Convert {@link ChannelInviteCreateOptions} to the invite create wire body. */
|
|
332
|
+
declare function toChannelInviteBody(options: ChannelInviteCreateOptions): Record<string, unknown>;
|
|
333
|
+
/** Attachment keep/add entry for message edit (camelCase). */
|
|
334
|
+
interface MessageAttachmentEdit {
|
|
335
|
+
id: number | string;
|
|
336
|
+
filename?: string;
|
|
337
|
+
uploadFilename?: string;
|
|
338
|
+
fileSize?: number;
|
|
339
|
+
contentType?: string;
|
|
340
|
+
title?: string | null;
|
|
341
|
+
description?: string | null;
|
|
342
|
+
flags?: number;
|
|
343
|
+
}
|
|
344
|
+
/** Convert {@link MessageAttachmentEdit} entries to wire attachment objects. */
|
|
345
|
+
declare function toMessageAttachmentEditWire(attachments: readonly MessageAttachmentEdit[]): Array<Record<string, unknown>>;
|
|
346
|
+
/** Plan item for {@link Channel.requestAttachmentUploads}. */
|
|
347
|
+
interface AttachmentUploadPlanItem {
|
|
348
|
+
id: number;
|
|
349
|
+
filename: string;
|
|
350
|
+
fileSize: number;
|
|
351
|
+
contentType: string;
|
|
352
|
+
}
|
|
353
|
+
/** Convert plan items to the attachments request wire body. */
|
|
354
|
+
declare function toAttachmentUploadPlanBody(attachments: readonly AttachmentUploadPlanItem[]): {
|
|
355
|
+
attachments: Array<Record<string, unknown>>;
|
|
356
|
+
};
|
|
357
|
+
/** Multipart complete item for {@link Channel.completeAttachmentUploads}. */
|
|
358
|
+
interface AttachmentUploadCompleteItem {
|
|
359
|
+
uploadFilename: string;
|
|
360
|
+
uploadId: string;
|
|
361
|
+
}
|
|
362
|
+
/** Convert complete items to the attachments/complete wire body. */
|
|
363
|
+
declare function toAttachmentUploadCompleteBody(uploads: readonly AttachmentUploadCompleteItem[]): {
|
|
364
|
+
uploads: Array<{
|
|
365
|
+
upload_filename: string;
|
|
366
|
+
upload_id: string;
|
|
367
|
+
}>;
|
|
368
|
+
};
|
|
369
|
+
/** Part in a multipart upload plan response. */
|
|
370
|
+
interface AttachmentUploadPartPayload {
|
|
371
|
+
partNumber: number;
|
|
372
|
+
uploadUrl: string;
|
|
373
|
+
}
|
|
374
|
+
/** Singlepart plan response item. */
|
|
375
|
+
interface AttachmentUploadSinglepartPayload {
|
|
376
|
+
id: number;
|
|
377
|
+
filename: string;
|
|
378
|
+
uploadFilename: string;
|
|
379
|
+
fileSize: number;
|
|
380
|
+
contentType: string;
|
|
381
|
+
uploadMode: 'singlepart';
|
|
382
|
+
uploadUrl: string;
|
|
383
|
+
}
|
|
384
|
+
/** Multipart plan response item. */
|
|
385
|
+
interface AttachmentUploadMultipartPayload {
|
|
386
|
+
id: number;
|
|
387
|
+
filename: string;
|
|
388
|
+
uploadFilename: string;
|
|
389
|
+
fileSize: number;
|
|
390
|
+
contentType: string;
|
|
391
|
+
uploadMode: 'multipart';
|
|
392
|
+
uploadId: string;
|
|
393
|
+
partSize: number;
|
|
394
|
+
parts: AttachmentUploadPartPayload[];
|
|
395
|
+
}
|
|
396
|
+
type AttachmentUploadPlanResponseItem = AttachmentUploadSinglepartPayload | AttachmentUploadMultipartPayload;
|
|
397
|
+
/** CamelCase response from {@link Channel.requestAttachmentUploads}. */
|
|
398
|
+
interface AttachmentUploadPlanResponse {
|
|
399
|
+
attachments: AttachmentUploadPlanResponseItem[];
|
|
400
|
+
}
|
|
401
|
+
/** CamelCase response from {@link Channel.completeAttachmentUploads}. */
|
|
402
|
+
interface AttachmentUploadCompleteResponse {
|
|
403
|
+
uploads: Array<{
|
|
404
|
+
uploadFilename: string;
|
|
405
|
+
}>;
|
|
406
|
+
}
|
|
407
|
+
/** CamelCase RTC region from {@link Channel.fetchRtcRegions}. */
|
|
408
|
+
interface RtcRegionPayload {
|
|
409
|
+
id: string;
|
|
410
|
+
name: string;
|
|
411
|
+
emoji: string;
|
|
412
|
+
}
|
|
413
|
+
/** CamelCase slowmode state from {@link Channel.fetchSlowmode}. */
|
|
414
|
+
interface ChannelSlowmodePayload {
|
|
415
|
+
rateLimitPerUser: number;
|
|
416
|
+
retryAfterMs: number;
|
|
417
|
+
nextSendAllowedAt: string | null;
|
|
418
|
+
}
|
|
419
|
+
/** CamelCase discovery application. */
|
|
420
|
+
interface DiscoveryApplicationPayload {
|
|
421
|
+
guildId: string;
|
|
422
|
+
guildNsfwLevel?: number | null;
|
|
423
|
+
status: string;
|
|
424
|
+
description: string;
|
|
425
|
+
categoryType: number;
|
|
426
|
+
primaryLanguage?: string | null;
|
|
427
|
+
customTags?: string[];
|
|
428
|
+
appliedAt?: string;
|
|
429
|
+
reviewedAt?: string | null;
|
|
430
|
+
}
|
|
431
|
+
/** CamelCase discovery status. */
|
|
432
|
+
interface DiscoveryStatusPayload {
|
|
433
|
+
application?: DiscoveryApplicationPayload | null;
|
|
434
|
+
eligible: boolean;
|
|
435
|
+
minMemberCount: number;
|
|
436
|
+
}
|
|
437
|
+
/** Map wire discovery application → camelCase. */
|
|
438
|
+
declare function toDiscoveryApplicationPayload(data: {
|
|
439
|
+
guild_id: string;
|
|
440
|
+
guild_nsfw_level?: number | null;
|
|
441
|
+
status: string;
|
|
442
|
+
description: string;
|
|
443
|
+
category_type: number;
|
|
444
|
+
primary_language?: string | null;
|
|
445
|
+
custom_tags?: string[];
|
|
446
|
+
applied_at?: string;
|
|
447
|
+
reviewed_at?: string | null;
|
|
448
|
+
}): DiscoveryApplicationPayload;
|
|
449
|
+
/** Map wire discovery status → camelCase. */
|
|
450
|
+
declare function toDiscoveryStatusPayload(data: {
|
|
451
|
+
application?: {
|
|
452
|
+
guild_id: string;
|
|
453
|
+
guild_nsfw_level?: number | null;
|
|
454
|
+
status: string;
|
|
455
|
+
description: string;
|
|
456
|
+
category_type: number;
|
|
457
|
+
primary_language?: string | null;
|
|
458
|
+
custom_tags?: string[];
|
|
459
|
+
applied_at?: string;
|
|
460
|
+
reviewed_at?: string | null;
|
|
461
|
+
} | null;
|
|
462
|
+
eligible: boolean;
|
|
463
|
+
min_member_count: number;
|
|
464
|
+
}): DiscoveryStatusPayload;
|
|
465
|
+
/** CamelCase user profile sub-object. */
|
|
466
|
+
interface UserProfilePayload {
|
|
467
|
+
pronouns?: string | null;
|
|
468
|
+
bio?: string | null;
|
|
469
|
+
banner?: string | null;
|
|
470
|
+
accentColor?: number | null;
|
|
471
|
+
bannerColor?: number | null;
|
|
472
|
+
theme?: string | null;
|
|
473
|
+
}
|
|
474
|
+
/** CamelCase connected account. */
|
|
475
|
+
interface ConnectedAccountPayload {
|
|
476
|
+
name?: string | null;
|
|
477
|
+
type?: string | null;
|
|
478
|
+
}
|
|
479
|
+
/** CamelCase profile response from {@link UserManager.fetchWithProfile}. */
|
|
480
|
+
interface ProfilePayload {
|
|
481
|
+
userProfile?: UserProfilePayload | null;
|
|
482
|
+
mutualGuilds?: Array<{
|
|
483
|
+
id: string;
|
|
484
|
+
}> | null;
|
|
485
|
+
mutualGuildIds?: string[] | null;
|
|
486
|
+
connectedAccounts?: ConnectedAccountPayload[] | null;
|
|
487
|
+
}
|
|
488
|
+
/** Map wire profile → camelCase. */
|
|
489
|
+
declare function toProfilePayload(data: {
|
|
490
|
+
user_profile?: {
|
|
491
|
+
pronouns?: string | null;
|
|
492
|
+
bio?: string | null;
|
|
493
|
+
banner?: string | null;
|
|
494
|
+
accent_color?: number | null;
|
|
495
|
+
banner_color?: number | null;
|
|
496
|
+
theme?: string | null;
|
|
497
|
+
} | null;
|
|
498
|
+
mutual_guilds?: Array<{
|
|
499
|
+
id: string;
|
|
500
|
+
}> | null;
|
|
501
|
+
mutual_guild_ids?: string[] | null;
|
|
502
|
+
connected_accounts?: Array<{
|
|
503
|
+
name?: string | null;
|
|
504
|
+
type?: string | null;
|
|
505
|
+
}> | null;
|
|
506
|
+
}): ProfilePayload;
|
|
507
|
+
/** Small emoji payload from pack list/create. */
|
|
508
|
+
interface PackEmojiPayload {
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
animated?: boolean;
|
|
512
|
+
}
|
|
513
|
+
/** Small sticker payload from pack list/create. */
|
|
514
|
+
interface PackStickerPayload {
|
|
515
|
+
id: string;
|
|
516
|
+
name: string;
|
|
517
|
+
description: string;
|
|
518
|
+
tags: string[];
|
|
519
|
+
animated: boolean;
|
|
520
|
+
nsfw: boolean;
|
|
521
|
+
}
|
|
522
|
+
/** Invite metadata payload (camelCase). */
|
|
523
|
+
interface PackInvitePayload {
|
|
524
|
+
code: string;
|
|
525
|
+
maxUses?: number;
|
|
526
|
+
maxAge?: number;
|
|
527
|
+
uses?: number;
|
|
528
|
+
temporary?: boolean;
|
|
529
|
+
unique?: boolean;
|
|
530
|
+
createdAt?: string;
|
|
531
|
+
expiresAt?: string | null;
|
|
532
|
+
}
|
|
533
|
+
/** Bulk create result (camelCase). */
|
|
534
|
+
interface PackBulkCreatePayload<T> {
|
|
535
|
+
success: T[];
|
|
536
|
+
failed: Array<{
|
|
537
|
+
name: string;
|
|
538
|
+
error: string;
|
|
539
|
+
}>;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/** Base class for all Fluxer structures. Provides the client reference. */
|
|
543
|
+
declare abstract class Base {
|
|
544
|
+
/** The client instance this structure belongs to. */
|
|
545
|
+
abstract readonly client: Client;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
type UploadFileForSend = {
|
|
549
|
+
id: number;
|
|
550
|
+
filename: string;
|
|
551
|
+
data: ArrayBuffer | Uint8Array | Buffer;
|
|
552
|
+
/** MIME type sent on the plan request and used for singlepart PUT. */
|
|
553
|
+
contentType: string;
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
/** Represents a custom emoji in a guild. */
|
|
557
|
+
declare class GuildEmoji extends Base {
|
|
558
|
+
readonly client: Client;
|
|
559
|
+
readonly id: string;
|
|
560
|
+
readonly guildId: string;
|
|
561
|
+
name: string;
|
|
562
|
+
readonly animated: boolean;
|
|
563
|
+
/** @param data - API emoji from GET /guilds/{id}/emojis or guild emoji events */
|
|
564
|
+
constructor(client: Client, data: APIEmoji & {
|
|
565
|
+
guild_id?: string;
|
|
566
|
+
}, guildId: string);
|
|
567
|
+
/** CDN URL for this emoji image. */
|
|
568
|
+
get url(): string;
|
|
569
|
+
/** Emoji identifier for use in reactions: `name:id` */
|
|
570
|
+
get identifier(): string;
|
|
571
|
+
/** Delete this emoji. Requires Manage Emojis and Stickers permission. */
|
|
572
|
+
delete(): Promise<void>;
|
|
573
|
+
/**
|
|
574
|
+
* Edit this emoji's name.
|
|
575
|
+
* Requires Manage Emojis and Stickers permission.
|
|
576
|
+
*/
|
|
577
|
+
edit(options: {
|
|
578
|
+
name: string;
|
|
579
|
+
}): Promise<GuildEmoji>;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Manages guild members with a Collection-like API.
|
|
584
|
+
* Extends Collection so you can use .get(), .set(), .filter(), etc.
|
|
585
|
+
*
|
|
586
|
+
*/
|
|
587
|
+
declare class GuildMemberManager extends Collection<string, GuildMember> {
|
|
588
|
+
private readonly guild;
|
|
589
|
+
constructor(guild: Guild);
|
|
590
|
+
/**
|
|
591
|
+
* Cache a member with optional FIFO eviction when `options.cache.members` is set.
|
|
592
|
+
*/
|
|
593
|
+
set(key: string, value: GuildMember): this;
|
|
594
|
+
/**
|
|
595
|
+
* Get a guild member from cache or fetch from the API if not present.
|
|
596
|
+
* Convenience helper to avoid repeating `guild.members.get(userId) ?? (await guild.fetchMember(userId))`.
|
|
597
|
+
* @param userId - Snowflake of the user
|
|
598
|
+
* @returns The guild member
|
|
599
|
+
* @throws FluxerError with MEMBER_NOT_FOUND if user is not in the guild (404)
|
|
600
|
+
* @example
|
|
601
|
+
* const member = await guild.members.resolve(userId);
|
|
602
|
+
* console.log(member.displayName);
|
|
603
|
+
*/
|
|
604
|
+
resolve(userId: string): Promise<GuildMember>;
|
|
605
|
+
/**
|
|
606
|
+
* The current bot user as a GuildMember in this guild.
|
|
607
|
+
* Returns null if the bot's member is not cached or client.user is null.
|
|
608
|
+
* Use fetchMe() to load the bot's member when not cached.
|
|
609
|
+
*
|
|
610
|
+
* @example
|
|
611
|
+
* const perms = guild.members.me?.permissions;
|
|
612
|
+
* if (perms?.has(PermissionFlags.BanMembers)) { ... }
|
|
613
|
+
*/
|
|
614
|
+
get me(): GuildMember | null;
|
|
615
|
+
/**
|
|
616
|
+
* Fetch the current bot user as a GuildMember in this guild.
|
|
617
|
+
* Caches the result in guild.members.
|
|
618
|
+
*
|
|
619
|
+
* @throws FluxerError with CLIENT_NOT_READY if client.user is null
|
|
620
|
+
* @example
|
|
621
|
+
* const me = await guild.members.fetchMe();
|
|
622
|
+
* console.log(me.displayName);
|
|
623
|
+
*/
|
|
624
|
+
fetchMe(): Promise<GuildMember>;
|
|
625
|
+
/**
|
|
626
|
+
* Remove members matching a filter (or all if omitted). Returns count removed.
|
|
627
|
+
*/
|
|
628
|
+
sweep(filter?: (member: GuildMember, id: string) => boolean): number;
|
|
629
|
+
/**
|
|
630
|
+
* Fetch guild members with pagination. GET /guilds/{id}/members.
|
|
631
|
+
* @param options - limit (1-1000), after (user ID for pagination)
|
|
632
|
+
* @returns Array of GuildMember objects (cached in guild.members)
|
|
633
|
+
*/
|
|
634
|
+
fetch(options?: {
|
|
635
|
+
limit?: number;
|
|
636
|
+
after?: string;
|
|
637
|
+
}): Promise<GuildMember[]>;
|
|
638
|
+
/**
|
|
639
|
+
* Search guild members. POST /guilds/{id}/members-search.
|
|
640
|
+
* @param options - CamelCase search query, filters, and pagination
|
|
641
|
+
* @returns CamelCase search results; `member` is set from cache when present
|
|
642
|
+
* @example
|
|
643
|
+
* const { members } = await guild.members.search({ query: 'alex', limit: 25 });
|
|
644
|
+
*/
|
|
645
|
+
search(options?: GuildMemberSearchOptions): Promise<GuildMemberSearchPayload>;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* User (or bot) on Fluxer.
|
|
650
|
+
* Cached in {@link Client.users} and hydrated via {@link Client.getOrCreateUser}.
|
|
651
|
+
*/
|
|
652
|
+
declare class User extends Base {
|
|
653
|
+
/** Parent client instance. */
|
|
654
|
+
readonly client: Client;
|
|
655
|
+
/** User snowflake ID. */
|
|
656
|
+
readonly id: string;
|
|
657
|
+
/** Username (not unique across the platform). */
|
|
658
|
+
username: string;
|
|
659
|
+
/** Legacy discriminator (e.g., `"0001"`). */
|
|
660
|
+
discriminator: string;
|
|
661
|
+
/** Display name (preferred over username). */
|
|
662
|
+
globalName: string | null;
|
|
663
|
+
/** Avatar hash (null = default avatar). */
|
|
664
|
+
avatar: string | null;
|
|
665
|
+
/** Whether this user is a bot. */
|
|
666
|
+
readonly bot: boolean;
|
|
667
|
+
/** Accent color for the profile (24-bit RGB). */
|
|
668
|
+
avatarColor: number | null;
|
|
669
|
+
/** User flags bitfield (badges, staff, etc.). */
|
|
670
|
+
flags: number | null;
|
|
671
|
+
/** Whether this is a system user (e.g., Fluxer System). */
|
|
672
|
+
readonly system: boolean;
|
|
673
|
+
/** Banner hash for profile. */
|
|
674
|
+
banner: string | null;
|
|
675
|
+
constructor(client: Client, data: APIUserPartial);
|
|
676
|
+
/** @internal */
|
|
677
|
+
_patch(data: APIUserPartial): void;
|
|
678
|
+
private cdnOpts;
|
|
679
|
+
/**
|
|
680
|
+
* User avatar CDN URL (null if no custom avatar set).
|
|
681
|
+
* @param options - Size and extension options
|
|
682
|
+
* @returns CDN URL or null
|
|
683
|
+
*/
|
|
684
|
+
avatarURL(options?: {
|
|
685
|
+
size?: number;
|
|
686
|
+
extension?: string;
|
|
687
|
+
}): string | null;
|
|
688
|
+
/**
|
|
689
|
+
* User avatar URL or default avatar fallback.
|
|
690
|
+
* @param options - Size and extension options
|
|
691
|
+
* @returns CDN URL (never null)
|
|
692
|
+
*/
|
|
693
|
+
displayAvatarURL(options?: {
|
|
694
|
+
size?: number;
|
|
695
|
+
extension?: string;
|
|
696
|
+
}): string;
|
|
697
|
+
/**
|
|
698
|
+
* User banner CDN URL (null if no banner set).
|
|
699
|
+
* @param options - Size and extension options
|
|
700
|
+
* @returns CDN URL or null
|
|
701
|
+
*/
|
|
702
|
+
bannerURL(options?: {
|
|
703
|
+
size?: number;
|
|
704
|
+
extension?: string;
|
|
705
|
+
}): string | null;
|
|
706
|
+
/**
|
|
707
|
+
* Format as a mention string (`<@id>`).
|
|
708
|
+
* @returns Mention syntax
|
|
709
|
+
*/
|
|
710
|
+
toString(): string;
|
|
711
|
+
/**
|
|
712
|
+
* Create or fetch the DM channel with this user.
|
|
713
|
+
* @returns DM channel instance (cached if already open)
|
|
714
|
+
*/
|
|
715
|
+
createDM(): Promise<DMChannel>;
|
|
716
|
+
/**
|
|
717
|
+
* Send a DM to this user.
|
|
718
|
+
* @param options - Message content or {@link MessageSendOptions}
|
|
719
|
+
* @returns Sent message
|
|
720
|
+
*/
|
|
721
|
+
send(options: MessageSendOptions): Promise<Message>;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/** Represents a ban in a guild. */
|
|
725
|
+
declare class GuildBan extends Base {
|
|
726
|
+
readonly client: Client;
|
|
727
|
+
readonly guildId: string;
|
|
728
|
+
readonly user: User;
|
|
729
|
+
readonly reason: string | null;
|
|
730
|
+
/** ISO timestamp when a temporary ban expires. Null for permanent bans. */
|
|
731
|
+
readonly expiresAt: string | null;
|
|
732
|
+
/** @param data - API ban from GET /guilds/{id}/bans or gateway GUILD_BAN_ADD */
|
|
733
|
+
constructor(client: Client, data: APIBan & {
|
|
734
|
+
guild_id?: string;
|
|
735
|
+
}, guildId: string);
|
|
736
|
+
/**
|
|
737
|
+
* Remove this ban (unban the user).
|
|
738
|
+
* Requires Ban Members permission.
|
|
739
|
+
*/
|
|
740
|
+
unban(): Promise<void>;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/** Represents a custom sticker in a guild. */
|
|
744
|
+
declare class GuildSticker extends Base {
|
|
745
|
+
readonly client: Client;
|
|
746
|
+
readonly id: string;
|
|
747
|
+
readonly guildId: string;
|
|
748
|
+
name: string;
|
|
749
|
+
description: string;
|
|
750
|
+
readonly tags: string[];
|
|
751
|
+
readonly animated: boolean;
|
|
752
|
+
/** Whether this sticker is classified as NSFW */
|
|
753
|
+
nsfw: boolean;
|
|
754
|
+
/** @param data - API sticker from GET /guilds/{id}/stickers or guild sticker events */
|
|
755
|
+
constructor(client: Client, data: APISticker & {
|
|
756
|
+
guild_id?: string;
|
|
757
|
+
}, guildId: string);
|
|
758
|
+
/** CDN URL for this sticker image. */
|
|
759
|
+
get url(): string;
|
|
760
|
+
/** Delete this sticker. Requires Manage Emojis and Stickers permission. */
|
|
761
|
+
delete(): Promise<void>;
|
|
762
|
+
/**
|
|
763
|
+
* Edit this sticker's name and/or description.
|
|
764
|
+
* Requires Manage Emojis and Stickers permission.
|
|
765
|
+
*/
|
|
766
|
+
edit(options: {
|
|
767
|
+
name?: string;
|
|
768
|
+
description?: string;
|
|
769
|
+
}): Promise<GuildSticker>;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Invite to a guild channel, group DM, or emoji/sticker pack.
|
|
774
|
+
* Discriminate with `type` / `isGuild()` / `isGroupDM()` / `isPack()`.
|
|
775
|
+
*/
|
|
776
|
+
declare class Invite extends Base {
|
|
777
|
+
readonly client: Client;
|
|
778
|
+
readonly code: string;
|
|
779
|
+
readonly type: InviteType;
|
|
780
|
+
readonly guild: APIGuildPartial | null;
|
|
781
|
+
readonly channel: APIChannelPartial | null;
|
|
782
|
+
readonly pack: APIPackInviteInfo | null;
|
|
783
|
+
readonly inviter: User | null;
|
|
784
|
+
readonly memberCount: number | null;
|
|
785
|
+
readonly presenceCount: number | null;
|
|
786
|
+
readonly expiresAt: string | null;
|
|
787
|
+
readonly temporary: boolean | null;
|
|
788
|
+
readonly createdAt: string | null;
|
|
789
|
+
readonly uses: number | null;
|
|
790
|
+
readonly maxUses: number | null;
|
|
791
|
+
readonly maxAge: number | null;
|
|
792
|
+
constructor(client: Client, data: APIInvite);
|
|
793
|
+
isGuild(): boolean;
|
|
794
|
+
isGroupDM(): boolean;
|
|
795
|
+
isPack(): boolean;
|
|
796
|
+
/** Full invite URL (uses this client's instance invite base). */
|
|
797
|
+
get url(): string;
|
|
798
|
+
/** Cached guild for guild invites, else null. */
|
|
799
|
+
getGuild(): Guild | null;
|
|
800
|
+
/** Fetch invite metadata by code or URL (does not join). */
|
|
801
|
+
static fetch(client: Client, codeOrUrl: string): Promise<Invite>;
|
|
802
|
+
/** Delete this invite. Requires Manage Guild or Create Instant Invite. */
|
|
803
|
+
delete(): Promise<void>;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* CamelCase options for creating a guild role.
|
|
808
|
+
* Serialized to snake_case wire fields before REST.
|
|
809
|
+
*/
|
|
810
|
+
interface RoleCreateOptions {
|
|
811
|
+
/** Role name. */
|
|
812
|
+
name?: string;
|
|
813
|
+
/** Permissions bitfield string or {@link PermissionResolvable}. */
|
|
814
|
+
permissions?: string | PermissionResolvable;
|
|
815
|
+
/** Role color as 24-bit RGB. */
|
|
816
|
+
color?: number;
|
|
817
|
+
/** Whether the role is displayed separately in the member list. */
|
|
818
|
+
hoist?: boolean;
|
|
819
|
+
/** Whether the role can be @mentioned. */
|
|
820
|
+
mentionable?: boolean;
|
|
821
|
+
/** Unicode emoji for the role. */
|
|
822
|
+
unicodeEmoji?: string | null;
|
|
823
|
+
/** Sort position in the role list. */
|
|
824
|
+
position?: number;
|
|
825
|
+
/** Hoisted position (visual separator group). */
|
|
826
|
+
hoistPosition?: number | null;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* CamelCase options for editing a guild role.
|
|
830
|
+
* Serialized to snake_case wire fields before REST.
|
|
831
|
+
*/
|
|
832
|
+
type RoleEditOptions = RoleCreateOptions;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Guild role.
|
|
836
|
+
* Cached in {@link Guild.roles}; permissions computed via {@link GuildMember.permissions}.
|
|
837
|
+
*/
|
|
838
|
+
declare class Role extends Base {
|
|
839
|
+
/** Parent client instance. */
|
|
840
|
+
readonly client: Client;
|
|
841
|
+
/** Role snowflake ID. */
|
|
842
|
+
readonly id: string;
|
|
843
|
+
/** Guild this role belongs to. */
|
|
844
|
+
readonly guildId: string;
|
|
845
|
+
/** Role name. */
|
|
846
|
+
name: string;
|
|
847
|
+
/** Role color (24-bit RGB). */
|
|
848
|
+
color: number;
|
|
849
|
+
/** Role position (higher = above). */
|
|
850
|
+
position: number;
|
|
851
|
+
/** @internal Raw permissions bitfield string. */
|
|
852
|
+
_permissions: string;
|
|
853
|
+
/** Whether this role is hoisted (shown separately in member list). */
|
|
854
|
+
hoist: boolean;
|
|
855
|
+
/** Whether this role is mentionable. */
|
|
856
|
+
mentionable: boolean;
|
|
857
|
+
/** Unicode emoji for this role (null = none). */
|
|
858
|
+
unicodeEmoji: string | null;
|
|
859
|
+
/** Hoist position (null = not hoisted). */
|
|
860
|
+
hoistPosition: number | null;
|
|
861
|
+
constructor(client: Client, data: APIRole, guildId: string);
|
|
862
|
+
/**
|
|
863
|
+
* Permissions bitfield (Administrator grants all permissions).
|
|
864
|
+
*/
|
|
865
|
+
get permissions(): PermissionsBitField;
|
|
866
|
+
/**
|
|
867
|
+
* Format as a mention string (`<@&id>`).
|
|
868
|
+
* @returns Mention syntax
|
|
869
|
+
*/
|
|
870
|
+
toString(): string;
|
|
871
|
+
/** @internal */
|
|
872
|
+
_patch(data: APIRole): void;
|
|
873
|
+
/**
|
|
874
|
+
* Snapshot for role-update events (before in-place patch).
|
|
875
|
+
* @internal
|
|
876
|
+
*/
|
|
877
|
+
_clone(): Role;
|
|
878
|
+
/**
|
|
879
|
+
* PATCH role. Requires Manage Roles.
|
|
880
|
+
* @param options - CamelCase fields to update
|
|
881
|
+
* @returns This role instance (updated in-place)
|
|
882
|
+
*/
|
|
883
|
+
edit(options: RoleEditOptions): Promise<Role>;
|
|
884
|
+
/**
|
|
885
|
+
* DELETE role. Requires Manage Roles.
|
|
886
|
+
*/
|
|
887
|
+
delete(): Promise<void>;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/** Execute-webhook options: shared message fields plus username/avatar overrides. */
|
|
891
|
+
type WebhookSendOptions = Pick<MessageSendOptions, 'content' | 'embeds' | 'tts' | 'allowedMentions' | 'files' | 'attachments'> & {
|
|
892
|
+
username?: string;
|
|
893
|
+
avatarUrl?: string;
|
|
894
|
+
};
|
|
895
|
+
/** Edit a previously sent webhook message (`EmbedBuilder` values are serialized). */
|
|
896
|
+
interface WebhookMessageEditOptions {
|
|
897
|
+
content?: string | null;
|
|
898
|
+
embeds?: (RESTPostAPIEmbed | EmbedBuilder)[];
|
|
899
|
+
attachments?: MessageAttachmentEdit[];
|
|
900
|
+
flags?: number;
|
|
901
|
+
allowedMentions?: AllowedMentionsOptions;
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* Incoming webhook. Token is only present after create / `fromToken`;
|
|
905
|
+
* fetched webhooks use bot auth and cannot execute.
|
|
906
|
+
* @see {@link Webhook.fromToken} to construct from URL
|
|
907
|
+
* @see {@link Webhook.fetch} to fetch by ID with bot auth
|
|
908
|
+
*/
|
|
909
|
+
declare class Webhook extends Base {
|
|
910
|
+
/** Parent client instance. */
|
|
911
|
+
readonly client: Client;
|
|
912
|
+
/** Webhook snowflake ID. */
|
|
913
|
+
readonly id: string;
|
|
914
|
+
/** Guild this webhook belongs to. */
|
|
915
|
+
readonly guildId: string;
|
|
916
|
+
/** Channel this webhook posts to. */
|
|
917
|
+
channelId: string;
|
|
918
|
+
/** Webhook name. */
|
|
919
|
+
name: string;
|
|
920
|
+
/** Webhook avatar hash (null = default). */
|
|
921
|
+
avatar: string | null;
|
|
922
|
+
/** Present after create / `fromToken`; omitted when fetching by ID. */
|
|
923
|
+
readonly token: string | null;
|
|
924
|
+
/** The user that created this webhook. */
|
|
925
|
+
readonly user: User;
|
|
926
|
+
constructor(client: Client, data: APIWebhook & {
|
|
927
|
+
token?: string | null;
|
|
928
|
+
});
|
|
929
|
+
avatarURL(options?: {
|
|
930
|
+
size?: number;
|
|
931
|
+
extension?: string;
|
|
932
|
+
}): string | null;
|
|
933
|
+
/** Delete this webhook (token auth when available, otherwise bot auth). */
|
|
934
|
+
delete(): Promise<void>;
|
|
935
|
+
/**
|
|
936
|
+
* Edit name/avatar. With bot auth (no token), `channelId` may also be set.
|
|
937
|
+
*/
|
|
938
|
+
edit(options: WebhookEditOptions): Promise<this>;
|
|
939
|
+
/**
|
|
940
|
+
* Execute the webhook. Requires token.
|
|
941
|
+
* @param wait - When true, appends `?wait=true` and returns the created `Message`.
|
|
942
|
+
*/
|
|
943
|
+
send(options: string | WebhookSendOptions, wait?: boolean): Promise<Message | undefined>;
|
|
944
|
+
/** Edit a message previously sent by this webhook. Requires token. */
|
|
945
|
+
editMessage(messageId: string, options: WebhookMessageEditOptions): Promise<Message>;
|
|
946
|
+
/** Fetch a message sent by this webhook. Requires token. */
|
|
947
|
+
fetchMessage(messageId: string): Promise<Message>;
|
|
948
|
+
/** Delete a message sent by this webhook. Requires token. */
|
|
949
|
+
deleteMessage(messageId: string): Promise<void>;
|
|
950
|
+
/** Fetch a webhook by ID (bot auth; no token). */
|
|
951
|
+
static fetch(client: Client, webhookId: string): Promise<Webhook>;
|
|
952
|
+
/** Build a webhook from a stored id + token (e.g. webhook URL). */
|
|
953
|
+
static fromToken(client: Client, webhookId: string, token: string, options?: {
|
|
954
|
+
channelId?: string;
|
|
955
|
+
guildId?: string;
|
|
956
|
+
name?: string;
|
|
957
|
+
}): Webhook;
|
|
958
|
+
private requireToken;
|
|
959
|
+
private messageRoute;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
type GuildData = APIGuild & {
|
|
963
|
+
roles?: APIRole[];
|
|
964
|
+
ownerId?: string;
|
|
965
|
+
};
|
|
966
|
+
/** CamelCase SDK options for PATCH /guilds/{id}. */
|
|
967
|
+
type GuildEditOptions = {
|
|
968
|
+
name?: string;
|
|
969
|
+
icon?: string | null;
|
|
970
|
+
systemChannelId?: string | null;
|
|
971
|
+
systemChannelFlags?: number | SystemChannelFlagsValue;
|
|
972
|
+
afkChannelId?: string | null;
|
|
973
|
+
afkTimeout?: number;
|
|
974
|
+
defaultMessageNotifications?: DefaultMessageNotifications;
|
|
975
|
+
verificationLevel?: GuildVerificationLevel;
|
|
976
|
+
mfaLevel?: GuildMFALevel;
|
|
977
|
+
explicitContentFilter?: GuildExplicitContentFilter;
|
|
978
|
+
banner?: string | null;
|
|
979
|
+
splash?: string | null;
|
|
980
|
+
embedSplash?: string | null;
|
|
981
|
+
splashCardAlignment?: SplashCardAlignment;
|
|
982
|
+
nsfwLevel?: GuildNSFWLevel;
|
|
983
|
+
features?: GuildFeature[];
|
|
984
|
+
};
|
|
985
|
+
type GuildBanOptions = {
|
|
986
|
+
reason?: string;
|
|
987
|
+
/** Delete message history for this many days (0–7). */
|
|
988
|
+
deleteMessageDays?: number;
|
|
989
|
+
/** Temporary ban duration in seconds. */
|
|
990
|
+
banDurationSeconds?: number;
|
|
991
|
+
};
|
|
992
|
+
type ChannelPositionUpdate = {
|
|
993
|
+
id: string;
|
|
994
|
+
position?: number;
|
|
995
|
+
parentId?: string | null;
|
|
996
|
+
lockPermissions?: boolean;
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
/** Represents a Fluxer guild (server). */
|
|
1000
|
+
declare class Guild extends Base {
|
|
1001
|
+
/** The {@link Client} that instantiated this guild. */
|
|
1002
|
+
readonly client: Client;
|
|
1003
|
+
/** Snowflake ID of this guild. */
|
|
1004
|
+
readonly id: string;
|
|
1005
|
+
/** Guild name. */
|
|
1006
|
+
name: string;
|
|
1007
|
+
/** Icon hash (use {@link iconURL} to get full CDN URL). */
|
|
1008
|
+
icon: string | null;
|
|
1009
|
+
/** Banner hash (use {@link bannerURL} to get full CDN URL). */
|
|
1010
|
+
banner: string | null;
|
|
1011
|
+
/** User ID of the guild owner. */
|
|
1012
|
+
ownerId: string;
|
|
1013
|
+
/** Invite splash hash (use {@link splashURL} to get full CDN URL). */
|
|
1014
|
+
splash: string | null;
|
|
1015
|
+
/** Vanity invite code if the guild has one. */
|
|
1016
|
+
vanityURLCode: string | null;
|
|
1017
|
+
/** Features enabled for this guild. */
|
|
1018
|
+
features: GuildFeature[];
|
|
1019
|
+
/** Verification level required for members to send messages. */
|
|
1020
|
+
verificationLevel: GuildVerificationLevel;
|
|
1021
|
+
/** Default notification level for members. */
|
|
1022
|
+
defaultMessageNotifications: DefaultMessageNotifications;
|
|
1023
|
+
/** Explicit content filter level. */
|
|
1024
|
+
explicitContentFilter: GuildExplicitContentFilter;
|
|
1025
|
+
/** AFK voice channel ID, or null if none. */
|
|
1026
|
+
afkChannelId: string | null;
|
|
1027
|
+
/** AFK timeout in seconds. */
|
|
1028
|
+
afkTimeout: number;
|
|
1029
|
+
/** System messages channel ID, or null if none. */
|
|
1030
|
+
systemChannelId: string | null;
|
|
1031
|
+
/** Rules channel ID (for Community guilds), or null if none. */
|
|
1032
|
+
rulesChannelId: string | null;
|
|
1033
|
+
/** NSFW level for this guild. */
|
|
1034
|
+
nsfwLevel: GuildNSFWLevel;
|
|
1035
|
+
/** MFA level required for moderation actions. */
|
|
1036
|
+
mfaLevel: GuildMFALevel;
|
|
1037
|
+
/** Banner width in pixels. */
|
|
1038
|
+
bannerWidth?: number | null;
|
|
1039
|
+
/** Banner height in pixels. */
|
|
1040
|
+
bannerHeight?: number | null;
|
|
1041
|
+
/** Splash width in pixels. */
|
|
1042
|
+
splashWidth?: number | null;
|
|
1043
|
+
/** Splash height in pixels. */
|
|
1044
|
+
splashHeight?: number | null;
|
|
1045
|
+
/** Member manager for this guild (fetch/add/remove members). */
|
|
1046
|
+
members: GuildMemberManager;
|
|
1047
|
+
/** Cached channels in this guild. */
|
|
1048
|
+
channels: Collection<string, GuildChannel>;
|
|
1049
|
+
/** Cached roles in this guild. */
|
|
1050
|
+
roles: Collection<string, Role>;
|
|
1051
|
+
/** Cached emojis in this guild. */
|
|
1052
|
+
emojis: Collection<string, GuildEmoji>;
|
|
1053
|
+
/** Cached stickers in this guild. */
|
|
1054
|
+
stickers: Collection<string, GuildSticker>;
|
|
1055
|
+
/**
|
|
1056
|
+
* Construct a guild from API data.
|
|
1057
|
+
* @param data - API guild from GET /guilds/{id} or gateway GUILD_CREATE
|
|
1058
|
+
*/
|
|
1059
|
+
constructor(client: Client, data: GuildData);
|
|
1060
|
+
/** Patch metadata in place; preserves members/channels/emojis/stickers caches. */
|
|
1061
|
+
_patch(data: GuildData): void;
|
|
1062
|
+
/** Get the full CDN URL for the guild's icon (or null). */
|
|
1063
|
+
iconURL(options?: {
|
|
1064
|
+
size?: number;
|
|
1065
|
+
}): string | null;
|
|
1066
|
+
/** Get the full CDN URL for the guild's banner (or null). */
|
|
1067
|
+
bannerURL(options?: {
|
|
1068
|
+
size?: number;
|
|
1069
|
+
}): string | null;
|
|
1070
|
+
/** Get the full CDN URL for the guild's invite splash (or null). */
|
|
1071
|
+
splashURL(options?: {
|
|
1072
|
+
size?: number;
|
|
1073
|
+
}): string | null;
|
|
1074
|
+
/**
|
|
1075
|
+
* Create a channel. `data.type`: 0=text, 2=voice, 4=category, 998=link (set `url`).
|
|
1076
|
+
* Requires Manage Channels.
|
|
1077
|
+
*/
|
|
1078
|
+
createChannel(data: ChannelCreateRequest): Promise<GuildChannel>;
|
|
1079
|
+
/** Fetch all channels in this guild from the API. */
|
|
1080
|
+
fetchChannels(): Promise<GuildChannel[]>;
|
|
1081
|
+
/** Update channel positions (reordering). */
|
|
1082
|
+
setChannelPositions(updates: ChannelPositionUpdate[]): Promise<void>;
|
|
1083
|
+
/** Fetch all webhooks in this guild. */
|
|
1084
|
+
fetchWebhooks(): Promise<Webhook[]>;
|
|
1085
|
+
/** Fetch all invites in this guild. Requires Manage Guild. */
|
|
1086
|
+
fetchInvites(): Promise<Invite[]>;
|
|
1087
|
+
/** Fetch a specific invite by code or URL. */
|
|
1088
|
+
fetchInvite(codeOrUrl: string): Promise<Invite>;
|
|
1089
|
+
/** Fetch a guild member by user ID. */
|
|
1090
|
+
fetchMember(userId: string): Promise<GuildMember>;
|
|
1091
|
+
/** Fetch the bot's own member object in this guild. */
|
|
1092
|
+
fetchMe(): Promise<GuildMember>;
|
|
1093
|
+
/**
|
|
1094
|
+
* Create a role. `permissions` accepts a bitfield string or {@link PermissionResolvable}.
|
|
1095
|
+
* @example
|
|
1096
|
+
* await guild.createRole({ name: 'Mod', permissions: ['KickMembers', 'BanMembers'] });
|
|
1097
|
+
*/
|
|
1098
|
+
createRole(options?: RoleCreateOptions): Promise<Role>;
|
|
1099
|
+
/** Fetch all roles in this guild from the API. */
|
|
1100
|
+
fetchRoles(): Promise<Role[]>;
|
|
1101
|
+
/** Fetch a specific role by ID. */
|
|
1102
|
+
fetchRole(roleId: string): Promise<Role>;
|
|
1103
|
+
/** Resolve role mention, snowflake, or name to a role ID. */
|
|
1104
|
+
resolveRoleId(arg: string): Promise<string | null>;
|
|
1105
|
+
/** Update role positions (reordering). Returns cached {@link Role} instances. */
|
|
1106
|
+
setRolePositions(updates: Array<{
|
|
1107
|
+
id: string;
|
|
1108
|
+
position?: number;
|
|
1109
|
+
}>): Promise<Role[]>;
|
|
1110
|
+
/** Update role hoist positions (visual separator groups). Returns cached {@link Role} instances. */
|
|
1111
|
+
setRoleHoistPositions(updates: Array<{
|
|
1112
|
+
id: string;
|
|
1113
|
+
hoistPosition?: number;
|
|
1114
|
+
}>): Promise<Role[]>;
|
|
1115
|
+
/** Reset all role hoist positions to zero. Returns cached {@link Role} instances. */
|
|
1116
|
+
resetRoleHoistPositions(): Promise<Role[]>;
|
|
1117
|
+
/** Ban a user from the guild. Requires Ban Members. `ban_duration_seconds`: 0 = permanent. */
|
|
1118
|
+
ban(userId: string, options?: GuildBanOptions): Promise<void>;
|
|
1119
|
+
/** Fetch all bans in this guild. Requires Ban Members. */
|
|
1120
|
+
fetchBans(): Promise<GuildBan[]>;
|
|
1121
|
+
/** Unban a user from the guild. Requires Ban Members. */
|
|
1122
|
+
unban(userId: string): Promise<void>;
|
|
1123
|
+
/** Kick a user from the guild. Requires Kick Members. */
|
|
1124
|
+
kick(userId: string): Promise<void>;
|
|
1125
|
+
/** Fetch all emojis in this guild from the API. */
|
|
1126
|
+
fetchEmojis(): Promise<GuildEmoji[]>;
|
|
1127
|
+
/** Fetch a specific emoji by ID. */
|
|
1128
|
+
fetchEmoji(emojiId: string): Promise<GuildEmoji>;
|
|
1129
|
+
/** Create a new emoji in this guild. Requires Manage Emojis and Stickers. */
|
|
1130
|
+
createEmoji(options: {
|
|
1131
|
+
name: string;
|
|
1132
|
+
image: string;
|
|
1133
|
+
}): Promise<GuildEmoji>;
|
|
1134
|
+
/** Clone an emoji from another guild. Requires Manage Emojis and Stickers. */
|
|
1135
|
+
cloneEmoji(sourceEmojiId: string): Promise<GuildEmoji>;
|
|
1136
|
+
/** Create multiple emojis at once (bulk operation). */
|
|
1137
|
+
createEmojisBulk(emojiList: Array<{
|
|
1138
|
+
name: string;
|
|
1139
|
+
image: string;
|
|
1140
|
+
}>): Promise<{
|
|
1141
|
+
success: GuildEmoji[];
|
|
1142
|
+
failed: Array<{
|
|
1143
|
+
name: string;
|
|
1144
|
+
error: string;
|
|
1145
|
+
}>;
|
|
1146
|
+
}>;
|
|
1147
|
+
/** Create a new sticker in this guild. Requires Manage Emojis and Stickers. */
|
|
1148
|
+
createSticker(options: {
|
|
1149
|
+
name: string;
|
|
1150
|
+
image: string;
|
|
1151
|
+
description?: string | null;
|
|
1152
|
+
tags?: string[];
|
|
1153
|
+
}): Promise<GuildSticker>;
|
|
1154
|
+
/** Clone a sticker from another guild. Requires Manage Emojis and Stickers. */
|
|
1155
|
+
cloneSticker(sourceStickerId: string): Promise<GuildSticker>;
|
|
1156
|
+
/** Create multiple stickers at once (bulk operation). */
|
|
1157
|
+
createStickersBulk(stickerList: Array<{
|
|
1158
|
+
name: string;
|
|
1159
|
+
image: string;
|
|
1160
|
+
description?: string;
|
|
1161
|
+
tags?: string[];
|
|
1162
|
+
}>): Promise<{
|
|
1163
|
+
success: GuildSticker[];
|
|
1164
|
+
failed: Array<{
|
|
1165
|
+
name: string;
|
|
1166
|
+
error: string;
|
|
1167
|
+
}>;
|
|
1168
|
+
}>;
|
|
1169
|
+
/** Fetch all stickers in this guild from the API. */
|
|
1170
|
+
fetchStickers(): Promise<GuildSticker[]>;
|
|
1171
|
+
/** Fetch a specific sticker by ID. */
|
|
1172
|
+
fetchSticker(stickerId: string): Promise<GuildSticker>;
|
|
1173
|
+
/** Fetch audit log entries. Requires View Audit Log. */
|
|
1174
|
+
fetchAuditLogs(options?: {
|
|
1175
|
+
limit?: number;
|
|
1176
|
+
before?: string;
|
|
1177
|
+
after?: string;
|
|
1178
|
+
userId?: string;
|
|
1179
|
+
actionType?: AuditLogActionType;
|
|
1180
|
+
}): Promise<AuditLogFetchPayload>;
|
|
1181
|
+
/** Edit guild settings. Requires guild owner or Administrator. */
|
|
1182
|
+
edit(options: GuildEditOptions): Promise<this>;
|
|
1183
|
+
/** Fetch the guild's vanity invite URL (if available). */
|
|
1184
|
+
fetchVanityURL(): Promise<VanityURLPayload>;
|
|
1185
|
+
/** Edit the guild's vanity invite code. */
|
|
1186
|
+
editVanityURL(code: string | null): Promise<VanityURLPayload>;
|
|
1187
|
+
/** Fetch the guild's discovery status. */
|
|
1188
|
+
fetchDiscoveryStatus(): Promise<DiscoveryStatusPayload>;
|
|
1189
|
+
/** Apply for guild discovery. */
|
|
1190
|
+
applyForDiscovery(body: DiscoveryApplicationOptions): Promise<DiscoveryApplicationPayload>;
|
|
1191
|
+
/** Edit an existing discovery application. */
|
|
1192
|
+
editDiscoveryApplication(body: DiscoveryApplicationOptions): Promise<DiscoveryApplicationPayload>;
|
|
1193
|
+
/** Withdraw the guild's discovery application. */
|
|
1194
|
+
withdrawDiscoveryApplication(): Promise<void>;
|
|
1195
|
+
/** Delete this guild (owner only). User accounts may need sudo/MFA in `options`. */
|
|
1196
|
+
delete(options?: SudoVerificationOptions): Promise<void>;
|
|
1197
|
+
/** Transfer guild ownership to another user (owner only). */
|
|
1198
|
+
transferOwnership(newOwnerId: string, password?: string): Promise<void>;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/** Role ID or Role object. */
|
|
1202
|
+
type RoleResolvable = string | Role;
|
|
1203
|
+
/**
|
|
1204
|
+
* Manages a guild member's roles (`add` / `remove` / `set` / `cache`).
|
|
1205
|
+
* Requires Manage Roles for mutations.
|
|
1206
|
+
*/
|
|
1207
|
+
declare class GuildMemberRoleManager {
|
|
1208
|
+
private readonly member;
|
|
1209
|
+
private ids;
|
|
1210
|
+
constructor(member: GuildMember, initial?: string[]);
|
|
1211
|
+
get roleIds(): readonly string[];
|
|
1212
|
+
has(roleOrId: RoleResolvable): boolean;
|
|
1213
|
+
/** Live Role objects from `guild.roles` for this member's role IDs. */
|
|
1214
|
+
get cache(): Collection<string, Role>;
|
|
1215
|
+
add(roleOrId: RoleResolvable): Promise<void>;
|
|
1216
|
+
remove(roleOrId: RoleResolvable): Promise<void>;
|
|
1217
|
+
set(roleIds: string[]): Promise<void>;
|
|
1218
|
+
/** @internal Sync from API member payload. */
|
|
1219
|
+
_patch(roleIds: string[]): void;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* Guild member — roles via {@link GuildMember.roles}, permissions via {@link permissions} / {@link permissionsIn}.
|
|
1224
|
+
* Cached per guild in {@link Guild.members}.
|
|
1225
|
+
*/
|
|
1226
|
+
declare class GuildMember extends Base {
|
|
1227
|
+
/** Parent client instance. */
|
|
1228
|
+
readonly client: Client;
|
|
1229
|
+
/** User ID (same as `user.id`). */
|
|
1230
|
+
readonly id: string;
|
|
1231
|
+
/** The underlying {@link User}. */
|
|
1232
|
+
readonly user: User;
|
|
1233
|
+
/** The guild this member belongs to. */
|
|
1234
|
+
readonly guild: Guild;
|
|
1235
|
+
/** Guild-specific nickname (null = use global name or username). */
|
|
1236
|
+
nick: string | null;
|
|
1237
|
+
/** Role manager for this member. */
|
|
1238
|
+
readonly roles: GuildMemberRoleManager;
|
|
1239
|
+
/** When this member joined the guild. */
|
|
1240
|
+
readonly joinedAt: Date;
|
|
1241
|
+
/** Timeout end date (null = not timed out). */
|
|
1242
|
+
communicationDisabledUntil: Date | null;
|
|
1243
|
+
/** Whether this member is voice-muted. */
|
|
1244
|
+
mute: boolean;
|
|
1245
|
+
/** Whether this member is voice-deafened. */
|
|
1246
|
+
deaf: boolean;
|
|
1247
|
+
/** Guild-specific avatar hash (null = use user avatar). */
|
|
1248
|
+
avatar: string | null;
|
|
1249
|
+
/** Guild-specific banner hash. */
|
|
1250
|
+
banner: string | null;
|
|
1251
|
+
/** Guild-specific accent color (24-bit RGB). */
|
|
1252
|
+
accentColor: number | null;
|
|
1253
|
+
/** Guild-specific profile flags. */
|
|
1254
|
+
profileFlags: number | null;
|
|
1255
|
+
constructor(client: Client, data: APIGuildMember & {
|
|
1256
|
+
guild_id?: string;
|
|
1257
|
+
}, guild: Guild);
|
|
1258
|
+
/**
|
|
1259
|
+
* Apply an API member payload in place (gateway GUILD_MEMBER_UPDATE / REST edit).
|
|
1260
|
+
* @internal
|
|
1261
|
+
*/
|
|
1262
|
+
_patch(data: APIGuildMember): void;
|
|
1263
|
+
/**
|
|
1264
|
+
* Snapshot for `guildMemberUpdate` old-member arg (before in-place patch).
|
|
1265
|
+
* @internal
|
|
1266
|
+
*/
|
|
1267
|
+
_clone(): GuildMember;
|
|
1268
|
+
get displayName(): string;
|
|
1269
|
+
avatarURL(options?: {
|
|
1270
|
+
size?: number;
|
|
1271
|
+
extension?: string;
|
|
1272
|
+
}): string | null;
|
|
1273
|
+
displayAvatarURL(options?: {
|
|
1274
|
+
size?: number;
|
|
1275
|
+
extension?: string;
|
|
1276
|
+
}): string;
|
|
1277
|
+
bannerURL(options?: {
|
|
1278
|
+
size?: number;
|
|
1279
|
+
extension?: string;
|
|
1280
|
+
}): string | null;
|
|
1281
|
+
/** PATCH member (`/members/@me` when editing the bot). */
|
|
1282
|
+
edit(options: GuildMemberEditOptions): Promise<this>;
|
|
1283
|
+
/**
|
|
1284
|
+
* Guild-level permissions (roles only, no channel overwrites).
|
|
1285
|
+
* @see {@link permissionsIn} for channel-specific permissions
|
|
1286
|
+
*/
|
|
1287
|
+
get permissions(): PermissionsBitField;
|
|
1288
|
+
/**
|
|
1289
|
+
* Effective permissions in a channel (roles + overwrites).
|
|
1290
|
+
* @param channel - The guild channel
|
|
1291
|
+
* @returns Computed permissions bitfield
|
|
1292
|
+
*/
|
|
1293
|
+
permissionsIn(channel: GuildChannel): PermissionsBitField;
|
|
1294
|
+
/**
|
|
1295
|
+
* Move to a voice channel, or `null` to disconnect. Requires Move Members.
|
|
1296
|
+
* @param channelId - Voice channel ID or null to disconnect
|
|
1297
|
+
* @param connectionId - Optional connection ID for multi-session scenarios
|
|
1298
|
+
*/
|
|
1299
|
+
move(channelId: string | null, connectionId?: string | null): Promise<void>;
|
|
1300
|
+
private _effectivePermissions;
|
|
1301
|
+
private _basePermissions;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
/** CamelCase emoji on reaction events. */
|
|
1305
|
+
interface ReactionEmojiPayload {
|
|
1306
|
+
id?: string;
|
|
1307
|
+
name: string;
|
|
1308
|
+
animated?: boolean;
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Payload emitted for {@link Events.MessageReactionAdd} / {@link Events.MessageReactionRemove}.
|
|
1312
|
+
*/
|
|
1313
|
+
interface MessageReactionPayload {
|
|
1314
|
+
reaction: MessageReaction;
|
|
1315
|
+
user: User;
|
|
1316
|
+
messageId: string;
|
|
1317
|
+
channelId: string;
|
|
1318
|
+
emoji: ReactionEmojiPayload;
|
|
1319
|
+
userId: string;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Payload emitted for {@link Events.GuildRoleDelete}.
|
|
1323
|
+
*/
|
|
1324
|
+
interface GuildRoleDeletePayload {
|
|
1325
|
+
roleId: string;
|
|
1326
|
+
guildId: string;
|
|
1327
|
+
role: Role | null;
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Payload emitted for {@link Events.MessageDeleteBulk}.
|
|
1331
|
+
* Normalized from `GatewayMessageDeleteBulkDispatchData`.
|
|
1332
|
+
*/
|
|
1333
|
+
interface MessageDeleteBulkPayload {
|
|
1334
|
+
/** IDs of the deleted messages. */
|
|
1335
|
+
ids: string[];
|
|
1336
|
+
/** Channel from which the messages were deleted. */
|
|
1337
|
+
channelId: string;
|
|
1338
|
+
/** Guild the channel belongs to, or `null` for DMs. */
|
|
1339
|
+
guildId: string | null;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Payload emitted for {@link Events.InviteDelete}.
|
|
1343
|
+
* Normalized from `GatewayInviteDeleteDispatchData`.
|
|
1344
|
+
*/
|
|
1345
|
+
interface InviteDeletePayload {
|
|
1346
|
+
/** Invite code that was deleted. */
|
|
1347
|
+
code: string;
|
|
1348
|
+
/** Guild the invite belonged to, or `null` for DMs / group DMs. */
|
|
1349
|
+
guildId: string | null;
|
|
1350
|
+
/** Channel the invite pointed to, or `null` if unknown. */
|
|
1351
|
+
channelId: string | null;
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Payload emitted for {@link Events.TypingStart}.
|
|
1355
|
+
* Normalized from `GatewayTypingStartDispatchData`.
|
|
1356
|
+
*/
|
|
1357
|
+
interface TypingStartPayload {
|
|
1358
|
+
/** Channel where the user started typing. */
|
|
1359
|
+
channelId: string;
|
|
1360
|
+
/** Guild the channel belongs to, or `null` for DMs. */
|
|
1361
|
+
guildId: string | null;
|
|
1362
|
+
/** ID of the user who started typing. */
|
|
1363
|
+
userId: string;
|
|
1364
|
+
/** Unix timestamp (seconds) when typing began. */
|
|
1365
|
+
timestamp: number;
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Payload emitted for {@link Events.GuildEmojisUpdate}.
|
|
1369
|
+
* Contains the fully-cached {@link GuildEmoji} instances after the update.
|
|
1370
|
+
*/
|
|
1371
|
+
interface GuildEmojisUpdatePayload {
|
|
1372
|
+
/** Guild whose emoji list changed. */
|
|
1373
|
+
guildId: string;
|
|
1374
|
+
/** Updated list of {@link GuildEmoji} instances (from cache). */
|
|
1375
|
+
emojis: GuildEmoji[];
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* Payload emitted for {@link Events.GuildStickersUpdate}.
|
|
1379
|
+
* Contains cached {@link GuildSticker} instances after the update.
|
|
1380
|
+
*/
|
|
1381
|
+
interface GuildStickersUpdatePayload {
|
|
1382
|
+
/** Guild whose sticker list changed. */
|
|
1383
|
+
guildId: string;
|
|
1384
|
+
/** Updated list of {@link GuildSticker} instances (from cache). */
|
|
1385
|
+
stickers: GuildSticker[];
|
|
1386
|
+
}
|
|
1387
|
+
/** Payload for {@link Events.MessageReactionRemoveAll}. */
|
|
1388
|
+
interface MessageReactionRemoveAllPayload {
|
|
1389
|
+
messageId: string;
|
|
1390
|
+
channelId: string;
|
|
1391
|
+
guildId: string | null;
|
|
1392
|
+
}
|
|
1393
|
+
/** Payload for {@link Events.MessageReactionRemoveEmoji}. */
|
|
1394
|
+
interface MessageReactionRemoveEmojiPayload {
|
|
1395
|
+
messageId: string;
|
|
1396
|
+
channelId: string;
|
|
1397
|
+
guildId: string | null;
|
|
1398
|
+
emoji: ReactionEmojiPayload;
|
|
1399
|
+
}
|
|
1400
|
+
/** Single entry in {@link MessageReactionAddManyPayload}. */
|
|
1401
|
+
interface MessageReactionAddManyEntry {
|
|
1402
|
+
userId: string;
|
|
1403
|
+
emoji: ReactionEmojiPayload;
|
|
1404
|
+
member: GuildMember | null;
|
|
1405
|
+
}
|
|
1406
|
+
/** Payload for {@link Events.MessageReactionAddMany}. */
|
|
1407
|
+
interface MessageReactionAddManyPayload {
|
|
1408
|
+
channelId: string;
|
|
1409
|
+
messageId: string;
|
|
1410
|
+
guildId: string | null;
|
|
1411
|
+
reactions: MessageReactionAddManyEntry[];
|
|
1412
|
+
}
|
|
1413
|
+
/** Payload for {@link Events.ChannelPinsUpdate}. */
|
|
1414
|
+
interface ChannelPinsUpdatePayload {
|
|
1415
|
+
channelId: string;
|
|
1416
|
+
guildId: string | null;
|
|
1417
|
+
lastPinTimestamp: string | null;
|
|
1418
|
+
}
|
|
1419
|
+
/** Presence activity (camelCase). */
|
|
1420
|
+
interface PresenceActivity {
|
|
1421
|
+
name: string;
|
|
1422
|
+
type: number;
|
|
1423
|
+
url?: string | null;
|
|
1424
|
+
}
|
|
1425
|
+
/** Payload for {@link Events.PresenceUpdate}. */
|
|
1426
|
+
interface PresenceUpdatePayload {
|
|
1427
|
+
userId: string;
|
|
1428
|
+
guildId: string | null;
|
|
1429
|
+
status: string | null;
|
|
1430
|
+
activities: PresenceActivity[];
|
|
1431
|
+
customStatus: {
|
|
1432
|
+
text?: string | null;
|
|
1433
|
+
emojiId?: string | null;
|
|
1434
|
+
emojiName?: string | null;
|
|
1435
|
+
} | null;
|
|
1436
|
+
}
|
|
1437
|
+
/** Payload for {@link Events.PresenceUpdateBulk}. */
|
|
1438
|
+
interface PresenceUpdateBulkPayload {
|
|
1439
|
+
guildId: string | null;
|
|
1440
|
+
presences: PresenceUpdatePayload[];
|
|
1441
|
+
}
|
|
1442
|
+
/** Payload for {@link Events.WebhooksUpdate}. */
|
|
1443
|
+
interface WebhooksUpdatePayload {
|
|
1444
|
+
channelId: string;
|
|
1445
|
+
guildId: string;
|
|
1446
|
+
}
|
|
1447
|
+
/** Payload for {@link Events.GuildMembersChunk}. */
|
|
1448
|
+
interface GuildMembersChunkPayload {
|
|
1449
|
+
guildId: string;
|
|
1450
|
+
members: GuildMember[];
|
|
1451
|
+
chunkIndex: number;
|
|
1452
|
+
chunkCount: number;
|
|
1453
|
+
notFound: string[];
|
|
1454
|
+
nonce: string | null;
|
|
1455
|
+
}
|
|
1456
|
+
/** Audit log change (camelCase). */
|
|
1457
|
+
interface AuditLogChange {
|
|
1458
|
+
key: string;
|
|
1459
|
+
oldValue?: string | number | boolean | null;
|
|
1460
|
+
newValue?: string | number | boolean | null;
|
|
1461
|
+
}
|
|
1462
|
+
/** Payload for {@link Events.GuildAuditLogEntryCreate} and audit fetch entries. */
|
|
1463
|
+
interface AuditLogEntryPayload {
|
|
1464
|
+
id: string;
|
|
1465
|
+
actionType: number;
|
|
1466
|
+
userId: string | null;
|
|
1467
|
+
targetId: string | null;
|
|
1468
|
+
reason: string | null;
|
|
1469
|
+
options: Record<string, string> | null;
|
|
1470
|
+
changes: AuditLogChange[];
|
|
1471
|
+
guildId: string | null;
|
|
1472
|
+
}
|
|
1473
|
+
/** Payload for {@link Events.GuildCountsUpdate}. */
|
|
1474
|
+
interface GuildCountsUpdatePayload {
|
|
1475
|
+
counts: Array<{
|
|
1476
|
+
guildId: string;
|
|
1477
|
+
memberCount: number;
|
|
1478
|
+
onlineCount: number;
|
|
1479
|
+
}>;
|
|
1480
|
+
}
|
|
1481
|
+
/** Payload for {@link Events.ChannelMemberCountsUpdate}. */
|
|
1482
|
+
interface ChannelMemberCountsUpdatePayload {
|
|
1483
|
+
counts: Array<{
|
|
1484
|
+
guildId: string;
|
|
1485
|
+
channelId: string;
|
|
1486
|
+
memberCount: number;
|
|
1487
|
+
onlineCount: number;
|
|
1488
|
+
}>;
|
|
1489
|
+
}
|
|
1490
|
+
/** Role update with optional previous snapshot. */
|
|
1491
|
+
interface GuildRoleUpdatePayload {
|
|
1492
|
+
/** Role after the update (cached instance). */
|
|
1493
|
+
role: Role;
|
|
1494
|
+
/** Shallow previous field snapshot when the role was already cached. */
|
|
1495
|
+
oldRole: Role | null;
|
|
1496
|
+
}
|
|
1497
|
+
/** Vanity URL result (camelCase). */
|
|
1498
|
+
interface VanityURLPayload {
|
|
1499
|
+
code: string | null;
|
|
1500
|
+
uses: number;
|
|
1501
|
+
}
|
|
1502
|
+
/** Result of {@link Guild.fetchAuditLogs}. */
|
|
1503
|
+
interface AuditLogFetchPayload {
|
|
1504
|
+
entries: AuditLogEntryPayload[];
|
|
1505
|
+
users: User[];
|
|
1506
|
+
}
|
|
1507
|
+
/** Guild member search result row (camelCase). */
|
|
1508
|
+
interface GuildMemberSearchHit {
|
|
1509
|
+
id: string;
|
|
1510
|
+
guildId: string;
|
|
1511
|
+
userId: string;
|
|
1512
|
+
username: string;
|
|
1513
|
+
discriminator: string;
|
|
1514
|
+
globalName: string | null;
|
|
1515
|
+
nickname: string | null;
|
|
1516
|
+
/** Cached {@link GuildMember} when available after search hydration. */
|
|
1517
|
+
member: GuildMember | null;
|
|
1518
|
+
}
|
|
1519
|
+
/** Guild member search response (camelCase). */
|
|
1520
|
+
interface GuildMemberSearchPayload {
|
|
1521
|
+
guildId: string;
|
|
1522
|
+
members: GuildMemberSearchHit[];
|
|
1523
|
+
/** Total matches across pages (`total_result_count`). */
|
|
1524
|
+
total?: number;
|
|
1525
|
+
/** Results on this page (`page_result_count`). */
|
|
1526
|
+
pageResultCount?: number;
|
|
1527
|
+
/** Whether more pages exist after this offset. */
|
|
1528
|
+
hasMore?: boolean;
|
|
1529
|
+
/** Search index still building. */
|
|
1530
|
+
indexing?: boolean;
|
|
1531
|
+
}
|
|
1532
|
+
/** Pack summary (camelCase view of {@link APIPackSummary}). */
|
|
1533
|
+
interface PackSummaryPayload {
|
|
1534
|
+
id: string;
|
|
1535
|
+
name: string;
|
|
1536
|
+
description: string | null;
|
|
1537
|
+
type: string;
|
|
1538
|
+
creatorId: string;
|
|
1539
|
+
createdAt: string;
|
|
1540
|
+
updatedAt: string;
|
|
1541
|
+
installedAt?: string;
|
|
1542
|
+
/** Original wire object when useful for debugging. */
|
|
1543
|
+
raw?: unknown;
|
|
1544
|
+
}
|
|
1545
|
+
/** Partial guild from GET /users/@me/guilds. */
|
|
1546
|
+
interface PartialUserGuildPayload {
|
|
1547
|
+
id: string;
|
|
1548
|
+
name: string;
|
|
1549
|
+
icon: string | null;
|
|
1550
|
+
owner?: boolean;
|
|
1551
|
+
permissions?: string | null;
|
|
1552
|
+
features?: string[];
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
/** Represents a reaction added to or removed from a message. */
|
|
1556
|
+
declare class MessageReaction extends Base {
|
|
1557
|
+
readonly client: Client;
|
|
1558
|
+
readonly messageId: string;
|
|
1559
|
+
readonly channelId: string;
|
|
1560
|
+
readonly guildId: string | null;
|
|
1561
|
+
readonly emoji: ReactionEmojiPayload;
|
|
1562
|
+
/** Raw gateway payload for low-level access. */
|
|
1563
|
+
readonly _data: GatewayMessageReactionAddDispatchData | GatewayMessageReactionRemoveDispatchData;
|
|
1564
|
+
constructor(client: Client, data: GatewayMessageReactionAddDispatchData | GatewayMessageReactionRemoveDispatchData);
|
|
1565
|
+
/** Emoji as a string: unicode or "name:id" for custom. */
|
|
1566
|
+
get emojiIdentifier(): string;
|
|
1567
|
+
/** Guild where this reaction was added. Resolved from cache; null for DMs or if not cached. */
|
|
1568
|
+
get guild(): Guild | null;
|
|
1569
|
+
/**
|
|
1570
|
+
* Fetch the message this reaction belongs to.
|
|
1571
|
+
* Use when you need to edit, delete, or otherwise interact with the message.
|
|
1572
|
+
* @throws FluxerError with MESSAGE_NOT_FOUND if the message does not exist
|
|
1573
|
+
*/
|
|
1574
|
+
fetchMessage(): Promise<Message>;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
interface ReactionCollectorOptions {
|
|
1578
|
+
/** Filter function. Return true to collect the reaction. */
|
|
1579
|
+
filter?: (reaction: MessageReaction, user: User) => boolean;
|
|
1580
|
+
/** Max duration in ms. Collector stops when time expires. */
|
|
1581
|
+
time?: number;
|
|
1582
|
+
/** Max reactions to collect. Collector stops when limit reached. */
|
|
1583
|
+
max?: number;
|
|
1584
|
+
}
|
|
1585
|
+
type ReactionCollectorEndReason = 'time' | 'limit' | 'user';
|
|
1586
|
+
interface CollectedReaction {
|
|
1587
|
+
reaction: MessageReaction;
|
|
1588
|
+
user: User;
|
|
1589
|
+
}
|
|
1590
|
+
interface ReactionCollectorEvents {
|
|
1591
|
+
collect: [reaction: MessageReaction, user: User];
|
|
1592
|
+
end: [collected: Collection<string, CollectedReaction>, reason: ReactionCollectorEndReason];
|
|
1593
|
+
}
|
|
1594
|
+
/**
|
|
1595
|
+
* Collects reactions on a message. Use message.createReactionCollector().
|
|
1596
|
+
* @example
|
|
1597
|
+
* const collector = message.createReactionCollector({ filter: (r, u) => u.id === userId, time: 10000 });
|
|
1598
|
+
* collector.on('collect', (reaction, user) => console.log(user.username, 'reacted', reaction.emoji.name));
|
|
1599
|
+
* collector.on('end', (collected, reason) => console.log(`Stopped: ${reason}`));
|
|
1600
|
+
*/
|
|
1601
|
+
declare class ReactionCollector extends EventEmitter {
|
|
1602
|
+
readonly client: Client;
|
|
1603
|
+
readonly messageId: string;
|
|
1604
|
+
readonly channelId: string;
|
|
1605
|
+
readonly options: Required<ReactionCollectorOptions>;
|
|
1606
|
+
readonly collected: Collection<string, CollectedReaction>;
|
|
1607
|
+
private _timeout;
|
|
1608
|
+
private _ended;
|
|
1609
|
+
private _listener;
|
|
1610
|
+
constructor(client: Client, messageId: string, channelId: string, options?: ReactionCollectorOptions);
|
|
1611
|
+
stop(reason?: ReactionCollectorEndReason): void;
|
|
1612
|
+
on<K extends keyof ReactionCollectorEvents>(event: K, listener: (...args: ReactionCollectorEvents[K]) => void): this;
|
|
1613
|
+
emit<K extends keyof ReactionCollectorEvents>(event: K, ...args: ReactionCollectorEvents[K]): boolean;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
/** Options for PATCH /channels/{id}/messages/{id}. */
|
|
1617
|
+
interface MessageEditOptions {
|
|
1618
|
+
content?: string | null;
|
|
1619
|
+
embeds?: (RESTPostAPIEmbed | EmbedBuilder)[];
|
|
1620
|
+
allowedMentions?: AllowedMentionsOptions;
|
|
1621
|
+
flags?: number;
|
|
1622
|
+
/** Keep by snowflake `id`, or add via `uploadFilename` from the presigned upload flow. */
|
|
1623
|
+
attachments?: MessageAttachmentEdit[];
|
|
1624
|
+
}
|
|
1625
|
+
type MessagePayload = Awaited<ReturnType<typeof prepareMessagePostPayload>>;
|
|
1626
|
+
/** Second-arg / inline options for `message.reply()`. */
|
|
1627
|
+
interface ReplyOptions {
|
|
1628
|
+
/** `false` suppresses the replied-user ping (`allowed_mentions.replied_user`). Default: client `defaultReplyPing`. */
|
|
1629
|
+
ping?: boolean;
|
|
1630
|
+
/** Reply to a different message. Default: this message. */
|
|
1631
|
+
replyTo?: Message | MessageReplyTarget;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
type EmojiInput = string | {
|
|
1635
|
+
name: string;
|
|
1636
|
+
id?: string;
|
|
1637
|
+
animated?: boolean;
|
|
1638
|
+
};
|
|
1639
|
+
/** A message in a channel. */
|
|
1640
|
+
declare class Message extends Base {
|
|
1641
|
+
/** The {@link Client} that instantiated this message. */
|
|
1642
|
+
readonly client: Client;
|
|
1643
|
+
/** Snowflake ID of this message. */
|
|
1644
|
+
readonly id: string;
|
|
1645
|
+
/** Channel ID where this message was sent. */
|
|
1646
|
+
readonly channelId: string;
|
|
1647
|
+
/** Guild ID if in a guild channel, null for DMs. */
|
|
1648
|
+
readonly guildId: string | null;
|
|
1649
|
+
/** The user who sent this message. */
|
|
1650
|
+
readonly author: User;
|
|
1651
|
+
/** Text content of the message. */
|
|
1652
|
+
content: string;
|
|
1653
|
+
/** When the message was created. */
|
|
1654
|
+
readonly createdAt: Date;
|
|
1655
|
+
/** When the message was last edited, or null if never edited. */
|
|
1656
|
+
readonly editedAt: Date | null;
|
|
1657
|
+
/** Whether the message is pinned. */
|
|
1658
|
+
pinned: boolean;
|
|
1659
|
+
/** Attached files (images, videos, etc.). */
|
|
1660
|
+
readonly attachments: Collection<string, APIMessageAttachment>;
|
|
1661
|
+
/** Message type (Default, Reply, etc.). */
|
|
1662
|
+
readonly type: MessageType;
|
|
1663
|
+
/** Message flags bitfield. */
|
|
1664
|
+
readonly flags: number;
|
|
1665
|
+
/** Whether `@everyone` or `@here` was mentioned. */
|
|
1666
|
+
readonly mentionEveryone: boolean;
|
|
1667
|
+
/** Whether this is a text-to-speech message. */
|
|
1668
|
+
readonly tts: boolean;
|
|
1669
|
+
/** Embedded content (rich previews, etc.). */
|
|
1670
|
+
readonly embeds: APIEmbed[];
|
|
1671
|
+
/** Stickers sent with the message. */
|
|
1672
|
+
readonly stickers: APIMessageSticker[];
|
|
1673
|
+
/** Reactions on the message. */
|
|
1674
|
+
readonly reactions: APIMessageReaction[];
|
|
1675
|
+
/** Reference to a replied-to message, if any. */
|
|
1676
|
+
readonly messageReference: APIMessageReference | null;
|
|
1677
|
+
/** Message snapshots for forwarded messages. */
|
|
1678
|
+
readonly messageSnapshots: APIMessageSnapshot[];
|
|
1679
|
+
/** Call data if this message represents a call event. */
|
|
1680
|
+
readonly call: APIMessageCall | null;
|
|
1681
|
+
/** The full referenced (replied-to) message, or null. */
|
|
1682
|
+
readonly referencedMessage: Message | null;
|
|
1683
|
+
/** Webhook ID if sent by a webhook. */
|
|
1684
|
+
readonly webhookId: string | null;
|
|
1685
|
+
/** Users mentioned in the message. */
|
|
1686
|
+
readonly mentions: User[];
|
|
1687
|
+
/** Role IDs mentioned in the message. */
|
|
1688
|
+
readonly mentionRoles: string[];
|
|
1689
|
+
/** Client-side nonce for deduplication. */
|
|
1690
|
+
readonly nonce: string | null;
|
|
1691
|
+
/** Cached text/DM/guild channel, or null if uncached. */
|
|
1692
|
+
get channel(): (TextChannel | DMChannel | GuildChannel) | null;
|
|
1693
|
+
/** Cached guild, or null for DMs / uncached. */
|
|
1694
|
+
get guild(): Guild | null;
|
|
1695
|
+
/** Fetch and resolve the channel this message is in. */
|
|
1696
|
+
resolveChannel(): Promise<Channel>;
|
|
1697
|
+
/** Fetch and resolve the guild, or null if a DM. */
|
|
1698
|
+
resolveGuild(): Promise<Guild | null>;
|
|
1699
|
+
/**
|
|
1700
|
+
* Construct a message from API data.
|
|
1701
|
+
* @param data - API message from REST or MESSAGE_CREATE
|
|
1702
|
+
*/
|
|
1703
|
+
constructor(client: Client, data: APIMessage);
|
|
1704
|
+
/** Send a message in this channel without replying. */
|
|
1705
|
+
send(options: MessagePrepareInput): Promise<Message>;
|
|
1706
|
+
/** Send a message to another channel by ID. */
|
|
1707
|
+
sendTo(channelId: string, options: MessagePrepareInput): Promise<Message>;
|
|
1708
|
+
/**
|
|
1709
|
+
* Reply to this message.
|
|
1710
|
+
* @example
|
|
1711
|
+
* await message.reply('Pong!');
|
|
1712
|
+
* await message.reply('No ping!', { ping: false });
|
|
1713
|
+
* await message.reply({ content: 'Silent', allowedMentions: AllowedMentions.suppressReplyPing });
|
|
1714
|
+
*/
|
|
1715
|
+
reply(options: string | (MessageSendOptions & ReplyOptions), replyOptions?: ReplyOptions): Promise<Message>;
|
|
1716
|
+
/** Test helper — prefer {@link reply} / `prepareMessagePostPayload()`. */
|
|
1717
|
+
static _createMessageBody(content: string | MessageSendOptions, referenced_message?: {
|
|
1718
|
+
channel_id: string;
|
|
1719
|
+
message_id: string;
|
|
1720
|
+
guild_id?: string;
|
|
1721
|
+
}, ping?: boolean): Promise<MessagePayload>;
|
|
1722
|
+
/** Send a prepared payload (internal helper). */
|
|
1723
|
+
_send(payload: MessagePayload): Promise<Message>;
|
|
1724
|
+
/** Edit this message (requires author or admin permissions). */
|
|
1725
|
+
edit(options: MessageEditOptions): Promise<Message>;
|
|
1726
|
+
/** Create a {@link ReactionCollector} for this message. */
|
|
1727
|
+
createReactionCollector(options?: ReactionCollectorOptions): ReactionCollector;
|
|
1728
|
+
/** Fetch the latest version of this message from the API. */
|
|
1729
|
+
fetch(): Promise<Message>;
|
|
1730
|
+
/** Delete this message. */
|
|
1731
|
+
delete(): Promise<void>;
|
|
1732
|
+
/** Delete a specific attachment from this message. */
|
|
1733
|
+
deleteAttachment(attachmentId: string): Promise<void>;
|
|
1734
|
+
/** Pin this message in the channel. */
|
|
1735
|
+
pin(): Promise<void>;
|
|
1736
|
+
/** Unpin this message from the channel. */
|
|
1737
|
+
unpin(): Promise<void>;
|
|
1738
|
+
/** React to this message with an emoji. */
|
|
1739
|
+
react(emoji: EmojiInput): Promise<void>;
|
|
1740
|
+
/** Remove a reaction (bot's own or a user's if ID is provided). */
|
|
1741
|
+
removeReaction(emoji: EmojiInput, userId?: string): Promise<void>;
|
|
1742
|
+
/** Remove all reactions from this message. */
|
|
1743
|
+
removeAllReactions(): Promise<void>;
|
|
1744
|
+
/** Remove all reactions of a specific emoji. */
|
|
1745
|
+
removeReactionEmoji(emoji: EmojiInput): Promise<void>;
|
|
1746
|
+
/** Fetch users who reacted with a specific emoji. */
|
|
1747
|
+
fetchReactionUsers(emoji: EmojiInput, options?: {
|
|
1748
|
+
limit?: number;
|
|
1749
|
+
after?: string;
|
|
1750
|
+
}): Promise<User[]>;
|
|
1751
|
+
/** Fetch reaction users with pagination metadata. */
|
|
1752
|
+
fetchReactionUsersPage(emoji: EmojiInput, options?: {
|
|
1753
|
+
limit?: number;
|
|
1754
|
+
after?: string;
|
|
1755
|
+
}): Promise<{
|
|
1756
|
+
users: User[];
|
|
1757
|
+
hasMore: boolean;
|
|
1758
|
+
nextAfter: string | null;
|
|
1759
|
+
}>;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
/** Options for GET /channels/{id}/messages. */
|
|
1763
|
+
interface FetchMessagesOptions {
|
|
1764
|
+
limit?: number;
|
|
1765
|
+
before?: string;
|
|
1766
|
+
after?: string;
|
|
1767
|
+
around?: string;
|
|
1768
|
+
}
|
|
1769
|
+
/** Options for {@link Client.bulkFetchMessages}. */
|
|
1770
|
+
interface BulkFetchMessagesOptions {
|
|
1771
|
+
/** When true (default), hydrate {@link Message}s and update the cache. */
|
|
1772
|
+
hydrate?: boolean;
|
|
1773
|
+
}
|
|
1774
|
+
interface BulkFetchMessagesChannelResult {
|
|
1775
|
+
channelId: string;
|
|
1776
|
+
messages: Collection<string, Message>;
|
|
1777
|
+
}
|
|
1778
|
+
interface BulkFetchMessagesResult {
|
|
1779
|
+
channels: BulkFetchMessagesChannelResult[];
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Per-channel message cache + fetch. Access via `channel.messages`.
|
|
1783
|
+
*
|
|
1784
|
+
* `fetch` always writes through the client message cache (when enabled) and
|
|
1785
|
+
* constructs {@link Message} from the cached payload so `get` stays coherent.
|
|
1786
|
+
*/
|
|
1787
|
+
declare class MessageManager {
|
|
1788
|
+
private readonly client;
|
|
1789
|
+
private readonly channelId;
|
|
1790
|
+
constructor(client: Client, channelId: string);
|
|
1791
|
+
/** Retrieve a cached message by ID, or `undefined` if missing / caching disabled. */
|
|
1792
|
+
get(messageId: string): Message | undefined;
|
|
1793
|
+
/** Fetch a single message by ID. */
|
|
1794
|
+
fetch(messageId: string): Promise<Message>;
|
|
1795
|
+
/** Fetch multiple messages with query options (limit, before, after, around). */
|
|
1796
|
+
fetch(options: FetchMessagesOptions): Promise<Collection<string, Message>>;
|
|
1797
|
+
/** Cache API data and return a {@link Message} built from the cached entry when present. */
|
|
1798
|
+
private wrap;
|
|
1799
|
+
/** Fetch a single message from the API. */
|
|
1800
|
+
private fetchOne;
|
|
1801
|
+
/** Fetch multiple messages from the API with pagination/filtering. */
|
|
1802
|
+
private fetchMany;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
interface MessageCollectorOptions {
|
|
1806
|
+
/** Filter function. Return true to collect the message. */
|
|
1807
|
+
filter?: (message: Message) => boolean;
|
|
1808
|
+
/** Max duration in ms. Collector stops when time expires. */
|
|
1809
|
+
time?: number;
|
|
1810
|
+
/** Max messages to collect. Collector stops when limit reached. */
|
|
1811
|
+
max?: number;
|
|
1812
|
+
}
|
|
1813
|
+
type MessageCollectorEndReason = 'time' | 'limit' | 'user';
|
|
1814
|
+
interface MessageCollectorEvents {
|
|
1815
|
+
collect: [message: Message];
|
|
1816
|
+
end: [collected: Collection<string, Message>, reason: MessageCollectorEndReason];
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* Collects messages in a channel. Use channel.createMessageCollector().
|
|
1820
|
+
* @example
|
|
1821
|
+
* const collector = channel.createMessageCollector({ filter: m => m.author.id === userId, time: 10000 });
|
|
1822
|
+
* collector.on('collect', m => console.log(m.content));
|
|
1823
|
+
* collector.on('end', (collected, reason) => console.log(`Stopped: ${reason}`));
|
|
1824
|
+
*/
|
|
1825
|
+
declare class MessageCollector extends EventEmitter {
|
|
1826
|
+
readonly client: Client;
|
|
1827
|
+
readonly channelId: string;
|
|
1828
|
+
readonly options: Required<MessageCollectorOptions>;
|
|
1829
|
+
readonly collected: Collection<string, Message>;
|
|
1830
|
+
private _timeout;
|
|
1831
|
+
private _ended;
|
|
1832
|
+
private _listener;
|
|
1833
|
+
constructor(client: Client, channelId: string, options?: MessageCollectorOptions);
|
|
1834
|
+
stop(reason?: MessageCollectorEndReason): void;
|
|
1835
|
+
on<K extends keyof MessageCollectorEvents>(event: K, listener: (...args: MessageCollectorEvents[K]) => void): this;
|
|
1836
|
+
emit<K extends keyof MessageCollectorEvents>(event: K, ...args: MessageCollectorEvents[K]): boolean;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
type FetchPinnedMessagesOptions = {
|
|
1840
|
+
limit?: number;
|
|
1841
|
+
before?: string;
|
|
1842
|
+
};
|
|
1843
|
+
type PinnedMessagesPage = {
|
|
1844
|
+
messages: Message[];
|
|
1845
|
+
pinnedAt: string[];
|
|
1846
|
+
hasMore: boolean;
|
|
1847
|
+
};
|
|
1848
|
+
|
|
1849
|
+
/** A channel in a guild (text, voice, category, etc.). */
|
|
1850
|
+
declare class GuildChannel extends Channel {
|
|
1851
|
+
/** Guild ID this channel belongs to. */
|
|
1852
|
+
readonly guildId: string;
|
|
1853
|
+
name: string | null;
|
|
1854
|
+
/** Position in the channel list. */
|
|
1855
|
+
position?: number;
|
|
1856
|
+
/** Parent category ID, or null if none. */
|
|
1857
|
+
parentId: string | null;
|
|
1858
|
+
/** Permission overwrites for roles/members. */
|
|
1859
|
+
permissionOverwrites: APIChannelOverwrite[];
|
|
1860
|
+
constructor(client: Client, data: APIChannel);
|
|
1861
|
+
/**
|
|
1862
|
+
* Apply guild-channel fields in place.
|
|
1863
|
+
* @internal
|
|
1864
|
+
*/
|
|
1865
|
+
_patch(data: APIChannel): void;
|
|
1866
|
+
/** Create a webhook for this channel. Requires Manage Webhooks. */
|
|
1867
|
+
createWebhook(options: {
|
|
1868
|
+
name: string;
|
|
1869
|
+
avatar?: string | null;
|
|
1870
|
+
}): Promise<Webhook>;
|
|
1871
|
+
/** Fetch all webhooks in this channel. Requires Manage Webhooks. */
|
|
1872
|
+
fetchWebhooks(): Promise<Webhook[]>;
|
|
1873
|
+
/** Create an invite for this channel. Requires Create Instant Invite. */
|
|
1874
|
+
createInvite(options?: ChannelInviteCreateOptions): Promise<Invite>;
|
|
1875
|
+
/** Fetch all invites for this channel. Requires Manage Channels. */
|
|
1876
|
+
fetchInvites(): Promise<Invite[]>;
|
|
1877
|
+
/** Edit or create a permission overwrite. Requires Manage Roles. */
|
|
1878
|
+
editPermission(overwriteId: string, options: {
|
|
1879
|
+
type: OverwriteType;
|
|
1880
|
+
allow?: string;
|
|
1881
|
+
deny?: string;
|
|
1882
|
+
}): Promise<void>;
|
|
1883
|
+
/** Delete a permission overwrite. Requires Manage Roles. */
|
|
1884
|
+
deletePermission(overwriteId: string): Promise<void>;
|
|
1885
|
+
/** Check if the bot can send messages in this channel (with permissions). */
|
|
1886
|
+
canSendMessage(): boolean;
|
|
1887
|
+
/** Edit this channel's settings. Requires Manage Channels. */
|
|
1888
|
+
edit(options: ChannelEditOptions): Promise<this>;
|
|
1889
|
+
protected applyEditPatch(_data: APIChannel): void;
|
|
1890
|
+
/** Delete this channel. Requires Manage Channels or channel ownership. */
|
|
1891
|
+
delete(options?: SudoVerificationOptions & {
|
|
1892
|
+
silent?: boolean;
|
|
1893
|
+
deleteMessages?: boolean;
|
|
1894
|
+
}): Promise<void>;
|
|
1895
|
+
}
|
|
1896
|
+
declare const TextChannel_base: (abstract new (...args: any[]) => {
|
|
1897
|
+
"__#private@#messages": MessageManager | undefined;
|
|
1898
|
+
send(options: MessagePrepareInput): Promise<Message>;
|
|
1899
|
+
get messages(): MessageManager;
|
|
1900
|
+
createMessageCollector(options?: MessageCollectorOptions): MessageCollector;
|
|
1901
|
+
fetchPinnedMessages(options?: FetchPinnedMessagesOptions): Promise<Message[]>;
|
|
1902
|
+
fetchPinnedMessagesPage(options?: FetchPinnedMessagesOptions): Promise<PinnedMessagesPage>;
|
|
1903
|
+
readonly client: Client;
|
|
1904
|
+
readonly id: string;
|
|
1905
|
+
type: _fluxerjs_types.ChannelType;
|
|
1906
|
+
name: string | null;
|
|
1907
|
+
icon: string | null;
|
|
1908
|
+
lastPinTimestamp: string | null;
|
|
1909
|
+
_patch(data: _fluxerjs_types.APIChannelPartial | APIChannel): void;
|
|
1910
|
+
isTextBased(): this is TextChannel | DMChannel;
|
|
1911
|
+
isDM(): this is DMChannel;
|
|
1912
|
+
isPersonalNotes(): boolean;
|
|
1913
|
+
isVoice(): this is VoiceChannel;
|
|
1914
|
+
isLink(): this is LinkChannel;
|
|
1915
|
+
bulkDelete(countOrIds: number | readonly string[]): Promise<string[]>;
|
|
1916
|
+
bulkDeleteMyMessages(options?: SudoVerificationOptions): Promise<void>;
|
|
1917
|
+
acknowledgePins(): Promise<void>;
|
|
1918
|
+
clearReadState(): Promise<void>;
|
|
1919
|
+
requestAttachmentUploads(attachments: AttachmentUploadPlanItem[]): Promise<AttachmentUploadPlanResponse>;
|
|
1920
|
+
completeAttachmentUploads(uploads: AttachmentUploadCompleteItem[]): Promise<AttachmentUploadCompleteResponse>;
|
|
1921
|
+
uploadAttachmentsForSend(files: UploadFileForSend[]): Promise<_fluxerjs_types.RESTPostAPIMessageUploadedAttachment[]>;
|
|
1922
|
+
sendTyping(): Promise<void>;
|
|
1923
|
+
fetchRtcRegions(): Promise<RtcRegionPayload[]>;
|
|
1924
|
+
fetchSlowmode(): Promise<ChannelSlowmodePayload>;
|
|
1925
|
+
canSendMessage(): boolean;
|
|
1926
|
+
}) & typeof GuildChannel;
|
|
1927
|
+
/** A text channel in a guild (supports sending messages). */
|
|
1928
|
+
declare class TextChannel extends TextChannel_base {
|
|
1929
|
+
/** Channel topic. */
|
|
1930
|
+
topic?: string | null;
|
|
1931
|
+
/** Whether this channel is marked as NSFW. */
|
|
1932
|
+
nsfw?: boolean;
|
|
1933
|
+
/** Slowmode rate limit in seconds. */
|
|
1934
|
+
rateLimitPerUser?: number;
|
|
1935
|
+
/** ID of the last message sent in this channel. */
|
|
1936
|
+
lastMessageId?: string | null;
|
|
1937
|
+
constructor(client: Client, data: APIChannel);
|
|
1938
|
+
protected applyEditPatch(data: APIChannel): void;
|
|
1939
|
+
}
|
|
1940
|
+
/** A category channel (container for organizing channels). */
|
|
1941
|
+
declare class CategoryChannel extends GuildChannel {
|
|
1942
|
+
}
|
|
1943
|
+
/** A voice channel in a guild. */
|
|
1944
|
+
declare class VoiceChannel extends GuildChannel {
|
|
1945
|
+
/** Voice bitrate. */
|
|
1946
|
+
bitrate?: number | null;
|
|
1947
|
+
/** Maximum number of users allowed. */
|
|
1948
|
+
userLimit?: number | null;
|
|
1949
|
+
/** RTC region override for this channel. */
|
|
1950
|
+
rtcRegion?: string | null;
|
|
1951
|
+
constructor(client: Client, data: APIChannel);
|
|
1952
|
+
protected applyEditPatch(data: APIChannel): void;
|
|
1953
|
+
}
|
|
1954
|
+
/** A link channel (redirects to an external URL). */
|
|
1955
|
+
declare class LinkChannel extends GuildChannel {
|
|
1956
|
+
/** External URL this channel links to. */
|
|
1957
|
+
url: string | null;
|
|
1958
|
+
constructor(client: Client, data: APIChannel);
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
declare const DMChannel_base: (abstract new (...args: any[]) => {
|
|
1962
|
+
"__#private@#messages": MessageManager | undefined;
|
|
1963
|
+
send(options: MessagePrepareInput): Promise<Message>;
|
|
1964
|
+
get messages(): MessageManager;
|
|
1965
|
+
createMessageCollector(options?: MessageCollectorOptions): MessageCollector;
|
|
1966
|
+
fetchPinnedMessages(options?: FetchPinnedMessagesOptions): Promise<Message[]>;
|
|
1967
|
+
fetchPinnedMessagesPage(options?: FetchPinnedMessagesOptions): Promise<PinnedMessagesPage>;
|
|
1968
|
+
readonly client: Client;
|
|
1969
|
+
readonly id: string;
|
|
1970
|
+
type: ChannelType;
|
|
1971
|
+
name: string | null;
|
|
1972
|
+
icon: string | null;
|
|
1973
|
+
lastPinTimestamp: string | null;
|
|
1974
|
+
_patch(data: APIChannelPartial | APIChannel): void;
|
|
1975
|
+
isTextBased(): this is TextChannel | DMChannel;
|
|
1976
|
+
isDM(): this is DMChannel;
|
|
1977
|
+
isPersonalNotes(): boolean;
|
|
1978
|
+
isVoice(): this is VoiceChannel;
|
|
1979
|
+
isLink(): this is LinkChannel;
|
|
1980
|
+
bulkDelete(countOrIds: number | readonly string[]): Promise<string[]>;
|
|
1981
|
+
bulkDeleteMyMessages(options?: SudoVerificationOptions): Promise<void>;
|
|
1982
|
+
acknowledgePins(): Promise<void>;
|
|
1983
|
+
clearReadState(): Promise<void>;
|
|
1984
|
+
requestAttachmentUploads(attachments: AttachmentUploadPlanItem[]): Promise<AttachmentUploadPlanResponse>;
|
|
1985
|
+
completeAttachmentUploads(uploads: AttachmentUploadCompleteItem[]): Promise<AttachmentUploadCompleteResponse>;
|
|
1986
|
+
uploadAttachmentsForSend(files: UploadFileForSend[]): Promise<_fluxerjs_types.RESTPostAPIMessageUploadedAttachment[]>;
|
|
1987
|
+
sendTyping(): Promise<void>;
|
|
1988
|
+
fetchRtcRegions(): Promise<RtcRegionPayload[]>;
|
|
1989
|
+
fetchSlowmode(): Promise<ChannelSlowmodePayload>;
|
|
1990
|
+
canSendMessage(): boolean;
|
|
1991
|
+
}) & typeof Channel;
|
|
1992
|
+
/** DM / Group DM / personal notes channel. */
|
|
1993
|
+
declare class DMChannel extends DMChannel_base {
|
|
1994
|
+
/** ID of the last message sent in this channel. */
|
|
1995
|
+
lastMessageId?: string | null;
|
|
1996
|
+
/** Owner ID for group DMs. */
|
|
1997
|
+
ownerId: string | null;
|
|
1998
|
+
/** Recipients in this DM (includes the bot). */
|
|
1999
|
+
recipients: User[];
|
|
2000
|
+
/** Custom nicknames for users in a group DM. */
|
|
2001
|
+
nicks: Record<string, string>;
|
|
2002
|
+
constructor(client: Client, data: APIChannelPartial & Partial<APIChannel>);
|
|
2003
|
+
/** Purge all messages from personal notes. Only works on personal notes channels. */
|
|
2004
|
+
purgeMessages(): Promise<number>;
|
|
2005
|
+
/** Pin this DM channel to the top of the DM list. */
|
|
2006
|
+
pinInList(): Promise<void>;
|
|
2007
|
+
/** Unpin this DM channel from the DM list. */
|
|
2008
|
+
unpinFromList(): Promise<void>;
|
|
2009
|
+
/** Add a user to this group DM. */
|
|
2010
|
+
addRecipient(userId: string): Promise<void>;
|
|
2011
|
+
/** Remove a user from this group DM. */
|
|
2012
|
+
removeRecipient(userId: string, options?: {
|
|
2013
|
+
silent?: boolean;
|
|
2014
|
+
}): Promise<void>;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
/** Base class for all channel types. */
|
|
2018
|
+
declare abstract class Channel extends Base {
|
|
2019
|
+
/** The {@link Client} that instantiated this channel. */
|
|
2020
|
+
readonly client: Client;
|
|
2021
|
+
/** Snowflake ID of this channel. */
|
|
2022
|
+
readonly id: string;
|
|
2023
|
+
/** Channel type (text, voice, category, etc.). */
|
|
2024
|
+
type: ChannelType;
|
|
2025
|
+
/** Channel name (null for some channel types). */
|
|
2026
|
+
name: string | null;
|
|
2027
|
+
/** Channel icon hash (null for most channel types). */
|
|
2028
|
+
icon: string | null;
|
|
2029
|
+
/** ISO8601 timestamp of the last pinned message update. */
|
|
2030
|
+
lastPinTimestamp: string | null;
|
|
2031
|
+
constructor(client: Client, data: APIChannelPartial);
|
|
2032
|
+
/**
|
|
2033
|
+
* Apply shared channel fields in place (gateway CHANNEL_UPDATE when type is unchanged).
|
|
2034
|
+
* @internal
|
|
2035
|
+
*/
|
|
2036
|
+
_patch(data: APIChannelPartial | APIChannel): void;
|
|
2037
|
+
/** Wired in `structures/Channel.ts` after subclasses load. */
|
|
2038
|
+
static from(_c: Client, _d: APIChannel | APIChannelPartial): GuildChannel | TextChannel;
|
|
2039
|
+
static fromOrCreate(_c: Client, _d: APIChannel | APIChannelPartial): TextChannel | DMChannel | GuildChannel;
|
|
2040
|
+
static createDM(_c: Client, _d: APIChannelPartial): DMChannel;
|
|
2041
|
+
/** Check if this channel supports sending messages (text/DM). */
|
|
2042
|
+
isTextBased(): this is TextChannel | DMChannel;
|
|
2043
|
+
/** Check if this is a DM, group DM, or personal notes channel. */
|
|
2044
|
+
isDM(): this is DMChannel;
|
|
2045
|
+
/** Check if this is a personal notes channel. */
|
|
2046
|
+
isPersonalNotes(): boolean;
|
|
2047
|
+
/** Check if this is a voice channel. */
|
|
2048
|
+
isVoice(): this is VoiceChannel;
|
|
2049
|
+
/** Check if this is a link channel. */
|
|
2050
|
+
isLink(): this is LinkChannel;
|
|
2051
|
+
/**
|
|
2052
|
+
* Delete recent messages or an explicit ID list.
|
|
2053
|
+
* - `bulkDelete(5)` — fetch last 5 via {@link MessageManager} then delete (1–100)
|
|
2054
|
+
* - `bulkDelete(['id1'])` — single DELETE; 2–100 uses bulk-delete route
|
|
2055
|
+
*/
|
|
2056
|
+
bulkDelete(countOrIds: number | readonly string[]): Promise<string[]>;
|
|
2057
|
+
/** Delete all messages sent by the bot in this channel (user account feature). */
|
|
2058
|
+
bulkDeleteMyMessages(options?: SudoVerificationOptions): Promise<void>;
|
|
2059
|
+
/** Mark all pinned messages as read in this channel. */
|
|
2060
|
+
acknowledgePins(): Promise<void>;
|
|
2061
|
+
/** Clear the read state for this channel. */
|
|
2062
|
+
clearReadState(): Promise<void>;
|
|
2063
|
+
/** Request upload URLs for attachments before sending a message. */
|
|
2064
|
+
requestAttachmentUploads(attachments: AttachmentUploadPlanItem[]): Promise<AttachmentUploadPlanResponse>;
|
|
2065
|
+
/** Complete the attachment upload flow after uploading to the CDN. */
|
|
2066
|
+
completeAttachmentUploads(uploads: AttachmentUploadCompleteItem[]): Promise<AttachmentUploadCompleteResponse>;
|
|
2067
|
+
/** Upload files for sending in a message (helper). */
|
|
2068
|
+
uploadAttachmentsForSend(files: UploadFileForSend[]): Promise<_fluxerjs_types.RESTPostAPIMessageUploadedAttachment[]>;
|
|
2069
|
+
/** Trigger the typing indicator in this channel. */
|
|
2070
|
+
sendTyping(): Promise<void>;
|
|
2071
|
+
/** Fetch available RTC regions for voice channels. */
|
|
2072
|
+
fetchRtcRegions(): Promise<RtcRegionPayload[]>;
|
|
2073
|
+
/** Fetch slowmode state for this channel. */
|
|
2074
|
+
fetchSlowmode(): Promise<ChannelSlowmodePayload>;
|
|
2075
|
+
/** Check if the bot can send messages in this channel. */
|
|
2076
|
+
canSendMessage(): boolean;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* Channel cache + fetch/send helpers.
|
|
2081
|
+
* Extends {@link Collection} (`.get()`, `.set()`, `.filter()`, …).
|
|
2082
|
+
*/
|
|
2083
|
+
declare class ChannelManager extends Collection<string, Channel | GuildChannel> {
|
|
2084
|
+
private readonly client;
|
|
2085
|
+
private readonly maxSize;
|
|
2086
|
+
constructor(client: Client);
|
|
2087
|
+
/** Set a channel in the cache (evicts oldest if at capacity). */
|
|
2088
|
+
set(key: string, value: Channel): this;
|
|
2089
|
+
/** Retrieve from cache, otherwise {@link fetch}. */
|
|
2090
|
+
resolve(channelId: string): Promise<Channel>;
|
|
2091
|
+
/**
|
|
2092
|
+
* Fetch a channel by ID (returns cache if present).
|
|
2093
|
+
* @throws {@link FluxerError} with CHANNEL_NOT_FOUND if missing
|
|
2094
|
+
*/
|
|
2095
|
+
fetch(channelId: string): Promise<Channel>;
|
|
2096
|
+
/**
|
|
2097
|
+
* Fetch a message by channel + message ID (no channel resolve required).
|
|
2098
|
+
* Prefer `channel.messages.fetch(messageId)` when you already have a text channel.
|
|
2099
|
+
*/
|
|
2100
|
+
fetchMessage(channelId: string, messageId: string): Promise<Message>;
|
|
2101
|
+
/**
|
|
2102
|
+
* Send to a channel by ID without resolving it first.
|
|
2103
|
+
* @example
|
|
2104
|
+
* await client.channels.send(logChannelId, 'User joined!');
|
|
2105
|
+
*/
|
|
2106
|
+
send(channelId: string, payload: MessagePrepareInput): Promise<Message>;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
/**
|
|
2110
|
+
* Guild cache and manager with fetch.
|
|
2111
|
+
* Extends {@link Collection} so you can use `.get()`, `.set()`, `.filter()`, etc.
|
|
2112
|
+
*/
|
|
2113
|
+
declare class GuildManager extends Collection<string, Guild> {
|
|
2114
|
+
private readonly client;
|
|
2115
|
+
private readonly maxSize;
|
|
2116
|
+
constructor(client: Client);
|
|
2117
|
+
/** Set a guild in the cache (evicts oldest if at capacity). */
|
|
2118
|
+
set(key: string, value: Guild): this;
|
|
2119
|
+
/**
|
|
2120
|
+
* Get a guild from cache or fetch from the API if not present.
|
|
2121
|
+
* @param guildId - Snowflake of the guild
|
|
2122
|
+
* @returns The guild
|
|
2123
|
+
* @throws FluxerError with GUILD_NOT_FOUND if missing
|
|
2124
|
+
*/
|
|
2125
|
+
resolve(guildId: string): Promise<Guild>;
|
|
2126
|
+
/**
|
|
2127
|
+
* Fetch a guild by ID (returns cache if present).
|
|
2128
|
+
* @throws FluxerError with GUILD_NOT_FOUND if missing
|
|
2129
|
+
*/
|
|
2130
|
+
fetch(guildId: string): Promise<Guild>;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
/**
|
|
2134
|
+
* Optional cache size limits (FIFO eviction when exceeded).
|
|
2135
|
+
* Use `0` for unbounded growth on that bucket.
|
|
2136
|
+
* @see {@link DEFAULT_CACHE_LIMITS}
|
|
2137
|
+
*/
|
|
2138
|
+
interface CacheSizeLimits {
|
|
2139
|
+
/** Max channels cached globally. `0` = unbounded. */
|
|
2140
|
+
channels?: number;
|
|
2141
|
+
/** Max guilds cached. `0` = unbounded. */
|
|
2142
|
+
guilds?: number;
|
|
2143
|
+
/** Max users cached globally. `0` = unbounded. */
|
|
2144
|
+
users?: number;
|
|
2145
|
+
/** Max messages per channel (`channel.messages.get` / `oldMessage`). `0` = off. */
|
|
2146
|
+
messages?: number;
|
|
2147
|
+
/** Max members per guild. `0` = unbounded. */
|
|
2148
|
+
members?: number;
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Default cache policy — opt out per field with `0`.
|
|
2152
|
+
* Applied when {@link ClientOptions.cache} is omitted or partial.
|
|
2153
|
+
*/
|
|
2154
|
+
declare const DEFAULT_CACHE_LIMITS: Required<CacheSizeLimits>;
|
|
2155
|
+
/**
|
|
2156
|
+
* Configuration options for {@link Client}.
|
|
2157
|
+
* @example
|
|
2158
|
+
* ```ts
|
|
2159
|
+
* const client = new Client({
|
|
2160
|
+
* instance: { api: 'https://api.example.com' },
|
|
2161
|
+
* cache: { guilds: 100, messages: 20 },
|
|
2162
|
+
* waitForGuilds: true,
|
|
2163
|
+
* });
|
|
2164
|
+
* ```
|
|
2165
|
+
*/
|
|
2166
|
+
interface ClientOptions {
|
|
2167
|
+
/**
|
|
2168
|
+
* Instance endpoints for this client (API, CDN, invite, etc.).
|
|
2169
|
+
* Pass a partial map to override hosted defaults, or a full discovery document.
|
|
2170
|
+
* Prefer this over `rest.api` for multi-instance / self-hosted bots.
|
|
2171
|
+
* @see {@link Client.fromDiscovery}
|
|
2172
|
+
*/
|
|
2173
|
+
instance?: Partial<APIInstanceEndpoints> | APIInstance;
|
|
2174
|
+
/**
|
|
2175
|
+
* REST options. Prefer {@link ClientOptions.instance} for the API host.
|
|
2176
|
+
* If both `instance.api` (or resolved default) and `rest.api` are set and differ, construction throws.
|
|
2177
|
+
*/
|
|
2178
|
+
rest?: Partial<ConstructorParameters<typeof REST>[0]>;
|
|
2179
|
+
/**
|
|
2180
|
+
* Gateway intents (Fluxer currently always sends `0`).
|
|
2181
|
+
* Reserved for future use.
|
|
2182
|
+
*/
|
|
2183
|
+
intents?: number;
|
|
2184
|
+
/** Silence the intents-not-supported warning. */
|
|
2185
|
+
suppressIntentWarning?: boolean;
|
|
2186
|
+
/**
|
|
2187
|
+
* Delay Ready until all READY guilds arrive via GUILD_CREATE; queue other dispatches until then.
|
|
2188
|
+
* @default false
|
|
2189
|
+
*/
|
|
2190
|
+
waitForGuilds?: boolean;
|
|
2191
|
+
/**
|
|
2192
|
+
* Cache size limits per bucket. Defaults to {@link DEFAULT_CACHE_LIMITS}. Pass `0` per field for unbounded.
|
|
2193
|
+
* @see {@link CacheSizeLimits}
|
|
2194
|
+
*/
|
|
2195
|
+
cache?: CacheSizeLimits;
|
|
2196
|
+
/**
|
|
2197
|
+
* Default allowed mentions when a send omits them (per-call wins).
|
|
2198
|
+
* @example
|
|
2199
|
+
* ```ts
|
|
2200
|
+
* defaultAllowedMentions: {
|
|
2201
|
+
* parse: ['users'],
|
|
2202
|
+
* repliedUser: false,
|
|
2203
|
+
* }
|
|
2204
|
+
* ```
|
|
2205
|
+
*/
|
|
2206
|
+
defaultAllowedMentions?: {
|
|
2207
|
+
/** Mention types to parse (`roles`, `users`, `everyone`). */
|
|
2208
|
+
parse?: Array<'roles' | 'users' | 'everyone'>;
|
|
2209
|
+
/** Specific role IDs allowed to be mentioned. */
|
|
2210
|
+
roles?: string[];
|
|
2211
|
+
/** Specific user IDs allowed to be mentioned. */
|
|
2212
|
+
users?: string[];
|
|
2213
|
+
/** Whether to ping the user being replied to. */
|
|
2214
|
+
repliedUser?: boolean;
|
|
2215
|
+
};
|
|
2216
|
+
/**
|
|
2217
|
+
* Default reply ping for `message.reply` when `ping` is omitted.
|
|
2218
|
+
* @default true
|
|
2219
|
+
*/
|
|
2220
|
+
defaultReplyPing?: boolean;
|
|
2221
|
+
/**
|
|
2222
|
+
* Initial presence on identify (also updatable via `client.user.setPresence`).
|
|
2223
|
+
*/
|
|
2224
|
+
presence?: GatewayPresenceUpdateData;
|
|
2225
|
+
/**
|
|
2226
|
+
* Emit gateway debug strings.
|
|
2227
|
+
* @default true
|
|
2228
|
+
*/
|
|
2229
|
+
gatewayDebug?: boolean;
|
|
2230
|
+
/**
|
|
2231
|
+
* Defer dispatch handlers to the next macrotask so WS `message` stays responsive.
|
|
2232
|
+
* @default true (`false` useful in tests)
|
|
2233
|
+
*/
|
|
2234
|
+
gatewayDeferHandlers?: boolean;
|
|
2235
|
+
/**
|
|
2236
|
+
* Optional WebSocket constructor (e.g. `ws` in Node).
|
|
2237
|
+
* Provide if the runtime lacks a native WebSocket implementation.
|
|
2238
|
+
*/
|
|
2239
|
+
WebSocket?: new (url: string) => {
|
|
2240
|
+
send(data: string | ArrayBufferLike): void;
|
|
2241
|
+
close(code?: number): void;
|
|
2242
|
+
readyState: number;
|
|
2243
|
+
addEventListener?(type: string, listener: (e: unknown) => void): void;
|
|
2244
|
+
on?(event: string, cb: (data?: unknown) => void): void;
|
|
2245
|
+
};
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
/** Hosted Fluxer production endpoints (default when no instance is configured). */
|
|
2249
|
+
declare const DEFAULT_INSTANCE_ENDPOINTS: Readonly<APIInstanceEndpoints>;
|
|
2250
|
+
/** Immutable resolved instance descriptor attached to each {@link Client}. */
|
|
2251
|
+
interface ResolvedInstance {
|
|
2252
|
+
readonly endpoints: Readonly<APIInstanceEndpoints>;
|
|
2253
|
+
/** Full discovery document when available (fromDiscovery / fetchInstance). */
|
|
2254
|
+
readonly discovery: Readonly<APIInstance> | null;
|
|
2255
|
+
}
|
|
2256
|
+
/** Strip trailing `/vN` and trailing slash from an API origin. */
|
|
2257
|
+
declare function normalizeApiOrigin(api: string): string;
|
|
2258
|
+
/**
|
|
2259
|
+
* Validate a raw discovery payload and return a typed {@link APIInstance}.
|
|
2260
|
+
* @throws FluxerError with {@link ErrorCodes.InvalidInstanceDiscovery}
|
|
2261
|
+
*/
|
|
2262
|
+
declare function parseInstanceDiscovery(raw: unknown): APIInstance;
|
|
2263
|
+
/**
|
|
2264
|
+
* Merge partial endpoint overrides onto hosted defaults.
|
|
2265
|
+
* Accepts either a full {@link APIInstance} or a partial endpoint map.
|
|
2266
|
+
*/
|
|
2267
|
+
declare function resolveInstanceEndpoints(input?: Partial<APIInstanceEndpoints> | APIInstance | null): ResolvedInstance;
|
|
2268
|
+
/** Build an invite URL for a code using the instance invite base. */
|
|
2269
|
+
declare function inviteUrl(inviteBase: string, code: string): string;
|
|
2270
|
+
|
|
2271
|
+
/** The logged-in bot/user (`client.user`). */
|
|
2272
|
+
declare class ClientUser extends User {
|
|
2273
|
+
readonly client: Client;
|
|
2274
|
+
constructor(client: Client, data: APIUserPartial);
|
|
2275
|
+
/** Broadcast presence (gateway opcode 3) on all shards. */
|
|
2276
|
+
setPresence(presence: PresenceUpdateOptions): void;
|
|
2277
|
+
/** GET /users/@me/guilds — returns camelCase partial guilds. */
|
|
2278
|
+
fetchGuilds(): Promise<PartialUserGuildPayload[]>;
|
|
2279
|
+
/** DELETE /users/@me/guilds/{guild_id} */
|
|
2280
|
+
leaveGuild(guildId: string, options?: SudoVerificationOptions): Promise<void>;
|
|
2281
|
+
/** Delete every message authored by the caller across a guild (sudo). */
|
|
2282
|
+
bulkDeleteMyMessagesInGuild(guildId: string, options?: SudoVerificationOptions): Promise<void>;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
type MemberPayload = APIGuildMember & {
|
|
2286
|
+
user: {
|
|
2287
|
+
id: string;
|
|
2288
|
+
};
|
|
2289
|
+
};
|
|
2290
|
+
/** Result of {@link UserManager.fetchWithProfile}. */
|
|
2291
|
+
interface FetchedUserWithProfile {
|
|
2292
|
+
user: User;
|
|
2293
|
+
userData: APIUserPartial;
|
|
2294
|
+
globalProfile: ProfilePayload | null;
|
|
2295
|
+
serverProfile: ProfilePayload | null;
|
|
2296
|
+
member: GuildMember | null;
|
|
2297
|
+
memberData: MemberPayload | null;
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* User cache + fetch/profile helpers.
|
|
2301
|
+
* Extends Collection (`.get()`, `.set()`, `.filter()`, …).
|
|
2302
|
+
* Access via {@link Client.users}.
|
|
2303
|
+
*/
|
|
2304
|
+
declare class UserManager extends Collection<string, User> {
|
|
2305
|
+
private readonly client;
|
|
2306
|
+
private readonly maxSize;
|
|
2307
|
+
constructor(client: Client);
|
|
2308
|
+
set(key: string, value: User): this;
|
|
2309
|
+
/** Remove matching users (skips `client.user`). Returns count removed. */
|
|
2310
|
+
sweep(filter?: (user: User, id: string) => boolean): number;
|
|
2311
|
+
/** Fetch a user by ID and update cache. */
|
|
2312
|
+
fetch(userId: string): Promise<User>;
|
|
2313
|
+
/**
|
|
2314
|
+
* Fetch user + profiles (+ optional guild member). Ideal for userinfo commands.
|
|
2315
|
+
* @example
|
|
2316
|
+
* const { user, globalProfile, member } = await client.users.fetchWithProfile(
|
|
2317
|
+
* userId,
|
|
2318
|
+
* { guildId: message.guildId ?? undefined },
|
|
2319
|
+
* );
|
|
2320
|
+
*/
|
|
2321
|
+
fetchWithProfile(userId: string, options?: {
|
|
2322
|
+
guildId?: string | null;
|
|
2323
|
+
}): Promise<FetchedUserWithProfile>;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
/** Map a wire pack summary to camelCase. */
|
|
2327
|
+
declare function toPackSummaryPayload(data: APIPackSummary): PackSummaryPayload;
|
|
2328
|
+
/** CamelCase pack dashboard section. */
|
|
2329
|
+
interface PackDashboardSectionPayload {
|
|
2330
|
+
installedLimit: number;
|
|
2331
|
+
createdLimit: number;
|
|
2332
|
+
installed: PackSummaryPayload[];
|
|
2333
|
+
created: PackSummaryPayload[];
|
|
2334
|
+
}
|
|
2335
|
+
/** CamelCase pack dashboard. */
|
|
2336
|
+
interface PackDashboardPayload {
|
|
2337
|
+
emoji: PackDashboardSectionPayload;
|
|
2338
|
+
sticker: PackDashboardSectionPayload;
|
|
2339
|
+
}
|
|
2340
|
+
/** REST wrappers for `/packs/*`. Access via `client.packs`. */
|
|
2341
|
+
declare class PackManager {
|
|
2342
|
+
private readonly client;
|
|
2343
|
+
constructor(client: Client);
|
|
2344
|
+
/** Fetch the current user's pack dashboard (camelCase summaries). */
|
|
2345
|
+
fetchDashboard(): Promise<PackDashboardPayload>;
|
|
2346
|
+
/** Create a pack. */
|
|
2347
|
+
create(packType: PackType, body: PackCreateOptions): Promise<PackSummaryPayload>;
|
|
2348
|
+
/** Edit a pack. */
|
|
2349
|
+
edit(packId: string, body: PackEditOptions): Promise<PackSummaryPayload>;
|
|
2350
|
+
/** Delete a pack. */
|
|
2351
|
+
delete(packId: string): Promise<void>;
|
|
2352
|
+
/** Install a pack for the current user. */
|
|
2353
|
+
install(packId: string): Promise<void>;
|
|
2354
|
+
/** Uninstall a pack for the current user. */
|
|
2355
|
+
uninstall(packId: string): Promise<void>;
|
|
2356
|
+
/** List invites for a pack. */
|
|
2357
|
+
listInvites(packId: string): Promise<PackInvitePayload[]>;
|
|
2358
|
+
/** Create an invite for a pack. */
|
|
2359
|
+
createInvite(packId: string, options?: PackInviteCreateOptions): Promise<PackInvitePayload>;
|
|
2360
|
+
/** List emojis in a pack. */
|
|
2361
|
+
listEmojis(packId: string): Promise<PackEmojiPayload[]>;
|
|
2362
|
+
/** Create an emoji in a pack. */
|
|
2363
|
+
createEmoji(packId: string, options: ExpressionCreateOptions): Promise<PackEmojiPayload>;
|
|
2364
|
+
/** Bulk-create emojis in a pack. */
|
|
2365
|
+
createEmojisBulk(packId: string, emojis: ExpressionCreateOptions[]): Promise<PackBulkCreatePayload<PackEmojiPayload>>;
|
|
2366
|
+
/** Edit an emoji in a pack. */
|
|
2367
|
+
editEmoji(packId: string, emojiId: string, options: ExpressionEditOptions): Promise<PackEmojiPayload>;
|
|
2368
|
+
/** Delete an emoji from a pack. */
|
|
2369
|
+
deleteEmoji(packId: string, emojiId: string): Promise<void>;
|
|
2370
|
+
/** List stickers in a pack. */
|
|
2371
|
+
listStickers(packId: string): Promise<PackStickerPayload[]>;
|
|
2372
|
+
/** Create a sticker in a pack. */
|
|
2373
|
+
createSticker(packId: string, options: StickerCreateOptions): Promise<PackStickerPayload>;
|
|
2374
|
+
/** Bulk-create stickers in a pack. */
|
|
2375
|
+
createStickersBulk(packId: string, stickers: StickerCreateOptions[]): Promise<PackBulkCreatePayload<PackStickerPayload>>;
|
|
2376
|
+
/** Edit a sticker in a pack. */
|
|
2377
|
+
editSticker(packId: string, stickerId: string, options: StickerEditOptions): Promise<PackStickerPayload>;
|
|
2378
|
+
/** Delete a sticker from a pack. */
|
|
2379
|
+
deleteSticker(packId: string, stickerId: string): Promise<void>;
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
/** Event name constants for client.on(Events.X, handler). Use with ClientEvents for typed callbacks. */
|
|
2383
|
+
declare const Events: {
|
|
2384
|
+
readonly Ready: "ready";
|
|
2385
|
+
readonly MessageCreate: "messageCreate";
|
|
2386
|
+
readonly MessageUpdate: "messageUpdate";
|
|
2387
|
+
readonly MessageDelete: "messageDelete";
|
|
2388
|
+
readonly MessageDeleteBulk: "messageDeleteBulk";
|
|
2389
|
+
readonly MessageReactionAdd: "messageReactionAdd";
|
|
2390
|
+
readonly MessageReactionAddMany: "messageReactionAddMany";
|
|
2391
|
+
readonly MessageReactionRemove: "messageReactionRemove";
|
|
2392
|
+
readonly MessageReactionRemoveAll: "messageReactionRemoveAll";
|
|
2393
|
+
readonly MessageReactionRemoveEmoji: "messageReactionRemoveEmoji";
|
|
2394
|
+
readonly GuildCreate: "guildCreate";
|
|
2395
|
+
readonly GuildUpdate: "guildUpdate";
|
|
2396
|
+
readonly GuildDelete: "guildDelete";
|
|
2397
|
+
readonly GuildBanAdd: "guildBanAdd";
|
|
2398
|
+
readonly GuildBanRemove: "guildBanRemove";
|
|
2399
|
+
readonly GuildAuditLogEntryCreate: "guildAuditLogEntryCreate";
|
|
2400
|
+
readonly GuildEmojisUpdate: "guildEmojisUpdate";
|
|
2401
|
+
readonly GuildStickersUpdate: "guildStickersUpdate";
|
|
2402
|
+
readonly GuildCountsUpdate: "guildCountsUpdate";
|
|
2403
|
+
readonly ChannelMemberCountsUpdate: "channelMemberCountsUpdate";
|
|
2404
|
+
readonly GuildMemberAdd: "guildMemberAdd";
|
|
2405
|
+
readonly GuildMemberUpdate: "guildMemberUpdate";
|
|
2406
|
+
readonly GuildMemberRemove: "guildMemberRemove";
|
|
2407
|
+
readonly GuildMembersChunk: "guildMembersChunk";
|
|
2408
|
+
readonly GuildRoleCreate: "guildRoleCreate";
|
|
2409
|
+
readonly GuildRoleUpdate: "guildRoleUpdate";
|
|
2410
|
+
readonly GuildRoleDelete: "guildRoleDelete";
|
|
2411
|
+
readonly ChannelCreate: "channelCreate";
|
|
2412
|
+
readonly ChannelUpdate: "channelUpdate";
|
|
2413
|
+
readonly ChannelDelete: "channelDelete";
|
|
2414
|
+
readonly ChannelPinsUpdate: "channelPinsUpdate";
|
|
2415
|
+
readonly InviteCreate: "inviteCreate";
|
|
2416
|
+
readonly InviteDelete: "inviteDelete";
|
|
2417
|
+
readonly TypingStart: "typingStart";
|
|
2418
|
+
readonly UserUpdate: "userUpdate";
|
|
2419
|
+
readonly UserConnectionsUpdate: "userConnectionsUpdate";
|
|
2420
|
+
readonly WebAuthnCredentialsUpdate: "webauthnCredentialsUpdate";
|
|
2421
|
+
readonly PresenceUpdate: "presenceUpdate";
|
|
2422
|
+
readonly PresenceUpdateBulk: "presenceUpdateBulk";
|
|
2423
|
+
readonly VoiceStateUpdate: "voiceStateUpdate";
|
|
2424
|
+
readonly VoiceStateAck: "voiceStateAck";
|
|
2425
|
+
readonly VoiceServerUpdate: "voiceServerUpdate";
|
|
2426
|
+
readonly EntranceSoundPlay: "entranceSoundPlay";
|
|
2427
|
+
readonly VoiceStatesSync: "voiceStatesSync";
|
|
2428
|
+
readonly WebhooksUpdate: "webhooksUpdate";
|
|
2429
|
+
readonly Resumed: "resumed";
|
|
2430
|
+
readonly Error: "error";
|
|
2431
|
+
readonly Debug: "debug";
|
|
2432
|
+
};
|
|
2433
|
+
|
|
2434
|
+
/** Minimal message data for MessageDelete when the full message is not available. */
|
|
2435
|
+
interface PartialMessage {
|
|
2436
|
+
id: string;
|
|
2437
|
+
channelId: string;
|
|
2438
|
+
channel?: Channel | null;
|
|
2439
|
+
/** Message content, when provided by the gateway (e.g. Fluxer). */
|
|
2440
|
+
content?: string | null;
|
|
2441
|
+
/** Author user ID, when provided by the gateway (e.g. Fluxer). */
|
|
2442
|
+
authorId?: string | null;
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
/**
|
|
2446
|
+
|
|
2447
|
+
* Callback parameter types for client events. Use with client.on(Events.X, handler).
|
|
2448
|
+
|
|
2449
|
+
* @see Events
|
|
2450
|
+
|
|
2451
|
+
*/
|
|
2452
|
+
interface ClientEvents {
|
|
2453
|
+
[Events.Ready]: [];
|
|
2454
|
+
[Events.MessageCreate]: [message: Message];
|
|
2455
|
+
[Events.MessageUpdate]: [oldMessage: Message | null, newMessage: Message];
|
|
2456
|
+
[Events.MessageDelete]: [message: PartialMessage];
|
|
2457
|
+
[Events.MessageReactionAdd]: [payload: MessageReactionPayload];
|
|
2458
|
+
[Events.MessageReactionAddMany]: [payload: MessageReactionAddManyPayload];
|
|
2459
|
+
[Events.MessageReactionRemove]: [payload: MessageReactionPayload];
|
|
2460
|
+
[Events.MessageReactionRemoveAll]: [payload: MessageReactionRemoveAllPayload];
|
|
2461
|
+
[Events.MessageReactionRemoveEmoji]: [payload: MessageReactionRemoveEmojiPayload];
|
|
2462
|
+
[Events.GuildCreate]: [guild: Guild];
|
|
2463
|
+
[Events.GuildUpdate]: [oldGuild: Guild, newGuild: Guild];
|
|
2464
|
+
[Events.GuildDelete]: [guild: Guild];
|
|
2465
|
+
/** Emitted when any channel type is created. */
|
|
2466
|
+
[Events.ChannelCreate]: [channel: Channel];
|
|
2467
|
+
[Events.ChannelUpdate]: [oldChannel: Channel, newChannel: Channel];
|
|
2468
|
+
[Events.ChannelDelete]: [channel: Channel];
|
|
2469
|
+
[Events.GuildMemberAdd]: [member: GuildMember];
|
|
2470
|
+
[Events.GuildMemberUpdate]: [oldMember: GuildMember | null, newMember: GuildMember];
|
|
2471
|
+
[Events.GuildMemberRemove]: [member: GuildMember];
|
|
2472
|
+
[Events.GuildMembersChunk]: [payload: GuildMembersChunkPayload];
|
|
2473
|
+
[Events.GuildCountsUpdate]: [payload: GuildCountsUpdatePayload];
|
|
2474
|
+
[Events.ChannelMemberCountsUpdate]: [payload: ChannelMemberCountsUpdatePayload];
|
|
2475
|
+
[Events.GuildAuditLogEntryCreate]: [payload: AuditLogEntryPayload];
|
|
2476
|
+
/** Voice events stay wire-shaped (frozen voice package compatibility). */
|
|
2477
|
+
[Events.VoiceStateUpdate]: [data: GatewayVoiceStateUpdateDispatchData];
|
|
2478
|
+
[Events.VoiceStateAck]: [data: GatewayVoiceStateAckDispatchData];
|
|
2479
|
+
[Events.VoiceServerUpdate]: [data: GatewayVoiceServerUpdateDispatchData];
|
|
2480
|
+
[Events.EntranceSoundPlay]: [data: GatewayEntranceSoundPlayDispatchData];
|
|
2481
|
+
[Events.VoiceStatesSync]: [data: GatewayVoiceStatesSyncData];
|
|
2482
|
+
[Events.MessageDeleteBulk]: [payload: MessageDeleteBulkPayload];
|
|
2483
|
+
[Events.GuildBanAdd]: [ban: GuildBan];
|
|
2484
|
+
[Events.GuildBanRemove]: [ban: GuildBan];
|
|
2485
|
+
[Events.GuildEmojisUpdate]: [payload: GuildEmojisUpdatePayload];
|
|
2486
|
+
[Events.GuildStickersUpdate]: [payload: GuildStickersUpdatePayload];
|
|
2487
|
+
[Events.GuildRoleCreate]: [role: Role];
|
|
2488
|
+
[Events.GuildRoleUpdate]: [payload: GuildRoleUpdatePayload];
|
|
2489
|
+
[Events.GuildRoleDelete]: [payload: GuildRoleDeletePayload];
|
|
2490
|
+
[Events.ChannelPinsUpdate]: [payload: ChannelPinsUpdatePayload];
|
|
2491
|
+
[Events.InviteCreate]: [invite: Invite];
|
|
2492
|
+
[Events.InviteDelete]: [payload: InviteDeletePayload];
|
|
2493
|
+
[Events.TypingStart]: [payload: TypingStartPayload];
|
|
2494
|
+
[Events.UserUpdate]: [user: User];
|
|
2495
|
+
[Events.UserConnectionsUpdate]: [data: GatewayUserConnectionsUpdateDispatchData];
|
|
2496
|
+
[Events.WebAuthnCredentialsUpdate]: [data: GatewayWebAuthnCredentialsUpdateDispatchData];
|
|
2497
|
+
[Events.PresenceUpdate]: [payload: PresenceUpdatePayload];
|
|
2498
|
+
[Events.PresenceUpdateBulk]: [payload: PresenceUpdateBulkPayload];
|
|
2499
|
+
[Events.WebhooksUpdate]: [payload: WebhooksUpdatePayload];
|
|
2500
|
+
[Events.Resumed]: [];
|
|
2501
|
+
[Events.Error]: [error: Error];
|
|
2502
|
+
[Events.Debug]: [message: string];
|
|
2503
|
+
}
|
|
2504
|
+
type ClientEventName = keyof ClientEvents;
|
|
2505
|
+
type ClientEventListener<K extends ClientEventName> = (...args: ClientEvents[K]) => void;
|
|
2506
|
+
/** Typed event handler methods. */
|
|
2507
|
+
type ClientEventMethods = {
|
|
2508
|
+
[K in keyof typeof Events]: (cb: (...args: ClientEvents[(typeof Events)[K]]) => void) => Client;
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
/** Bootstrap origin for {@link Client.fromDiscovery}. */
|
|
2512
|
+
type DiscoveryOrigin = string | {
|
|
2513
|
+
api: string;
|
|
2514
|
+
version?: string;
|
|
2515
|
+
};
|
|
2516
|
+
/** Main Fluxer bot client. Connects to the gateway, emits events, and provides REST access. */
|
|
2517
|
+
declare class Client extends EventEmitter {
|
|
2518
|
+
/** REST client for making API requests. */
|
|
2519
|
+
readonly rest: REST;
|
|
2520
|
+
/**
|
|
2521
|
+
* Resolved instance endpoints (API, CDN, invite, …) for this client.
|
|
2522
|
+
* Isolated per client — safe for multi-instance processes.
|
|
2523
|
+
*/
|
|
2524
|
+
readonly instance: ResolvedInstance;
|
|
2525
|
+
/** Guild cache and manager. */
|
|
2526
|
+
readonly guilds: GuildManager;
|
|
2527
|
+
/** Channel cache and manager. */
|
|
2528
|
+
readonly channels: ChannelManager;
|
|
2529
|
+
/** User cache and manager. */
|
|
2530
|
+
readonly users: UserManager;
|
|
2531
|
+
/** Emoji/sticker pack REST wrappers (`/packs/*`). */
|
|
2532
|
+
readonly packs: PackManager;
|
|
2533
|
+
/** Typed event handlers. Prefer `client.events.*` or `client.on(Events.*, ...)`. */
|
|
2534
|
+
readonly events: ClientEventMethods;
|
|
2535
|
+
/** The authenticated bot user. Null until READY is received. */
|
|
2536
|
+
user: ClientUser | null;
|
|
2537
|
+
/** Timestamp when the client became ready. Null until READY is received. */
|
|
2538
|
+
readyAt: Date | null;
|
|
2539
|
+
/** @internal WebSocket manager. */
|
|
2540
|
+
_ws: WebSocketManager | null;
|
|
2541
|
+
/** When waitForGuilds, guild IDs still expected via GUILD_CREATE. */
|
|
2542
|
+
_pendingGuildIds: Set<string> | null;
|
|
2543
|
+
/** @internal Timeout when READY has no guilds but waitForGuilds is set. */
|
|
2544
|
+
_guildStreamSettleTimeout: ReturnType<typeof setTimeout> | null;
|
|
2545
|
+
/** @internal Dispatches queued until Ready when waitForGuilds delays Ready. */
|
|
2546
|
+
_deferredGatewayDispatches: GatewayReceivePayload[];
|
|
2547
|
+
private readonly _messageCache;
|
|
2548
|
+
/** Resolved client options (cache defaults applied). */
|
|
2549
|
+
readonly options: ClientOptions;
|
|
2550
|
+
constructor(options?: ClientOptions);
|
|
2551
|
+
/**
|
|
2552
|
+
* Create a client from instance discovery (`GET /.well-known/fluxer`).
|
|
2553
|
+
* Does not log in — call {@link login} with a token afterward.
|
|
2554
|
+
*
|
|
2555
|
+
* @param origin - API origin used only to fetch discovery (e.g. `https://api.example.com`)
|
|
2556
|
+
* @param options - Client options (must not conflict with discovered `endpoints.api`)
|
|
2557
|
+
* @param connectOptions - Optional abort signal for the discovery request
|
|
2558
|
+
*/
|
|
2559
|
+
static fromDiscovery(origin: DiscoveryOrigin, options?: Omit<ClientOptions, 'instance'>, connectOptions?: {
|
|
2560
|
+
signal?: AbortSignal;
|
|
2561
|
+
}): Promise<Client>;
|
|
2562
|
+
/** Register an event listener for a specific event type. */
|
|
2563
|
+
on<K extends ClientEventName>(event: K, listener: ClientEventListener<K>): this;
|
|
2564
|
+
on(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
2565
|
+
/** Register a one-time event listener for a specific event type. */
|
|
2566
|
+
once<K extends ClientEventName>(event: K, listener: ClientEventListener<K>): this;
|
|
2567
|
+
once(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
2568
|
+
/** Remove an event listener for a specific event type. */
|
|
2569
|
+
off<K extends ClientEventName>(event: K, listener: ClientEventListener<K>): this;
|
|
2570
|
+
off(event: string | symbol, listener: (...args: unknown[]) => void): this;
|
|
2571
|
+
/** Emit an event with typed arguments. */
|
|
2572
|
+
emit<K extends ClientEventName>(event: K, ...args: ClientEvents[K]): boolean;
|
|
2573
|
+
emit(event: string | symbol, ...args: unknown[]): boolean;
|
|
2574
|
+
/**
|
|
2575
|
+
* Resolve emoji input to API format (e.g., `name:id` or Unicode).
|
|
2576
|
+
* @param emoji - Emoji string or object with name/id/animated
|
|
2577
|
+
* @param guildId - Guild ID for custom emoji lookup (optional)
|
|
2578
|
+
* @returns Resolved emoji string for API payloads
|
|
2579
|
+
*/
|
|
2580
|
+
resolveEmoji(emoji: string | {
|
|
2581
|
+
name: string;
|
|
2582
|
+
id?: string;
|
|
2583
|
+
animated?: boolean;
|
|
2584
|
+
}, guildId?: string | null): Promise<string>;
|
|
2585
|
+
/**
|
|
2586
|
+
* Fetch instance discovery document (`/.well-known/fluxer`).
|
|
2587
|
+
* @returns Instance configuration (endpoints, features, metadata)
|
|
2588
|
+
*/
|
|
2589
|
+
fetchInstance(): Promise<APIInstance>;
|
|
2590
|
+
/**
|
|
2591
|
+
* Fetch gateway connection info (`/gateway`).
|
|
2592
|
+
* @returns Gateway URL, recommended shard count, session start limit
|
|
2593
|
+
*/
|
|
2594
|
+
fetchGatewayInfo(): Promise<APIGatewayBotResponse>;
|
|
2595
|
+
/**
|
|
2596
|
+
* Fetch emoji metadata by ID.
|
|
2597
|
+
* @param emojiId - Emoji snowflake
|
|
2598
|
+
* @returns Emoji metadata (name, pack, tags, etc.)
|
|
2599
|
+
*/
|
|
2600
|
+
fetchEmojiMetadata(emojiId: string): Promise<APIEmojiMetadata>;
|
|
2601
|
+
/**
|
|
2602
|
+
* Fetch sticker metadata by ID.
|
|
2603
|
+
* @param stickerId - Sticker snowflake
|
|
2604
|
+
* @returns Sticker metadata (name, pack, tags, etc.)
|
|
2605
|
+
*/
|
|
2606
|
+
fetchStickerMetadata(stickerId: string): Promise<APIStickerMetadata>;
|
|
2607
|
+
/**
|
|
2608
|
+
* Fetch the current application (`/applications/@me`).
|
|
2609
|
+
* @returns Application metadata (owner, flags, RPC origins, etc.)
|
|
2610
|
+
*/
|
|
2611
|
+
fetchApplication(): Promise<APIApplicationMe>;
|
|
2612
|
+
/**
|
|
2613
|
+
* Fetch OAuth2 applications owned by this bot.
|
|
2614
|
+
* @returns Array of OAuth application objects
|
|
2615
|
+
*/
|
|
2616
|
+
fetchOAuthApplications(): Promise<APIOAuthApplication[]>;
|
|
2617
|
+
/**
|
|
2618
|
+
* Check username#discriminator availability.
|
|
2619
|
+
* @param username - Username to check
|
|
2620
|
+
* @param discriminator - Discriminator to check
|
|
2621
|
+
* @returns Availability result
|
|
2622
|
+
*/
|
|
2623
|
+
checkUsernameTag(username: string, discriminator: string): Promise<APIUserTagCheck>;
|
|
2624
|
+
/**
|
|
2625
|
+
* Preload recent messages for multiple channels (batch endpoint).
|
|
2626
|
+
* @param channelIds - Array of channel IDs to preload
|
|
2627
|
+
* @returns Preload response with message counts/timestamps
|
|
2628
|
+
*/
|
|
2629
|
+
preloadMessages(channelIds: string[]): Promise<APIPreloadMessagesResponse>;
|
|
2630
|
+
/**
|
|
2631
|
+
* Preload recent messages (alternate endpoint).
|
|
2632
|
+
* @param channelIds - Array of channel IDs to preload
|
|
2633
|
+
* @returns Preload response with message counts/timestamps
|
|
2634
|
+
*/
|
|
2635
|
+
preloadMessagesAlt(channelIds: string[]): Promise<APIPreloadMessagesResponse>;
|
|
2636
|
+
bulkFetchMessages(requests: BulkFetchMessagesRequest[], options?: BulkFetchMessagesOptions & {
|
|
2637
|
+
hydrate?: true;
|
|
2638
|
+
}): Promise<BulkFetchMessagesResult>;
|
|
2639
|
+
bulkFetchMessages(requests: BulkFetchMessagesRequest[], options: BulkFetchMessagesOptions & {
|
|
2640
|
+
hydrate: false;
|
|
2641
|
+
}): Promise<APIBulkMessageFetchResponse>;
|
|
2642
|
+
/** @internal */
|
|
2643
|
+
_getMessageCache(channelId: string): Map<string, APIMessage> | null;
|
|
2644
|
+
/** @internal */
|
|
2645
|
+
_addMessageToCache(channelId: string, data: APIMessage): void;
|
|
2646
|
+
/** @internal */
|
|
2647
|
+
_removeMessageFromCache(channelId: string, messageId: string): void;
|
|
2648
|
+
/** @internal */
|
|
2649
|
+
_clearMessageCache(channelId: string): void;
|
|
2650
|
+
/**
|
|
2651
|
+
* Sweep cached messages (remove entries matching filter).
|
|
2652
|
+
* @param filter - Predicate to test each message (return true to remove)
|
|
2653
|
+
* @param channelId - Optional channel ID to scope sweep
|
|
2654
|
+
* @returns Count of messages removed
|
|
2655
|
+
*/
|
|
2656
|
+
sweepMessages(filter?: (message: APIMessage, channelId: string) => boolean, channelId?: string): number;
|
|
2657
|
+
/**
|
|
2658
|
+
* Sweep cached members across all guilds (remove entries matching filter).
|
|
2659
|
+
* @param filter - Predicate to test each member (return true to remove)
|
|
2660
|
+
* @returns Total count of members removed
|
|
2661
|
+
*/
|
|
2662
|
+
sweepMembers(filter?: (member: GuildMember, guildId: string) => boolean): number;
|
|
2663
|
+
/**
|
|
2664
|
+
* Get or create a {@link User} from partial API data (hydrates cache).
|
|
2665
|
+
* @param data - Partial user data from API
|
|
2666
|
+
* @returns Existing or newly created User instance
|
|
2667
|
+
* @internal
|
|
2668
|
+
*/
|
|
2669
|
+
getOrCreateUser(data: APIUserPartial): User;
|
|
2670
|
+
/**
|
|
2671
|
+
* The underlying {@link WebSocketManager} (throws if not logged in).
|
|
2672
|
+
* @throws {@link FluxerError} with {@link ErrorCodes.NotLoggedIn}
|
|
2673
|
+
*/
|
|
2674
|
+
get ws(): WebSocketManager;
|
|
2675
|
+
/**
|
|
2676
|
+
* Send a gateway payload to a specific shard.
|
|
2677
|
+
* @param shardId - Shard ID (0-indexed)
|
|
2678
|
+
* @param payload - Gateway send payload (opcode + data)
|
|
2679
|
+
*/
|
|
2680
|
+
sendToGateway(shardId: number, payload: GatewaySendPayload): void;
|
|
2681
|
+
/**
|
|
2682
|
+
* Broadcast a gateway payload to all shards.
|
|
2683
|
+
* @param payload - Gateway send payload
|
|
2684
|
+
* @internal
|
|
2685
|
+
*/
|
|
2686
|
+
_sendToAllShards(payload: GatewaySendPayload): void;
|
|
2687
|
+
/** @internal Process gateway dispatch payloads. */
|
|
2688
|
+
private handleDispatch;
|
|
2689
|
+
/**
|
|
2690
|
+
* Connect to the gateway with a bot token.
|
|
2691
|
+
* @param token - Bot token from the developer portal
|
|
2692
|
+
* @param options - Optional abort signal for cancellation
|
|
2693
|
+
* @returns The token that was used (echo)
|
|
2694
|
+
* @throws {@link FluxerError} if already logged in or token is invalid
|
|
2695
|
+
*/
|
|
2696
|
+
login(token: string, options?: {
|
|
2697
|
+
signal?: AbortSignal;
|
|
2698
|
+
}): Promise<string>;
|
|
2699
|
+
/** @internal Finalize the READY event emission. */
|
|
2700
|
+
_finalizeReady(): void;
|
|
2701
|
+
/** @internal Mark a guild as received during startup. */
|
|
2702
|
+
_onGuildReceived(guildId: string): void;
|
|
2703
|
+
/**
|
|
2704
|
+
* Disconnect from gateway, clear all caches, and reset state.
|
|
2705
|
+
* Safe to call {@link login} again after destroy.
|
|
2706
|
+
*/
|
|
2707
|
+
destroy(): Promise<void>;
|
|
2708
|
+
/**
|
|
2709
|
+
* Type guard for ready state (narrows `client.user` to non-null).
|
|
2710
|
+
* @returns true if Ready was received
|
|
2711
|
+
*/
|
|
2712
|
+
isReady(): this is Client & {
|
|
2713
|
+
user: NonNullable<Client['user']>;
|
|
2714
|
+
};
|
|
2715
|
+
/**
|
|
2716
|
+
* Assertion that client is ready (throws if not).
|
|
2717
|
+
* @throws {@link FluxerError} with {@link ErrorCodes.ClientNotReady}
|
|
2718
|
+
*/
|
|
2719
|
+
assertReady(): asserts this is Client & {
|
|
2720
|
+
user: NonNullable<Client['user']>;
|
|
2721
|
+
};
|
|
2722
|
+
static get Routes(): typeof Routes;
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
export { Invite as $, AllowedMentions as A, Base as B, type CacheSizeLimits as C, DEFAULT_CACHE_LIMITS as D, type DiscoveryApplicationPayload as E, type DiscoveryOrigin as F, type DiscoveryStatusPayload as G, Events as H, type ExpressionCreateOptions as I, type ExpressionEditOptions as J, type FetchMessagesOptions as K, type FetchPinnedMessagesOptions as L, type FetchedUserWithProfile as M, Guild as N, GuildBan as O, GuildChannel as P, GuildEmoji as Q, type GuildEmojisUpdatePayload as R, GuildMember as S, type GuildMemberEditOptions as T, GuildMemberManager as U, GuildMemberRoleManager as V, type GuildMemberSearchHit as W, type GuildMemberSearchOptions as X, type GuildMemberSearchPayload as Y, type GuildRoleDeletePayload as Z, GuildSticker as _, type AllowedMentionsOptions as a, toAttachmentUploadPlanBody as a$, type InviteDeletePayload as a0, LinkChannel as a1, Message as a2, type MessageAttachmentEdit as a3, MessageCollector as a4, type MessageCollectorEndReason as a5, type MessageCollectorOptions as a6, type MessageDeleteBulkPayload as a7, type MessageEditOptions as a8, MessageManager as a9, type ReactionEmojiPayload as aA, type ReplyOptions as aB, type ResolvedInstance as aC, Role as aD, type RoleCreateOptions as aE, type RoleEditOptions as aF, type RoleResolvable as aG, type RtcRegionPayload as aH, type StickerCreateOptions as aI, type StickerEditOptions as aJ, type SudoVerificationOptions as aK, TextChannel as aL, type TypingStartPayload as aM, type UploadFileForSend as aN, User as aO, UserManager as aP, type VanityURLPayload as aQ, VoiceChannel as aR, Webhook as aS, type WebhookEditOptions as aT, type WebhookMessageEditOptions as aU, type WebhookSendOptions as aV, inviteUrl as aW, normalizeApiOrigin as aX, parseInstanceDiscovery as aY, resolveInstanceEndpoints as aZ, toAttachmentUploadCompleteBody as a_, MessageReaction as aa, type MessageReactionPayload as ab, type MessageReactionRemoveAllPayload as ac, type MessageReactionRemoveEmojiPayload as ad, type MessageReplyTarget as ae, type MessageSendOptions as af, type PackBulkCreatePayload as ag, type PackCreateOptions as ah, type PackDashboardPayload as ai, type PackDashboardSectionPayload as aj, type PackEditOptions as ak, type PackEmojiPayload as al, type PackInviteCreateOptions as am, type PackInvitePayload as an, PackManager as ao, type PackStickerPayload as ap, type PackSummaryPayload as aq, type PartialMessage as ar, type PartialUserGuildPayload as as, type PinnedMessagesPage as at, type PresenceUpdateOptions as au, type PresenceUpdatePayload as av, type ProfilePayload as aw, ReactionCollector as ax, type ReactionCollectorEndReason as ay, type ReactionCollectorOptions as az, type AttachmentUploadCompleteItem as b, toBulkFetchWire as b0, toChannelEditBody as b1, toChannelInviteBody as b2, toDiscoveryApplicationPayload as b3, toDiscoveryBody as b4, toDiscoveryStatusPayload as b5, toEmojiCreateBody as b6, toEmojiEditBody as b7, toMemberEditBody as b8, toMemberSearchBody as b9, toMessageAttachmentEditWire as ba, toPackInviteBody as bb, toPackSummaryPayload as bc, toPresenceWire as bd, toProfilePayload as be, toStickerCreateBody as bf, toStickerEditBody as bg, toSudoBody as bh, type AttachmentUploadCompleteResponse as c, type AttachmentUploadPlanItem as d, type AttachmentUploadPlanResponse as e, type AuditLogEntryPayload as f, type AuditLogFetchPayload as g, type BulkFetchMessagesChannelResult as h, type BulkFetchMessagesOptions as i, type BulkFetchMessagesRequest as j, type BulkFetchMessagesResult as k, CategoryChannel as l, Channel as m, type ChannelEditOptions as n, type ChannelInviteCreateOptions as o, ChannelManager as p, type ChannelSlowmodePayload as q, Client as r, type ClientEventMethods as s, type ClientEvents as t, type ClientOptions as u, ClientUser as v, type CollectedReaction as w, DEFAULT_INSTANCE_ENDPOINTS as x, DMChannel as y, type DiscoveryApplicationOptions as z };
|