@fluxerjs/core 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,126 +1,13 @@
1
- import * as _fluxerjs_types from '@fluxerjs/types';
2
- import { APISticker, APIEmoji, APIEmbed, APIWebhook, APIWebhookUpdateRequest, APIWebhookTokenUpdateRequest, APIChannelOverwrite, APIChannel, APIChannelPartial, ChannelType, GatewayReactionEmoji, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, APIMessageAttachment, MessageType, APIMessageSticker, APIMessageReaction, APIMessageReference, APIMessageSnapshot, APIMessageCall, APIMessage, APIUserPartial, APIGuildMember, APIRole, RESTUpdateRoleBody, APIBan, GuildFeature, GuildVerificationLevel, DefaultMessageNotifications, GuildExplicitContentFilter, GuildMFALevel, APIGuild, RESTCreateRoleBody, APIGuildAuditLog, APIVanityURL, APIGuildPartial, APIInvite, GatewayPresenceUpdateData, APIProfileResponse, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayWebhooksUpdateDispatchData, APIInstance, GatewaySendPayload, Routes } from '@fluxerjs/types';
1
+ import { EventEmitter } from 'events';
2
+ import { REST } from '@fluxerjs/rest';
3
+ import { WebSocketManager } from '@fluxerjs/ws';
4
+ import { APIEmbed, APIUserPartial, APIRole, RESTUpdateRoleBody, APIGuildMember, APIWebhook, APIWebhookUpdateRequest, APIWebhookTokenUpdateRequest, APIBan, APIEmoji, APISticker, GuildFeature, GuildVerificationLevel, DefaultMessageNotifications, GuildExplicitContentFilter, GuildMFALevel, APIGuild, RESTCreateRoleBody, APIGuildAuditLog, APIVanityURL, GatewayReactionEmoji, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, APIMessageAttachment, MessageType, APIMessageSticker, APIMessageReaction, APIMessageReference, APIMessageSnapshot, APIMessageCall, APIMessage, APIGuildPartial, APIChannelPartial, APIInvite, APIChannelOverwrite, APIChannel, ChannelType, GatewayPresenceUpdateData, APIProfileResponse, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, APIApplicationCommandInteraction, GatewayVoiceStateUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayInviteDeleteDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayWebhooksUpdateDispatchData, APIInstance, GatewaySendPayload, Routes } from '@fluxerjs/types';
3
5
  export { GatewayOpcodes, MessageAttachmentFlags, Routes } from '@fluxerjs/types';
4
- import { PermissionResolvable } from '@fluxerjs/util';
5
- export { PermissionFlags, PermissionResolvable, PermissionString, PermissionsBitField, UserFlagsBitField, UserFlagsBits, UserFlagsResolvable, UserFlagsString, parsePrefixCommand, parseUserMention, resolvePermissionsToBitfield, resolveTenorToImageUrl } from '@fluxerjs/util';
6
6
  import { Collection } from '@fluxerjs/collection';
7
7
  import { EmbedBuilder } from '@fluxerjs/builders';
8
8
  export { AttachmentBuilder, EmbedBuilder, MessagePayload } from '@fluxerjs/builders';
9
- import { EventEmitter } from 'events';
10
- import { REST } from '@fluxerjs/rest';
11
- import { WebSocketManager } from '@fluxerjs/ws';
12
-
13
- /** Base class for all Fluxer structures. Provides the client reference. */
14
- declare abstract class Base {
15
- /** The client instance this structure belongs to. */
16
- abstract readonly client: Client;
17
- }
18
-
19
- /** Represents a custom sticker in a guild. */
20
- declare class GuildSticker extends Base {
21
- readonly client: Client;
22
- readonly id: string;
23
- readonly guildId: string;
24
- name: string;
25
- description: string;
26
- readonly tags: string[];
27
- readonly animated: boolean;
28
- /** @param data - API sticker from GET /guilds/{id}/stickers or guild sticker events */
29
- constructor(client: Client, data: APISticker & {
30
- guild_id?: string;
31
- }, guildId: string);
32
- /** CDN URL for this sticker image. */
33
- get url(): string;
34
- /** Delete this sticker. Requires Manage Emojis and Stickers permission. */
35
- delete(): Promise<void>;
36
- /**
37
- * Edit this sticker's name and/or description.
38
- * Requires Manage Emojis and Stickers permission.
39
- */
40
- edit(options: {
41
- name?: string;
42
- description?: string;
43
- }): Promise<GuildSticker>;
44
- }
45
-
46
- /** Represents a custom emoji in a guild. */
47
- declare class GuildEmoji extends Base {
48
- readonly client: Client;
49
- readonly id: string;
50
- readonly guildId: string;
51
- name: string;
52
- readonly animated: boolean;
53
- /** @param data - API emoji from GET /guilds/{id}/emojis or guild emoji events */
54
- constructor(client: Client, data: APIEmoji & {
55
- guild_id?: string;
56
- }, guildId: string);
57
- /** CDN URL for this emoji image. */
58
- get url(): string;
59
- /** Emoji identifier for use in reactions: `name:id` */
60
- get identifier(): string;
61
- /** Delete this emoji. Requires Manage Emojis and Stickers permission. */
62
- delete(): Promise<void>;
63
- /**
64
- * Edit this emoji's name.
65
- * Requires Manage Emojis and Stickers permission.
66
- */
67
- edit(options: {
68
- name: string;
69
- }): Promise<GuildEmoji>;
70
- }
71
-
72
- /**
73
- * Manages messages for a channel. Access via channel.messages.
74
- * @example
75
- * const message = await channel.messages.fetch(messageId);
76
- * if (message) await message.edit({ content: 'Updated!' });
77
- */
78
- declare class MessageManager {
79
- private readonly client;
80
- private readonly channelId;
81
- constructor(client: Client, channelId: string);
82
- /**
83
- * Fetch a message by ID from this channel.
84
- * @param messageId - Snowflake of the message
85
- * @returns The message
86
- * @throws FluxerError with MESSAGE_NOT_FOUND if the message does not exist
87
- */
88
- fetch(messageId: string): Promise<Message>;
89
- }
90
-
91
- interface MessageCollectorOptions {
92
- /** Filter function. Return true to collect the message. */
93
- filter?: (message: Message) => boolean;
94
- /** Max duration in ms. Collector stops when time expires. */
95
- time?: number;
96
- /** Max messages to collect. Collector stops when limit reached. */
97
- max?: number;
98
- }
99
- type MessageCollectorEndReason = 'time' | 'limit' | 'user';
100
- interface MessageCollectorEvents {
101
- collect: [message: Message];
102
- end: [collected: Collection<string, Message>, reason: MessageCollectorEndReason];
103
- }
104
- /**
105
- * Collects messages in a channel. Use channel.createMessageCollector().
106
- * @example
107
- * const collector = channel.createMessageCollector({ filter: m => m.author.id === userId, time: 10000 });
108
- * collector.on('collect', m => console.log(m.content));
109
- * collector.on('end', (collected, reason) => console.log(`Stopped: ${reason}`));
110
- */
111
- declare class MessageCollector extends EventEmitter {
112
- readonly client: Client;
113
- readonly channelId: string;
114
- readonly options: Required<MessageCollectorOptions>;
115
- readonly collected: Collection<string, Message>;
116
- private _timeout;
117
- private _ended;
118
- private _listener;
119
- constructor(client: Client, channelId: string, options?: MessageCollectorOptions);
120
- stop(reason?: MessageCollectorEndReason): void;
121
- on<K extends keyof MessageCollectorEvents>(event: K, listener: (...args: MessageCollectorEvents[K]) => void): this;
122
- emit<K extends keyof MessageCollectorEvents>(event: K, ...args: MessageCollectorEvents[K]): boolean;
123
- }
9
+ import { PermissionResolvable } from '@fluxerjs/util';
10
+ export { PermissionFlags, PermissionResolvable, PermissionString, PermissionsBitField, UserFlagsBitField, UserFlagsBits, UserFlagsResolvable, UserFlagsString, parsePrefixCommand, parseUserMention, resolvePermissionsToBitfield, resolveTenorToImageUrl } from '@fluxerjs/util';
124
11
 
125
12
  /** File data for message attachment uploads. Use `data` for buffers or `url` to fetch from a URL. */
126
13
  type MessageFileData = {
@@ -154,319 +41,803 @@ type MessageSendOptions = string | {
154
41
  attachments?: MessageAttachmentMeta[];
155
42
  };
156
43
 
157
- /** File data for webhook attachment uploads. Use `data` for buffers or `url` to fetch from a URL. */
158
- type WebhookFileData = MessageFileData;
159
- /** Attachment metadata for webhook file uploads (id matches FormData index). */
160
- interface WebhookAttachmentMeta {
161
- id: number;
162
- filename: string;
163
- title?: string | null;
164
- description?: string | null;
165
- /** MessageAttachmentFlags: IS_SPOILER (8), CONTAINS_EXPLICIT_MEDIA (16), IS_ANIMATED (32) */
166
- flags?: number;
167
- }
168
- /** Options for sending a message via webhook. Aligns with WebhookMessageRequest in the API. */
169
- interface WebhookSendOptions {
170
- /** Message text content (up to 2000 characters) */
171
- content?: string;
172
- /** Embed objects. Use EmbedBuilder or APIEmbed; EmbedBuilder is serialized automatically. */
173
- embeds?: (APIEmbed | EmbedBuilder)[];
174
- /** Override the webhook's default username for this message */
175
- username?: string;
176
- /** Override the webhook's default avatar URL for this message */
177
- avatar_url?: string;
178
- /** Text-to-speech */
179
- tts?: boolean;
180
- /** File attachments. When present, uses multipart/form-data (same as channel.send). */
181
- files?: WebhookFileData[];
182
- /** Attachment metadata for files (id = index). Use when files are provided. */
183
- attachments?: WebhookAttachmentMeta[];
44
+ /** Base class for all Fluxer structures. Provides the client reference. */
45
+ declare abstract class Base {
46
+ /** The client instance this structure belongs to. */
47
+ abstract readonly client: Client;
184
48
  }
185
- /**
186
- * Represents a Discord/Fluxer webhook. Supports creating, fetching, sending, and deleting.
187
- * The token is only available when the webhook was created; fetched webhooks cannot send messages.
188
- */
189
- declare class Webhook extends Base {
49
+
50
+ /** Represents a user (or bot) on Fluxer. */
51
+ declare class User extends Base {
190
52
  readonly client: Client;
191
53
  readonly id: string;
192
- readonly guildId: string;
193
- channelId: string;
194
- name: string;
54
+ username: string;
55
+ discriminator: string;
56
+ globalName: string | null;
195
57
  avatar: string | null;
196
- /** Present only when webhook was created via createWebhook(); not returned when fetching. */
197
- readonly token: string | null;
198
- /** User who created the webhook. */
199
- readonly user: User;
200
- /** @param data - API webhook from POST /channels/{id}/webhooks (has token) or GET /webhooks/{id} (no token) */
201
- constructor(client: Client, data: APIWebhook & {
202
- token?: string | null;
203
- });
58
+ readonly bot: boolean;
59
+ /** RGB avatar color (e.g. 7577782). Null if not set. */
60
+ avatarColor: number | null;
61
+ /** Public flags bitfield. Null if not set. */
62
+ flags: number | null;
63
+ /** Whether this is an official system user. */
64
+ readonly system: boolean;
65
+ /** Banner hash (from profile, member, or invite context). Null when not available. */
66
+ banner: string | null;
67
+ /** @param data - API user from message author, GET /users/{id}, or GET /users/@me */
68
+ constructor(client: Client, data: APIUserPartial);
69
+ /** Update mutable fields from fresh API data. Used by getOrCreateUser cache. */
70
+ _patch(data: APIUserPartial): void;
204
71
  /**
205
- * Get the URL for this webhook's avatar.
206
- * Returns null if the webhook has no custom avatar.
72
+ * Get the URL for this user's avatar.
73
+ * Auto-detects animated avatars (hash starting with `a_`) and uses gif extension.
74
+ * @param options - Optional `size` and `extension` (default: png, or gif for animated)
207
75
  */
208
76
  avatarURL(options?: {
209
77
  size?: number;
210
78
  extension?: string;
211
79
  }): string | null;
212
- /** Delete this webhook. Requires bot token with Manage Webhooks permission. */
213
- delete(): Promise<void>;
214
- /**
215
- * Edit this webhook. With token: name and avatar only. Without token (bot auth): name, avatar, and channel_id.
216
- * @param options - Fields to update (name, avatar, channel_id when using bot auth)
217
- * @returns This webhook instance with updated fields
218
- */
219
- edit(options: APIWebhookUpdateRequest | APIWebhookTokenUpdateRequest): Promise<Webhook>;
80
+ /** Get the avatar URL, or the default avatar if none set (Fluxer: fluxerstatic.com). */
81
+ displayAvatarURL(options?: {
82
+ size?: number;
83
+ extension?: string;
84
+ }): string;
220
85
  /**
221
- * Send a message via this webhook. Requires the webhook token (only present when created, not when fetched).
222
- * @param options - Text content or object with content, embeds, username, avatar_url, tts, files, attachments
223
- * @param wait - If true, waits for the API and returns the created Message; otherwise returns void (204)
224
- * @throws Error if token is not available
225
- * @example
226
- * await webhook.send('Hello!');
227
- * await webhook.send({ embeds: [embed] });
228
- * await webhook.send({ content: 'File attached', files: [{ name: 'data.txt', data: buffer }] });
229
- * const msg = await webhook.send({ content: 'Hi' }, true);
86
+ * Get the URL for this user's banner.
87
+ * Returns null if the user has no banner (only available when fetched from profile/member context).
230
88
  */
231
- send(options: string | WebhookSendOptions, wait?: boolean): Promise<Message | undefined>;
89
+ bannerURL(options?: {
90
+ size?: number;
91
+ extension?: string;
92
+ }): string | null;
93
+ /** Returns a mention string (e.g. `<@123456>`). */
94
+ toString(): string;
232
95
  /**
233
- * Fetch a webhook by ID using bot auth.
234
- * @param client - The client instance
235
- * @param webhookId - The webhook ID
236
- * @returns Webhook without token (cannot send)
96
+ * Create or get a DM channel with this user.
97
+ * Returns the DM channel; use {@link DMChannel.send} to send messages.
237
98
  */
238
- static fetch(client: Client, webhookId: string): Promise<Webhook>;
99
+ createDM(): Promise<DMChannel>;
239
100
  /**
240
- * Create a Webhook instance from an ID and token (e.g. from a stored webhook URL).
241
- * @param client - The client instance
242
- * @param webhookId - The webhook ID
243
- * @param token - The webhook token (from createWebhook or stored)
244
- * @param options - Optional channelId, guildId, name for display
101
+ * Send a DM to this user.
102
+ * Convenience method that creates the DM channel and sends the message.
245
103
  */
246
- static fromToken(client: Client, webhookId: string, token: string, options?: {
247
- channelId?: string;
248
- guildId?: string;
249
- name?: string;
250
- }): Webhook;
104
+ send(options: MessageSendOptions): Promise<Message>;
251
105
  }
252
106
 
253
- /** Base class for all channel types. */
254
- declare abstract class Channel extends Base {
255
- /** Whether this channel has a send method (TextChannel, DMChannel). */
256
- isSendable(): this is TextChannel | DMChannel;
257
- /** Whether this channel is a DM or Group DM. */
258
- isDM(): boolean;
259
- /** Whether this channel is voice-based (VoiceChannel). */
260
- isVoice(): boolean;
261
- /** Create a DM channel from API data (type DM or GroupDM). */
262
- static createDM(client: Client, data: APIChannelPartial): DMChannel;
263
- readonly client: Client;
107
+ /** Represents a role in a guild. */
108
+ declare class Role extends Base {
109
+ readonly client: Client;
264
110
  readonly id: string;
265
- type: ChannelType;
266
- /** Channel name. Guild channels and Group DMs have names; 1:1 DMs are typically null. */
267
- name: string | null;
268
- /** Channel icon hash (Group DMs). Null if none. */
269
- icon: string | null;
270
- /** ISO timestamp when the last message was pinned. Null if never pinned. */
271
- lastPinTimestamp: string | null;
272
- /** @param data - API channel from GET /channels/{id} or GET /guilds/{id}/channels */
273
- constructor(client: Client, data: APIChannelPartial);
111
+ readonly guildId: string;
112
+ name: string;
113
+ color: number;
114
+ position: number;
115
+ permissions: string;
116
+ hoist: boolean;
117
+ mentionable: boolean;
118
+ unicodeEmoji: string | null;
119
+ /** Separately sorted position for hoisted roles. Null if not set. */
120
+ hoistPosition: number | null;
121
+ /** @param client - The client instance */
122
+ /** @param data - API role from GET /guilds/{id}/roles or gateway role events */
123
+ /** @param guildId - The guild this role belongs to */
124
+ constructor(client: Client, data: APIRole, guildId: string);
125
+ /** Update mutable fields from fresh API data. Used by edit and gateway events. */
126
+ _patch(data: Partial<APIRole>): void;
127
+ /** Returns a mention string (e.g. `<@&123456>`). */
128
+ toString(): string;
274
129
  /**
275
- * Create the appropriate channel subclass from API data.
276
- * @param client - The client instance
277
- * @param data - Channel data from the API
130
+ * Check if this role has a permission. Administrator grants all permissions.
131
+ * @param permission - Permission flag, name, or resolvable
132
+ * @returns true if the role has the permission
133
+ * @example
134
+ * if (role.has(PermissionFlags.BanMembers)) { ... }
135
+ * if (role.has('ManageChannels')) { ... }
278
136
  */
279
- static from(client: Client, data: APIChannel | APIChannelPartial): GuildChannel | TextChannel | null;
137
+ has(permission: PermissionResolvable): boolean;
280
138
  /**
281
- * Create a channel from API data, including DM and GroupDM.
282
- * Used by ChannelManager.fetch() for GET /channels/{id}.
139
+ * Edit this role.
140
+ * Requires Manage Roles permission.
141
+ * @param options - Role updates (permissions accepts PermissionResolvable for convenience)
142
+ * @returns This role (updated in place)
143
+ * @example
144
+ * await role.edit({ name: 'Moderator', permissions: ['BanMembers', 'KickMembers'] });
283
145
  */
284
- static fromOrCreate(client: Client, data: APIChannel | APIChannelPartial): TextChannel | DMChannel | GuildChannel | null;
146
+ edit(options: RESTUpdateRoleBody & {
147
+ permissions?: string | PermissionResolvable;
148
+ }): Promise<Role>;
285
149
  /**
286
- * Bulk delete messages. Requires Manage Messages permission.
287
- * @param messageIds - Array of message IDs to delete (2–100)
150
+ * Delete this role.
151
+ * Requires Manage Roles permission.
288
152
  */
289
- bulkDeleteMessages(messageIds: string[]): Promise<void>;
153
+ delete(): Promise<void>;
154
+ }
155
+
156
+ /** Role ID or Role object for add/remove. */
157
+ type RoleResolvable = string | Role;
158
+ /**
159
+ * Manages a guild member's roles with add/remove/set and a cache of Role objects.
160
+ * Discord.js parity: member.roles.add(), member.roles.remove(), member.roles.set(), member.roles.cache
161
+ *
162
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberRoleManager
163
+ * @example
164
+ * // Add a role (Discord.js style)
165
+ * await member.roles.add(roleId);
166
+ *
167
+ * @example
168
+ * // Remove a role
169
+ * await member.roles.remove(roleId);
170
+ *
171
+ * @example
172
+ * // Replace all roles
173
+ * await member.roles.set(['roleId1', 'roleId2']);
174
+ *
175
+ * @example
176
+ * // Check if member has a role
177
+ * if (member.roles.cache.has(roleId)) { ... }
178
+ */
179
+ declare class GuildMemberRoleManager {
180
+ private readonly member;
181
+ private _roleIds;
182
+ constructor(member: GuildMember, initialRoleIds?: string[]);
183
+ /** Role IDs for this member. Used by permissions; prefer cache for Role objects. */
184
+ get roleIds(): readonly string[];
185
+ /** Check if the member has a role. Discord.js parity: member.roles.cache.has(roleId) */
186
+ has(roleOrId: RoleResolvable): boolean;
187
+ /**
188
+ * Collection of Role objects for this member's roles (from guild.roles).
189
+ * Discord.js parity: member.roles.cache
190
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberRoleManager
191
+ */
192
+ get cache(): Collection<string, Role>;
193
+ /** Resolve role ID from RoleResolvable. */
194
+ private _resolveId;
290
195
  /**
291
- * Send a typing indicator to the channel. Lasts ~10 seconds.
196
+ * Add a role to this member.
197
+ * Discord.js parity: member.roles.add(roleId)
198
+ * Requires Manage Roles permission.
199
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberRoleManager
292
200
  */
293
- sendTyping(): Promise<void>;
294
- }
295
- declare class GuildChannel extends Channel {
296
- readonly guildId: string;
297
- name: string | null;
298
- position?: number;
299
- parentId: string | null;
300
- /** Permission overwrites for roles and members. */
301
- permissionOverwrites: APIChannelOverwrite[];
302
- constructor(client: Client, data: APIChannel);
201
+ add(roleOrId: RoleResolvable): Promise<void>;
303
202
  /**
304
- * Create a webhook in this channel.
305
- * @param options - Webhook name and optional avatar URL
306
- * @returns The webhook with token (required for send()). Requires Manage Webhooks permission.
203
+ * Remove a role from this member.
204
+ * Discord.js parity: member.roles.remove(roleId)
205
+ * Requires Manage Roles permission.
206
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberRoleManager
307
207
  */
308
- createWebhook(options: {
309
- name: string;
310
- avatar?: string | null;
311
- }): Promise<Webhook>;
208
+ remove(roleOrId: RoleResolvable): Promise<void>;
312
209
  /**
313
- * Fetch all webhooks in this channel.
314
- * @returns Webhooks (includes token when listing from channel; can send via send())
210
+ * Replace all roles for this member. PATCH /guilds/{id}/members/{userId}
211
+ * Discord.js parity: member.roles.set(roleIds)
212
+ * Requires Manage Roles permission.
213
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberRoleManager
315
214
  */
316
- fetchWebhooks(): Promise<Webhook[]>;
215
+ set(roleIds: string[]): Promise<void>;
317
216
  /**
318
- * Create an invite for this channel.
319
- * @param options - max_uses (0–100), max_age (0–604800 seconds), unique, temporary
320
- * Requires Create Instant Invite permission.
217
+ * Update internal role IDs from API response. Called by GuildMember.edit().
218
+ * @internal
321
219
  */
322
- createInvite(options?: {
323
- max_uses?: number;
324
- max_age?: number;
325
- unique?: boolean;
326
- temporary?: boolean;
327
- }): Promise<Invite>;
220
+ _patch(roleIds: string[]): void;
221
+ }
222
+
223
+ /** Represents a member of a guild. */
224
+ declare class GuildMember extends Base {
225
+ readonly client: Client;
226
+ readonly id: string;
227
+ readonly user: User;
228
+ readonly guild: Guild;
229
+ nick: string | null;
328
230
  /**
329
- * Fetch invites for this channel.
330
- * Requires Manage Channel permission.
231
+ * Role manager with add/remove/set and cache. Discord.js parity: member.roles.add(), member.roles.cache
232
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberRoleManager
331
233
  */
332
- fetchInvites(): Promise<Invite[]>;
234
+ readonly roles: GuildMemberRoleManager;
235
+ readonly joinedAt: Date;
236
+ communicationDisabledUntil: Date | null;
237
+ readonly mute: boolean;
238
+ readonly deaf: boolean;
239
+ readonly avatar: string | null;
240
+ readonly banner: string | null;
241
+ readonly accentColor: number | null;
242
+ readonly profileFlags: number | null;
243
+ /** @param data - API guild member from GET /guilds/{id}/members or GET /guilds/{id}/members/{user_id} */
244
+ constructor(client: Client, data: APIGuildMember & {
245
+ guild_id?: string;
246
+ }, guild: Guild);
247
+ /** Nickname, or global name, or username. */
248
+ get displayName(): string;
333
249
  /**
334
- * Set or update a permission overwrite. PUT /channels/{id}/permissions/{overwriteId}.
335
- * @param overwriteId - Role or member ID
336
- * @param options - type (0=role, 1=member), allow, deny (permission bitfields)
250
+ * Get the guild-specific avatar URL for this member.
251
+ * Returns null if the member has no guild avatar (use displayAvatarURL for fallback).
337
252
  */
338
- editPermission(overwriteId: string, options: {
339
- type: 0 | 1;
340
- allow?: string;
341
- deny?: string;
342
- }): Promise<void>;
253
+ avatarURL(options?: {
254
+ size?: number;
255
+ extension?: string;
256
+ }): string | null;
343
257
  /**
344
- * Remove a permission overwrite. DELETE /channels/{id}/permissions/{overwriteId}.
258
+ * Get the avatar URL to display for this member.
259
+ * Uses guild-specific avatar if set, otherwise falls back to the user's avatar.
345
260
  */
346
- deletePermission(overwriteId: string): Promise<void>;
261
+ displayAvatarURL(options?: {
262
+ size?: number;
263
+ extension?: string;
264
+ }): string;
347
265
  /**
348
- * Edit this channel. PATCH /channels/{id}.
349
- * Requires Manage Channel permission.
266
+ * Get the guild-specific banner URL for this member.
267
+ * Returns null if the member has no guild banner.
350
268
  */
351
- edit(options: {
352
- name?: string | null;
353
- topic?: string | null;
354
- parent_id?: string | null;
355
- bitrate?: number | null;
356
- user_limit?: number | null;
357
- nsfw?: boolean;
358
- rate_limit_per_user?: number;
359
- rtc_region?: string | null;
360
- permission_overwrites?: Array<{
361
- id: string;
362
- type: number;
363
- allow?: string;
364
- deny?: string;
365
- }>;
366
- }): Promise<this>;
269
+ bannerURL(options?: {
270
+ size?: number;
271
+ extension?: string;
272
+ }): string | null;
367
273
  /**
368
- * Delete this channel. Requires Manage Channel permission.
369
- * @param options - silent: if true, does not send a system message (default false)
274
+ * Add a role to this member.
275
+ * Prefer member.roles.add(roleId) for Discord.js parity.
276
+ * @param roleId - The role ID to add
277
+ * Requires Manage Roles permission.
370
278
  */
371
- delete(options?: {
372
- silent?: boolean;
373
- }): Promise<void>;
374
- }
375
- declare class TextChannel extends GuildChannel {
376
- topic?: string | null;
377
- nsfw?: boolean;
378
- rateLimitPerUser?: number;
379
- lastMessageId?: string | null;
380
- constructor(client: Client, data: APIChannel);
279
+ addRole(roleId: string): Promise<void>;
381
280
  /**
382
- * Send a message to this channel.
383
- * @param options - Text content or object with content, embeds, and/or files
281
+ * Remove a role from this member.
282
+ * Prefer member.roles.remove(roleId) for Discord.js parity.
283
+ * @param roleId - The role ID to remove
284
+ * Requires Manage Roles permission.
384
285
  */
385
- send(options: MessageSendOptions): Promise<Message>;
386
- /** Message manager for this channel. Use channel.messages.fetch(messageId). */
387
- get messages(): MessageManager;
286
+ removeRole(roleId: string): Promise<void>;
388
287
  /**
389
- * Create a message collector for this channel.
390
- * Collects messages matching the filter until time expires or max is reached.
391
- * @param options - Filter, time (ms), and max count
392
- * @example
393
- * const collector = channel.createMessageCollector({ filter: m => m.author.id === userId, time: 10000 });
394
- * collector.on('collect', m => console.log(m.content));
395
- * collector.on('end', (collected, reason) => { ... });
288
+ * Edit this guild member. PATCH /guilds/{id}/members/{userId} or /members/@me for the bot.
289
+ * For @me: nick, avatar, banner, bio, pronouns, accent_color, profile_flags, mute, deaf,
290
+ * communication_disabled_until, timeout_reason, channel_id, connection_id.
291
+ * For other members: same plus roles (array of role IDs).
396
292
  */
397
- createMessageCollector(options?: MessageCollectorOptions): MessageCollector;
293
+ edit(options: {
294
+ nick?: string | null;
295
+ roles?: string[];
296
+ avatar?: string | null;
297
+ banner?: string | null;
298
+ bio?: string | null;
299
+ pronouns?: string | null;
300
+ accent_color?: number | null;
301
+ profile_flags?: number | null;
302
+ mute?: boolean;
303
+ deaf?: boolean;
304
+ communication_disabled_until?: string | null;
305
+ timeout_reason?: string | null;
306
+ channel_id?: string | null;
307
+ connection_id?: string | null;
308
+ }): Promise<this>;
398
309
  /**
399
- * Fetch pinned messages in this channel.
400
- * @returns Pinned messages
310
+ * Get the member's guild-level permissions (from roles only, no channel overwrites).
311
+ * Use this for server-wide permission checks (e.g. ban, kick, manage roles).
312
+ * @returns Object with has(permission) to check specific permissions
313
+ * @example
314
+ * const perms = member.permissions;
315
+ * if (perms.has(PermissionFlags.BanMembers)) { ... }
401
316
  */
402
- fetchPinnedMessages(): Promise<Message[]>;
317
+ get permissions(): {
318
+ has(permission: PermissionResolvable): boolean;
319
+ };
403
320
  /**
404
- * Fetch a message by ID from this channel.
405
- * @param messageId - Snowflake of the message
406
- * @returns The message, or null if not found
407
- * @deprecated Use channel.messages.fetch(messageId) instead.
321
+ * Compute the member's effective permissions in a guild channel.
322
+ * Applies role permissions and channel overwrites.
323
+ * @param channel - The guild channel to check permissions for
324
+ * @returns Object with has(permission) to check specific permissions
325
+ * @example
326
+ * const perms = member.permissionsIn(channel);
327
+ * if (perms.has(PermissionFlags.SendMessages)) { ... }
408
328
  */
409
- fetchMessage(messageId: string): Promise<Message>;
329
+ permissionsIn(channel: GuildChannel): {
330
+ has(permission: PermissionResolvable): boolean;
331
+ };
332
+ private _computeBasePermissions;
410
333
  }
411
- declare class CategoryChannel extends GuildChannel {
334
+
335
+ /**
336
+ * Manages guild members with a Collection-like API.
337
+ * Extends Collection so you can use .get(), .set(), .filter(), etc.
338
+ * Provides guild.members.me for Discord.js parity.
339
+ *
340
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberManager
341
+ */
342
+ declare class GuildMemberManager extends Collection<string, GuildMember> {
343
+ private readonly guild;
344
+ constructor(guild: Guild);
345
+ /**
346
+ * Get a guild member from cache or fetch from the API if not present.
347
+ * Convenience helper to avoid repeating `guild.members.get(userId) ?? (await guild.fetchMember(userId))`.
348
+ * @param userId - Snowflake of the user
349
+ * @returns The guild member
350
+ * @throws FluxerError with MEMBER_NOT_FOUND if user is not in the guild (404)
351
+ * @example
352
+ * const member = await guild.members.resolve(userId);
353
+ * console.log(member.displayName);
354
+ */
355
+ resolve(userId: string): Promise<GuildMember>;
356
+ /**
357
+ * The current bot user as a GuildMember in this guild.
358
+ * Returns null if the bot's member is not cached or client.user is null.
359
+ * Use fetchMe() to load the bot's member when not cached.
360
+ *
361
+ * @discordJsCompat https://discord.js.org/docs/packages/discord.js/main/GuildMemberManager
362
+ * @example
363
+ * const perms = guild.members.me?.permissions;
364
+ * if (perms?.has(PermissionFlags.BanMembers)) { ... }
365
+ */
366
+ get me(): GuildMember | null;
367
+ /**
368
+ * Fetch the current bot user as a GuildMember in this guild.
369
+ * Caches the result in guild.members.
370
+ *
371
+ * @throws Error if client.user is null (client not ready)
372
+ * @example
373
+ * const me = await guild.members.fetchMe();
374
+ * console.log(me.displayName);
375
+ */
376
+ fetchMe(): Promise<GuildMember>;
377
+ /**
378
+ * Fetch guild members with pagination. GET /guilds/{id}/members.
379
+ * @param options - limit (1-1000), after (user ID for pagination)
380
+ * @returns Array of GuildMember objects (cached in guild.members)
381
+ */
382
+ fetch(options?: {
383
+ limit?: number;
384
+ after?: string;
385
+ }): Promise<GuildMember[]>;
412
386
  }
413
- declare class VoiceChannel extends GuildChannel {
414
- bitrate?: number | null;
415
- userLimit?: number | null;
416
- rtcRegion?: string | null;
417
- constructor(client: Client, data: APIChannel);
387
+
388
+ /** File data for webhook attachment uploads. Use `data` for buffers or `url` to fetch from a URL. */
389
+ type WebhookFileData = MessageFileData;
390
+ /** Attachment metadata for webhook file uploads (id matches FormData index). */
391
+ interface WebhookAttachmentMeta {
392
+ id: number;
393
+ filename: string;
394
+ title?: string | null;
395
+ description?: string | null;
396
+ /** MessageAttachmentFlags: IS_SPOILER (8), CONTAINS_EXPLICIT_MEDIA (16), IS_ANIMATED (32) */
397
+ flags?: number;
418
398
  }
419
- declare class LinkChannel extends GuildChannel {
420
- url?: string | null;
421
- constructor(client: Client, data: APIChannel);
399
+ /** Options for sending a message via webhook. Aligns with WebhookMessageRequest in the API. */
400
+ interface WebhookSendOptions {
401
+ /** Message text content (up to 2000 characters) */
402
+ content?: string;
403
+ /** Embed objects. Use EmbedBuilder or APIEmbed; EmbedBuilder is serialized automatically. */
404
+ embeds?: (APIEmbed | EmbedBuilder)[];
405
+ /** Override the webhook's default username for this message */
406
+ username?: string;
407
+ /** Override the webhook's default avatar URL for this message */
408
+ avatar_url?: string;
409
+ /** Text-to-speech */
410
+ tts?: boolean;
411
+ /** File attachments. When present, uses multipart/form-data (same as channel.send). */
412
+ files?: WebhookFileData[];
413
+ /** Attachment metadata for files (id = index). Use when files are provided. */
414
+ attachments?: WebhookAttachmentMeta[];
422
415
  }
423
- /** DM channel (direct message between bot and a user). */
424
- declare class DMChannel extends Channel {
425
- lastMessageId?: string | null;
426
- /** Group DM creator ID. Null for 1:1 DMs. */
427
- ownerId: string | null;
428
- /** Group DM recipients as User objects. Empty for 1:1 DMs. */
429
- recipients: User[];
430
- /** Group DM member display names (userId -> nickname). */
431
- nicks: Record<string, string>;
432
- constructor(client: Client, data: APIChannelPartial & Partial<APIChannel>);
416
+ /**
417
+ * Represents a Discord/Fluxer webhook. Supports creating, fetching, sending, and deleting.
418
+ * The token is only available when the webhook was created; fetched webhooks cannot send messages.
419
+ */
420
+ declare class Webhook extends Base {
421
+ readonly client: Client;
422
+ readonly id: string;
423
+ readonly guildId: string;
424
+ channelId: string;
425
+ name: string;
426
+ avatar: string | null;
427
+ /** Present only when webhook was created via createWebhook(); not returned when fetching. */
428
+ readonly token: string | null;
429
+ /** User who created the webhook. */
430
+ readonly user: User;
431
+ /** @param data - API webhook from POST /channels/{id}/webhooks (has token) or GET /webhooks/{id} (no token) */
432
+ constructor(client: Client, data: APIWebhook & {
433
+ token?: string | null;
434
+ });
433
435
  /**
434
- * Send a message to this DM channel.
435
- * @param options - Text content or object with content, embeds, and/or files
436
+ * Get the URL for this webhook's avatar.
437
+ * Returns null if the webhook has no custom avatar.
436
438
  */
437
- send(options: MessageSendOptions): Promise<Message>;
438
- /** Message manager for this channel. Use channel.messages.fetch(messageId). */
439
- get messages(): MessageManager;
439
+ avatarURL(options?: {
440
+ size?: number;
441
+ extension?: string;
442
+ }): string | null;
443
+ /** Delete this webhook. Requires bot token with Manage Webhooks permission. */
444
+ delete(): Promise<void>;
445
+ /**
446
+ * Edit this webhook. With token: name and avatar only. Without token (bot auth): name, avatar, and channel_id.
447
+ * @param options - Fields to update (name, avatar, channel_id when using bot auth)
448
+ * @returns This webhook instance with updated fields
449
+ */
450
+ edit(options: APIWebhookUpdateRequest | APIWebhookTokenUpdateRequest): Promise<Webhook>;
451
+ /**
452
+ * Send a message via this webhook. Requires the webhook token (only present when created, not when fetched).
453
+ * @param options - Text content or object with content, embeds, username, avatar_url, tts, files, attachments
454
+ * @param wait - If true, waits for the API and returns the created Message; otherwise returns void (204)
455
+ * @throws Error if token is not available
456
+ * @example
457
+ * await webhook.send('Hello!');
458
+ * await webhook.send({ embeds: [embed] });
459
+ * await webhook.send({ content: 'File attached', files: [{ name: 'data.txt', data: buffer }] });
460
+ * const msg = await webhook.send({ content: 'Hi' }, true);
461
+ */
462
+ send(options: string | WebhookSendOptions, wait?: boolean): Promise<Message | undefined>;
463
+ /**
464
+ * Fetch a webhook by ID using bot auth.
465
+ * @param client - The client instance
466
+ * @param webhookId - The webhook ID
467
+ * @returns Webhook without token (cannot send)
468
+ */
469
+ static fetch(client: Client, webhookId: string): Promise<Webhook>;
470
+ /**
471
+ * Create a Webhook instance from an ID and token (e.g. from a stored webhook URL).
472
+ * @param client - The client instance
473
+ * @param webhookId - The webhook ID
474
+ * @param token - The webhook token (from createWebhook or stored)
475
+ * @param options - Optional channelId, guildId, name for display
476
+ */
477
+ static fromToken(client: Client, webhookId: string, token: string, options?: {
478
+ channelId?: string;
479
+ guildId?: string;
480
+ name?: string;
481
+ }): Webhook;
482
+ }
483
+
484
+ /** Represents a ban in a guild. */
485
+ declare class GuildBan extends Base {
486
+ readonly client: Client;
487
+ readonly guildId: string;
488
+ readonly user: User;
489
+ readonly reason: string | null;
490
+ /** ISO timestamp when a temporary ban expires. Null for permanent bans. */
491
+ readonly expiresAt: string | null;
492
+ /** @param data - API ban from GET /guilds/{id}/bans or gateway GUILD_BAN_ADD */
493
+ constructor(client: Client, data: APIBan & {
494
+ guild_id?: string;
495
+ }, guildId: string);
496
+ /**
497
+ * Remove this ban (unban the user).
498
+ * Requires Ban Members permission.
499
+ */
500
+ unban(): Promise<void>;
501
+ }
502
+
503
+ /** Represents a custom emoji in a guild. */
504
+ declare class GuildEmoji extends Base {
505
+ readonly client: Client;
506
+ readonly id: string;
507
+ readonly guildId: string;
508
+ name: string;
509
+ readonly animated: boolean;
510
+ /** @param data - API emoji from GET /guilds/{id}/emojis or guild emoji events */
511
+ constructor(client: Client, data: APIEmoji & {
512
+ guild_id?: string;
513
+ }, guildId: string);
514
+ /** CDN URL for this emoji image. */
515
+ get url(): string;
516
+ /** Emoji identifier for use in reactions: `name:id` */
517
+ get identifier(): string;
518
+ /** Delete this emoji. Requires Manage Emojis and Stickers permission. */
519
+ delete(): Promise<void>;
520
+ /**
521
+ * Edit this emoji's name.
522
+ * Requires Manage Emojis and Stickers permission.
523
+ */
524
+ edit(options: {
525
+ name: string;
526
+ }): Promise<GuildEmoji>;
527
+ }
528
+
529
+ /** Represents a custom sticker in a guild. */
530
+ declare class GuildSticker extends Base {
531
+ readonly client: Client;
532
+ readonly id: string;
533
+ readonly guildId: string;
534
+ name: string;
535
+ description: string;
536
+ readonly tags: string[];
537
+ readonly animated: boolean;
538
+ /** @param data - API sticker from GET /guilds/{id}/stickers or guild sticker events */
539
+ constructor(client: Client, data: APISticker & {
540
+ guild_id?: string;
541
+ }, guildId: string);
542
+ /** CDN URL for this sticker image. */
543
+ get url(): string;
544
+ /** Delete this sticker. Requires Manage Emojis and Stickers permission. */
545
+ delete(): Promise<void>;
546
+ /**
547
+ * Edit this sticker's name and/or description.
548
+ * Requires Manage Emojis and Stickers permission.
549
+ */
550
+ edit(options: {
551
+ name?: string;
552
+ description?: string;
553
+ }): Promise<GuildSticker>;
554
+ }
555
+
556
+ /** Represents a Fluxer guild (server). */
557
+ declare class Guild extends Base {
558
+ readonly client: Client;
559
+ readonly id: string;
560
+ name: string;
561
+ icon: string | null;
562
+ banner: string | null;
563
+ readonly ownerId: string;
564
+ /** Invite splash image hash. Null if none. */
565
+ splash: string | null;
566
+ /** Custom vanity URL code (e.g. fluxer.gg/code). Null if none. */
567
+ vanityURLCode: string | null;
568
+ /** Enabled guild features. */
569
+ features: GuildFeature[];
570
+ verificationLevel: GuildVerificationLevel;
571
+ defaultMessageNotifications: DefaultMessageNotifications;
572
+ explicitContentFilter: GuildExplicitContentFilter;
573
+ /** AFK voice channel ID. Null if none. */
574
+ afkChannelId: string | null;
575
+ /** AFK timeout in seconds. */
576
+ afkTimeout: number;
577
+ /** System messages channel ID. Null if none. */
578
+ systemChannelId: string | null;
579
+ /** Rules/guidelines channel ID. Null if none. */
580
+ rulesChannelId: string | null;
581
+ nsfwLevel: number;
582
+ mfaLevel: GuildMFALevel;
583
+ /** Banner image width. Optional. */
584
+ bannerWidth?: number | null;
585
+ /** Banner image height. Optional. */
586
+ bannerHeight?: number | null;
587
+ /** Splash image width. Optional. */
588
+ splashWidth?: number | null;
589
+ /** Splash image height. Optional. */
590
+ splashHeight?: number | null;
591
+ members: GuildMemberManager;
592
+ channels: Collection<string, GuildChannel>;
593
+ roles: Collection<string, Role>;
594
+ emojis: Collection<string, GuildEmoji>;
595
+ /** @param data - API guild from GET /guilds/{id} or gateway GUILD_CREATE */
596
+ constructor(client: Client, data: APIGuild & {
597
+ roles?: APIRole[];
598
+ ownerId?: string;
599
+ });
600
+ /** Get the guild icon URL, or null if no icon. */
601
+ iconURL(options?: {
602
+ size?: number;
603
+ }): string | null;
604
+ /** Get the guild banner URL, or null if no banner. */
605
+ bannerURL(options?: {
606
+ size?: number;
607
+ }): string | null;
608
+ /** Get the guild splash (invite background) URL, or null if no splash. */
609
+ splashURL(options?: {
610
+ size?: number;
611
+ }): string | null;
612
+ /**
613
+ * Add a role to a member by user ID. Does not require fetching the member first.
614
+ * @param userId - The user ID of the member
615
+ * @param roleId - The role ID to add (or use guild.resolveRoleId for mention/name resolution)
616
+ * Requires Manage Roles permission.
617
+ */
618
+ addRoleToMember(userId: string, roleId: string): Promise<void>;
619
+ /**
620
+ * Remove a role from a member by user ID. Does not require fetching the member first.
621
+ * @param userId - The user ID of the member
622
+ * @param roleId - The role ID to remove
623
+ * Requires Manage Roles permission.
624
+ */
625
+ removeRoleFromMember(userId: string, roleId: string): Promise<void>;
626
+ /**
627
+ * Create a role in this guild.
628
+ * Requires Manage Roles permission.
629
+ * @param options - Role data (permissions accepts PermissionResolvable for convenience)
630
+ * @returns The created role
631
+ * @example
632
+ * const role = await guild.createRole({ name: 'Mod', permissions: ['KickMembers', 'BanMembers'] });
633
+ */
634
+ createRole(options: RESTCreateRoleBody & {
635
+ permissions?: string | PermissionResolvable;
636
+ }): Promise<Role>;
637
+ /**
638
+ * Fetch all roles in this guild.
639
+ * @returns Array of Role objects (cached in guild.roles)
640
+ */
641
+ fetchRoles(): Promise<Role[]>;
642
+ /**
643
+ * Fetch a role by ID.
644
+ * @param roleId - The role ID to fetch
645
+ * @returns The role
646
+ * @throws FluxerError with ROLE_NOT_FOUND if role does not exist (404)
647
+ */
648
+ fetchRole(roleId: string): Promise<Role>;
649
+ /**
650
+ * Resolve a role ID from an argument (role mention, raw ID, or name).
651
+ * Fetches guild roles if name is provided.
652
+ * @param arg - Role mention (@role), role ID, or role name
653
+ * @returns The role ID, or null if not found
654
+ */
655
+ resolveRoleId(arg: string): Promise<string | null>;
656
+ /**
657
+ * Ban a user from this guild.
658
+ * @param userId - The user ID to ban
659
+ * @param options - Optional reason, delete_message_days (0–7), and ban_duration_seconds (temporary ban).
660
+ * ban_duration_seconds: 0 = permanent, or use 3600, 43200, 86400, 259200, 432000, 604800, 1209600, 2592000.
661
+ * Requires Ban Members permission.
662
+ */
663
+ ban(userId: string, options?: {
664
+ reason?: string;
665
+ delete_message_days?: number;
666
+ ban_duration_seconds?: number;
667
+ }): Promise<void>;
668
+ /**
669
+ * Fetch guild bans. Requires Ban Members permission.
670
+ * @returns List of GuildBan objects
671
+ */
672
+ fetchBans(): Promise<GuildBan[]>;
673
+ /**
674
+ * Remove a ban (unban a user).
675
+ * @param userId - The user ID to unban
676
+ * Requires Ban Members permission.
677
+ */
678
+ unban(userId: string): Promise<void>;
679
+ /**
680
+ * Kick a member from this guild.
681
+ * @param userId - The user ID to kick
682
+ * Requires Kick Members permission.
683
+ */
684
+ kick(userId: string): Promise<void>;
685
+ /**
686
+ * Fetch a guild member by user ID.
687
+ * @param userId - The user ID of the member to fetch
688
+ * @returns The guild member
689
+ * @throws FluxerError with MEMBER_NOT_FOUND if user is not in the guild (404)
690
+ * @throws FluxerError with cause for permission denied (403) or other REST errors
691
+ */
692
+ fetchMember(userId: string): Promise<GuildMember>;
693
+ /**
694
+ * Fetch guild audit logs. Requires View Audit Log permission.
695
+ * @param options - Optional limit, before, after, user_id, action_type for filtering
696
+ */
697
+ fetchAuditLogs(options?: {
698
+ limit?: number;
699
+ before?: string;
700
+ after?: string;
701
+ userId?: string;
702
+ actionType?: number;
703
+ }): Promise<APIGuildAuditLog>;
704
+ /** Fetch all webhooks in this guild. Returned webhooks do not include the token (cannot send). */
705
+ fetchWebhooks(): Promise<Webhook[]>;
706
+ /**
707
+ * Create a channel in this guild.
708
+ * @param data - Channel data: type (0=text, 2=voice, 4=category, 5=link), name, and optional parent_id, topic, bitrate, user_limit, nsfw, permission_overwrites
709
+ * Requires Manage Channels permission.
710
+ */
711
+ createChannel(data: {
712
+ type: 0 | 2 | 4 | 5;
713
+ name: string;
714
+ parent_id?: string | null;
715
+ topic?: string | null;
716
+ bitrate?: number | null;
717
+ user_limit?: number | null;
718
+ nsfw?: boolean;
719
+ permission_overwrites?: Array<{
720
+ id: string;
721
+ type: number;
722
+ allow: string;
723
+ deny: string;
724
+ }>;
725
+ }): Promise<GuildChannel>;
726
+ /**
727
+ * Fetch all channels in this guild.
728
+ * @returns Array of GuildChannel objects (cached in guild.channels and client.channels)
729
+ */
730
+ fetchChannels(): Promise<GuildChannel[]>;
731
+ /**
732
+ * Edit this guild. PATCH /guilds/{id}.
733
+ * Requires guild owner or Administrator.
734
+ */
735
+ edit(options: {
736
+ name?: string;
737
+ icon?: string | null;
738
+ system_channel_id?: string | null;
739
+ system_channel_flags?: number;
740
+ afk_channel_id?: string | null;
741
+ afk_timeout?: number;
742
+ default_message_notifications?: DefaultMessageNotifications;
743
+ verification_level?: GuildVerificationLevel;
744
+ mfa_level?: GuildMFALevel;
745
+ explicit_content_filter?: GuildExplicitContentFilter;
746
+ banner?: string | null;
747
+ splash?: string | null;
748
+ embed_splash?: string | null;
749
+ splash_card_alignment?: string;
750
+ features?: GuildFeature[];
751
+ }): Promise<this>;
752
+ /**
753
+ * Delete this guild. POST /guilds/{id}/delete.
754
+ * Must be the guild owner.
755
+ */
756
+ delete(): Promise<void>;
757
+ /**
758
+ * Fetch vanity URL for this guild. GET /guilds/{id}/vanity-url.
759
+ * Requires Manage Guild permission.
760
+ */
761
+ fetchVanityURL(): Promise<APIVanityURL>;
762
+ /**
763
+ * Transfer guild ownership to another user. POST /guilds/{id}/transfer-ownership.
764
+ * Must be the guild owner.
765
+ */
766
+ transferOwnership(newOwnerId: string, password?: string): Promise<void>;
767
+ /**
768
+ * Set text channel flexible names feature. PATCH /guilds/{id}/text-channel-flexible-names.
769
+ */
770
+ setTextChannelFlexibleNames(enabled: boolean): Promise<this>;
771
+ /**
772
+ * Set detached banner feature. PATCH /guilds/{id}/detached-banner.
773
+ */
774
+ setDetachedBanner(enabled: boolean): Promise<this>;
775
+ /**
776
+ * Set disallow unclaimed accounts. PATCH /guilds/{id}/disallow-unclaimed-accounts.
777
+ */
778
+ setDisallowUnclaimedAccounts(enabled: boolean): Promise<this>;
779
+ /**
780
+ * Update role positions. PATCH /guilds/{id}/roles.
781
+ * @param updates - Array of { id, position? }
782
+ */
783
+ setRolePositions(updates: Array<{
784
+ id: string;
785
+ position?: number;
786
+ }>): Promise<APIRole[]>;
787
+ /**
788
+ * Update role hoist positions. PATCH /guilds/{id}/roles/hoist-positions.
789
+ */
790
+ setRoleHoistPositions(updates: Array<{
791
+ id: string;
792
+ hoist_position?: number;
793
+ }>): Promise<APIRole[]>;
794
+ /**
795
+ * Reset role hoist positions. DELETE /guilds/{id}/roles/hoist-positions.
796
+ */
797
+ resetRoleHoistPositions(): Promise<APIRole[]>;
440
798
  /**
441
- * Create a message collector for this DM channel.
442
- * @param options - Filter, time (ms), and max count
799
+ * Update channel positions.
800
+ * @param updates - Array of { id, position?, parent_id?, lock_permissions? }
801
+ * Requires Manage Channels permission.
443
802
  */
444
- createMessageCollector(options?: MessageCollectorOptions): MessageCollector;
803
+ setChannelPositions(updates: Array<{
804
+ id: string;
805
+ position?: number;
806
+ parent_id?: string | null;
807
+ lock_permissions?: boolean;
808
+ }>): Promise<void>;
445
809
  /**
446
- * Fetch pinned messages in this DM channel.
447
- * @returns Pinned messages
810
+ * Fetch all emojis in this guild.
811
+ * @returns Array of GuildEmoji objects (cached in guild.emojis)
448
812
  */
449
- fetchPinnedMessages(): Promise<Message[]>;
813
+ fetchEmojis(): Promise<GuildEmoji[]>;
450
814
  /**
451
- * Fetch a message by ID from this DM channel.
452
- * @param messageId - Snowflake of the message
453
- * @returns The message, or null if not found
454
- * @deprecated Use channel.messages.fetch(messageId) instead.
815
+ * Fetch a single emoji by ID.
816
+ * @param emojiId - The emoji ID to fetch
817
+ * @returns The guild emoji
818
+ * @throws FluxerError if emoji not found (404)
455
819
  */
456
- fetchMessage(messageId: string): Promise<Message>;
820
+ fetchEmoji(emojiId: string): Promise<GuildEmoji>;
457
821
  /**
458
- * Add a recipient to this Group DM. Requires Group DM (type GroupDM).
459
- * PUT /channels/{id}/recipients/{userId}.
822
+ * Bulk create emojis. POST /guilds/{id}/emojis/bulk.
823
+ * @param emojis - Array of { name, image } (base64), 1-50 emojis
824
+ * @returns Array of created GuildEmoji objects
460
825
  */
461
- addRecipient(userId: string): Promise<void>;
826
+ createEmojisBulk(emojis: Array<{
827
+ name: string;
828
+ image: string;
829
+ }>): Promise<GuildEmoji[]>;
462
830
  /**
463
- * Remove a recipient from this Group DM. Requires Group DM (type GroupDM).
464
- * DELETE /channels/{id}/recipients/{userId}.
465
- * @param options - silent: if true, does not send a system message (default false)
831
+ * Bulk create stickers. POST /guilds/{id}/stickers/bulk.
832
+ * @param stickers - Array of { name, image, description?, tags? }, 1-50 stickers
833
+ * @returns Array of created GuildSticker objects
466
834
  */
467
- removeRecipient(userId: string, options?: {
468
- silent?: boolean;
469
- }): Promise<void>;
835
+ createStickersBulk(stickers: Array<{
836
+ name: string;
837
+ image: string;
838
+ description?: string;
839
+ tags?: string[];
840
+ }>): Promise<GuildSticker[]>;
470
841
  }
471
842
 
472
843
  /** Represents a reaction added to or removed from a message. */
@@ -576,736 +947,442 @@ declare class Message extends Base {
576
947
  /**
577
948
  * Resolve the channel (from cache or API). Use when you need the channel and it may not be cached.
578
949
  * @returns The channel
579
- * @throws FluxerError with CHANNEL_NOT_FOUND if the channel does not exist
580
- */
581
- resolveChannel(): Promise<Channel>;
582
- /**
583
- * Resolve the guild (from cache or API). Returns null for DMs.
584
- * @returns The guild, or null if this is a DM or guild not found
585
- */
586
- resolveGuild(): Promise<Guild | null>;
587
- /** @param data - API message from POST/PATCH /channels/{id}/messages or gateway MESSAGE_CREATE */
588
- constructor(client: Client, data: APIMessage);
589
- /**
590
- * Send a message to this channel without replying. Use when you want a standalone message.
591
- * @param options - Text content or object with content, embeds, and/or files
592
- * @example
593
- * await message.send('Pong!');
594
- * await message.send({ embeds: [embed] }); // EmbedBuilder auto-converted
595
- * await message.send({ content: 'File', files: [{ name: 'data.txt', data }] });
596
- */
597
- send(options: MessageSendOptions): Promise<Message>;
598
- /**
599
- * Send a message to a specific channel. Use for logging, forwarding, or sending to another channel in the guild.
600
- * @param channelId - Snowflake of the target channel (e.g. log channel ID)
601
- * @param options - Text content or object with content and/or embeds
602
- * @example
603
- * await message.sendTo(logChannelId, 'User ' + message.author.username + ' said: ' + message.content);
604
- * await message.sendTo(announceChannelId, { embeds: [embed] });
605
- */
606
- sendTo(channelId: string, options: MessageSendOptions): Promise<Message>;
607
- /**
608
- * Reply to this message (shows as a reply in the client).
609
- * @param options - Text content or object with content, embeds, and/or files
610
- * @example
611
- * await message.reply('Pong!');
612
- * await message.reply({ embeds: [embed] });
613
- */
614
- reply(options: MessageSendOptions): Promise<Message>;
615
- /**
616
- * Edit this message. Only the author (or admins) can edit.
617
- * @param options - New content and/or embeds
618
- */
619
- edit(options: MessageEditOptions): Promise<Message>;
620
- /**
621
- * Create a reaction collector for this message.
622
- * Collects reactions matching the filter until time expires or max is reached.
623
- * @param options - Filter, time (ms), and max count
624
- * @example
625
- * const collector = message.createReactionCollector({ filter: (r, u) => u.id === userId, time: 10000 });
626
- * collector.on('collect', (reaction, user) => console.log(user.username, 'reacted with', reaction.emoji.name));
627
- * collector.on('end', (collected, reason) => { ... });
628
- */
629
- createReactionCollector(options?: ReactionCollectorOptions): ReactionCollector;
630
- /**
631
- * Re-fetch this message from the API to get the latest content, embeds, reactions, etc.
632
- * Use when you have a stale Message (e.g. from an old event or cache) and need fresh data.
633
- * @returns The updated message
634
- * @throws FluxerError with MESSAGE_NOT_FOUND if the message was deleted or does not exist
635
- * @example
636
- * const updated = await message.fetch();
637
- * console.log('Latest content:', updated.content);
638
- */
639
- fetch(): Promise<Message>;
640
- /** Delete this message. */
641
- delete(): Promise<void>;
642
- /**
643
- * Delete a specific attachment from this message.
644
- * DELETE /channels/{id}/messages/{id}/attachments/{attachmentId}.
645
- */
646
- deleteAttachment(attachmentId: string): Promise<void>;
647
- /** Pin this message to the channel. Requires Manage Messages permission. */
648
- pin(): Promise<void>;
649
- /** Unpin this message from the channel. Requires Manage Messages permission. */
650
- unpin(): Promise<void>;
651
- /**
652
- * Format emoji for reaction API: unicode string or "name:id" for custom.
653
- * For string resolution (e.g. :name:), use client.resolveEmoji; Message methods resolve automatically when guildId is available.
654
- */
655
- private static formatEmoji;
656
- private resolveEmojiForReaction;
657
- /**
658
- * Add a reaction to this message (as the bot).
659
- * @param emoji - Unicode emoji, custom `{ name, id }`, `:name:`, `name:id`, or `<:name:id>`
660
- */
661
- react(emoji: string | {
662
- name: string;
663
- id?: string;
664
- animated?: boolean;
665
- }): Promise<void>;
666
- /**
667
- * Remove the bot's reaction, or a specific user's reaction if userId is provided.
668
- * @param emoji - Unicode emoji, custom `{ name, id }`, `:name:`, `name:id`, or `<:name:id>`
669
- * @param userId - If provided, removes that user's reaction (requires moderator permissions)
670
- */
671
- removeReaction(emoji: string | {
672
- name: string;
673
- id?: string;
674
- animated?: boolean;
675
- }, userId?: string): Promise<void>;
676
- /**
677
- * Remove all reactions from this message.
678
- * Requires moderator permissions.
679
- */
680
- removeAllReactions(): Promise<void>;
681
- /**
682
- * Remove all reactions of a specific emoji from this message.
683
- * @param emoji - Unicode emoji, custom `{ name, id }`, `:name:`, `name:id`, or `<:name:id>`. Requires moderator permissions.
684
- */
685
- removeReactionEmoji(emoji: string | {
686
- name: string;
687
- id?: string;
688
- animated?: boolean;
689
- }): Promise<void>;
690
- /**
691
- * Fetch users who reacted with the given emoji.
692
- * @param emoji - Unicode emoji or custom `{ name, id }`
693
- * @param options - limit (1–100), after (user ID for pagination)
694
- * @returns Array of User objects
695
- */
696
- fetchReactionUsers(emoji: string | {
697
- name: string;
698
- id?: string;
699
- animated?: boolean;
700
- }, options?: {
701
- limit?: number;
702
- after?: string;
703
- }): Promise<User[]>;
704
- }
705
-
706
- /** Represents a user (or bot) on Fluxer. */
707
- declare class User extends Base {
708
- readonly client: Client;
709
- readonly id: string;
710
- username: string;
711
- discriminator: string;
712
- globalName: string | null;
713
- avatar: string | null;
714
- readonly bot: boolean;
715
- /** RGB avatar color (e.g. 7577782). Null if not set. */
716
- avatarColor: number | null;
717
- /** Public flags bitfield. Null if not set. */
718
- flags: number | null;
719
- /** Whether this is an official system user. */
720
- readonly system: boolean;
721
- /** Banner hash (from profile, member, or invite context). Null when not available. */
722
- banner: string | null;
723
- /** @param data - API user from message author, GET /users/{id}, or GET /users/@me */
724
- constructor(client: Client, data: APIUserPartial);
725
- /** Update mutable fields from fresh API data. Used by getOrCreateUser cache. */
726
- _patch(data: APIUserPartial): void;
727
- /**
728
- * Get the URL for this user's avatar.
729
- * Auto-detects animated avatars (hash starting with `a_`) and uses gif extension.
730
- * @param options - Optional `size` and `extension` (default: png, or gif for animated)
731
- */
732
- avatarURL(options?: {
733
- size?: number;
734
- extension?: string;
735
- }): string | null;
736
- /** Get the avatar URL, or the default avatar if none set (Fluxer: fluxerstatic.com). */
737
- displayAvatarURL(options?: {
738
- size?: number;
739
- extension?: string;
740
- }): string;
741
- /**
742
- * Get the URL for this user's banner.
743
- * Returns null if the user has no banner (only available when fetched from profile/member context).
744
- */
745
- bannerURL(options?: {
746
- size?: number;
747
- extension?: string;
748
- }): string | null;
749
- /** Returns a mention string (e.g. `<@123456>`). */
750
- toString(): string;
751
- /**
752
- * Create or get a DM channel with this user.
753
- * Returns the DM channel; use {@link DMChannel.send} to send messages.
754
- */
755
- createDM(): Promise<DMChannel>;
756
- /**
757
- * Send a DM to this user.
758
- * Convenience method that creates the DM channel and sends the message.
759
- */
760
- send(options: MessageSendOptions): Promise<Message>;
761
- }
762
-
763
- /** Represents a member of a guild. */
764
- declare class GuildMember extends Base {
765
- readonly client: Client;
766
- readonly id: string;
767
- readonly user: User;
768
- readonly guild: Guild;
769
- nick: string | null;
770
- readonly roles: string[];
771
- readonly joinedAt: Date;
772
- communicationDisabledUntil: Date | null;
773
- readonly mute: boolean;
774
- readonly deaf: boolean;
775
- readonly avatar: string | null;
776
- readonly banner: string | null;
777
- readonly accentColor: number | null;
778
- readonly profileFlags: number | null;
779
- /** @param data - API guild member from GET /guilds/{id}/members or GET /guilds/{id}/members/{user_id} */
780
- constructor(client: Client, data: APIGuildMember & {
781
- guild_id?: string;
782
- }, guild: Guild);
783
- /** Nickname, or global name, or username. */
784
- get displayName(): string;
785
- /**
786
- * Get the guild-specific avatar URL for this member.
787
- * Returns null if the member has no guild avatar (use displayAvatarURL for fallback).
950
+ * @throws FluxerError with CHANNEL_NOT_FOUND if the channel does not exist
788
951
  */
789
- avatarURL(options?: {
790
- size?: number;
791
- extension?: string;
792
- }): string | null;
952
+ resolveChannel(): Promise<Channel>;
793
953
  /**
794
- * Get the avatar URL to display for this member.
795
- * Uses guild-specific avatar if set, otherwise falls back to the user's avatar.
954
+ * Resolve the guild (from cache or API). Returns null for DMs.
955
+ * @returns The guild, or null if this is a DM or guild not found
796
956
  */
797
- displayAvatarURL(options?: {
798
- size?: number;
799
- extension?: string;
800
- }): string;
957
+ resolveGuild(): Promise<Guild | null>;
958
+ /** @param data - API message from POST/PATCH /channels/{id}/messages or gateway MESSAGE_CREATE */
959
+ constructor(client: Client, data: APIMessage);
801
960
  /**
802
- * Get the guild-specific banner URL for this member.
803
- * Returns null if the member has no guild banner.
961
+ * Send a message to this channel without replying. Use when you want a standalone message.
962
+ * @param options - Text content or object with content, embeds, and/or files
963
+ * @example
964
+ * await message.send('Pong!');
965
+ * await message.send({ embeds: [embed] }); // EmbedBuilder auto-converted
966
+ * await message.send({ content: 'File', files: [{ name: 'data.txt', data }] });
804
967
  */
805
- bannerURL(options?: {
806
- size?: number;
807
- extension?: string;
808
- }): string | null;
968
+ send(options: MessageSendOptions): Promise<Message>;
809
969
  /**
810
- * Add a role to this member.
811
- * @param roleId - The role ID to add
812
- * Requires Manage Roles permission.
970
+ * Send a message to a specific channel. Use for logging, forwarding, or sending to another channel in the guild.
971
+ * @param channelId - Snowflake of the target channel (e.g. log channel ID)
972
+ * @param options - Text content or object with content and/or embeds
973
+ * @example
974
+ * await message.sendTo(logChannelId, 'User ' + message.author.username + ' said: ' + message.content);
975
+ * await message.sendTo(announceChannelId, { embeds: [embed] });
813
976
  */
814
- addRole(roleId: string): Promise<void>;
977
+ sendTo(channelId: string, options: MessageSendOptions): Promise<Message>;
815
978
  /**
816
- * Remove a role from this member.
817
- * @param roleId - The role ID to remove
818
- * Requires Manage Roles permission.
979
+ * Reply to this message (shows as a reply in the client).
980
+ * @param options - Text content or object with content, embeds, and/or files
981
+ * @example
982
+ * await message.reply('Pong!');
983
+ * await message.reply({ embeds: [embed] });
819
984
  */
820
- removeRole(roleId: string): Promise<void>;
985
+ reply(options: MessageSendOptions): Promise<Message>;
821
986
  /**
822
- * Edit this guild member. PATCH /guilds/{id}/members/{userId} or /members/@me for the bot.
823
- * For @me: nick, avatar, banner, bio, pronouns, accent_color, profile_flags, mute, deaf,
824
- * communication_disabled_until, timeout_reason, channel_id, connection_id.
825
- * For other members: same plus roles (array of role IDs).
987
+ * Edit this message. Only the author (or admins) can edit.
988
+ * @param options - New content and/or embeds
826
989
  */
827
- edit(options: {
828
- nick?: string | null;
829
- roles?: string[];
830
- avatar?: string | null;
831
- banner?: string | null;
832
- bio?: string | null;
833
- pronouns?: string | null;
834
- accent_color?: number | null;
835
- profile_flags?: number | null;
836
- mute?: boolean;
837
- deaf?: boolean;
838
- communication_disabled_until?: string | null;
839
- timeout_reason?: string | null;
840
- channel_id?: string | null;
841
- connection_id?: string | null;
842
- }): Promise<this>;
990
+ edit(options: MessageEditOptions): Promise<Message>;
843
991
  /**
844
- * Get the member's guild-level permissions (from roles only, no channel overwrites).
845
- * Use this for server-wide permission checks (e.g. ban, kick, manage roles).
846
- * @returns Object with has(permission) to check specific permissions
992
+ * Create a reaction collector for this message.
993
+ * Collects reactions matching the filter until time expires or max is reached.
994
+ * @param options - Filter, time (ms), and max count
847
995
  * @example
848
- * const perms = member.permissions;
849
- * if (perms.has(PermissionFlags.BanMembers)) { ... }
996
+ * const collector = message.createReactionCollector({ filter: (r, u) => u.id === userId, time: 10000 });
997
+ * collector.on('collect', (reaction, user) => console.log(user.username, 'reacted with', reaction.emoji.name));
998
+ * collector.on('end', (collected, reason) => { ... });
850
999
  */
851
- get permissions(): {
852
- has(permission: PermissionResolvable): boolean;
853
- };
1000
+ createReactionCollector(options?: ReactionCollectorOptions): ReactionCollector;
854
1001
  /**
855
- * Compute the member's effective permissions in a guild channel.
856
- * Applies role permissions and channel overwrites.
857
- * @param channel - The guild channel to check permissions for
858
- * @returns Object with has(permission) to check specific permissions
1002
+ * Re-fetch this message from the API to get the latest content, embeds, reactions, etc.
1003
+ * Use when you have a stale Message (e.g. from an old event or cache) and need fresh data.
1004
+ * @returns The updated message
1005
+ * @throws FluxerError with MESSAGE_NOT_FOUND if the message was deleted or does not exist
859
1006
  * @example
860
- * const perms = member.permissionsIn(channel);
861
- * if (perms.has(PermissionFlags.SendMessages)) { ... }
1007
+ * const updated = await message.fetch();
1008
+ * console.log('Latest content:', updated.content);
862
1009
  */
863
- permissionsIn(channel: GuildChannel): {
864
- has(permission: PermissionResolvable): boolean;
865
- };
866
- private _computeBasePermissions;
867
- }
868
-
869
- /**
870
- * Manages guild members with a Collection-like API.
871
- * Extends Collection so you can use .get(), .set(), .filter(), etc.
872
- * Provides guild.members.me for Discord.js parity.
873
- */
874
- declare class GuildMemberManager extends Collection<string, GuildMember> {
875
- private readonly guild;
876
- constructor(guild: Guild);
1010
+ fetch(): Promise<Message>;
1011
+ /** Delete this message. */
1012
+ delete(): Promise<void>;
877
1013
  /**
878
- * Get a guild member from cache or fetch from the API if not present.
879
- * Convenience helper to avoid repeating `guild.members.get(userId) ?? (await guild.fetchMember(userId))`.
880
- * @param userId - Snowflake of the user
881
- * @returns The guild member
882
- * @throws FluxerError with MEMBER_NOT_FOUND if user is not in the guild (404)
883
- * @example
884
- * const member = await guild.members.resolve(userId);
885
- * console.log(member.displayName);
1014
+ * Delete a specific attachment from this message.
1015
+ * DELETE /channels/{id}/messages/{id}/attachments/{attachmentId}.
886
1016
  */
887
- resolve(userId: string): Promise<GuildMember>;
1017
+ deleteAttachment(attachmentId: string): Promise<void>;
1018
+ /** Pin this message to the channel. Requires Manage Messages permission. */
1019
+ pin(): Promise<void>;
1020
+ /** Unpin this message from the channel. Requires Manage Messages permission. */
1021
+ unpin(): Promise<void>;
888
1022
  /**
889
- * The current bot user as a GuildMember in this guild.
890
- * Returns null if the bot's member is not cached or client.user is null.
891
- * Use fetchMe() to load the bot's member when not cached.
892
- *
893
- * @example
894
- * const perms = guild.members.me?.permissions;
895
- * if (perms?.has(PermissionFlags.BanMembers)) { ... }
1023
+ * Format emoji for reaction API: unicode string or "name:id" for custom.
1024
+ * For string resolution (e.g. :name:), use client.resolveEmoji; Message methods resolve automatically when guildId is available.
896
1025
  */
897
- get me(): GuildMember | null;
1026
+ private static formatEmoji;
1027
+ private resolveEmojiForReaction;
898
1028
  /**
899
- * Fetch the current bot user as a GuildMember in this guild.
900
- * Caches the result in guild.members.
901
- *
902
- * @throws Error if client.user is null (client not ready)
903
- * @example
904
- * const me = await guild.members.fetchMe();
905
- * console.log(me.displayName);
1029
+ * Add a reaction to this message (as the bot).
1030
+ * @param emoji - Unicode emoji, custom `{ name, id }`, `:name:`, `name:id`, or `<:name:id>`
906
1031
  */
907
- fetchMe(): Promise<GuildMember>;
1032
+ react(emoji: string | {
1033
+ name: string;
1034
+ id?: string;
1035
+ animated?: boolean;
1036
+ }): Promise<void>;
908
1037
  /**
909
- * Fetch guild members with pagination. GET /guilds/{id}/members.
910
- * @param options - limit (1-1000), after (user ID for pagination)
911
- * @returns Array of GuildMember objects (cached in guild.members)
1038
+ * Remove the bot's reaction, or a specific user's reaction if userId is provided.
1039
+ * @param emoji - Unicode emoji, custom `{ name, id }`, `:name:`, `name:id`, or `<:name:id>`
1040
+ * @param userId - If provided, removes that user's reaction (requires moderator permissions)
912
1041
  */
913
- fetch(options?: {
914
- limit?: number;
915
- after?: string;
916
- }): Promise<GuildMember[]>;
917
- }
918
-
919
- /** Represents a role in a guild. */
920
- declare class Role extends Base {
921
- readonly client: Client;
922
- readonly id: string;
923
- readonly guildId: string;
924
- name: string;
925
- color: number;
926
- position: number;
927
- permissions: string;
928
- hoist: boolean;
929
- mentionable: boolean;
930
- unicodeEmoji: string | null;
931
- /** Separately sorted position for hoisted roles. Null if not set. */
932
- hoistPosition: number | null;
933
- /** @param client - The client instance */
934
- /** @param data - API role from GET /guilds/{id}/roles or gateway role events */
935
- /** @param guildId - The guild this role belongs to */
936
- constructor(client: Client, data: APIRole, guildId: string);
937
- /** Update mutable fields from fresh API data. Used by edit and gateway events. */
938
- _patch(data: Partial<APIRole>): void;
939
- /** Returns a mention string (e.g. `<@&123456>`). */
940
- toString(): string;
1042
+ removeReaction(emoji: string | {
1043
+ name: string;
1044
+ id?: string;
1045
+ animated?: boolean;
1046
+ }, userId?: string): Promise<void>;
941
1047
  /**
942
- * Check if this role has a permission. Administrator grants all permissions.
943
- * @param permission - Permission flag, name, or resolvable
944
- * @returns true if the role has the permission
945
- * @example
946
- * if (role.has(PermissionFlags.BanMembers)) { ... }
947
- * if (role.has('ManageChannels')) { ... }
1048
+ * Remove all reactions from this message.
1049
+ * Requires moderator permissions.
948
1050
  */
949
- has(permission: PermissionResolvable): boolean;
1051
+ removeAllReactions(): Promise<void>;
950
1052
  /**
951
- * Edit this role.
952
- * Requires Manage Roles permission.
953
- * @param options - Role updates (permissions accepts PermissionResolvable for convenience)
954
- * @returns This role (updated in place)
955
- * @example
956
- * await role.edit({ name: 'Moderator', permissions: ['BanMembers', 'KickMembers'] });
1053
+ * Remove all reactions of a specific emoji from this message.
1054
+ * @param emoji - Unicode emoji, custom `{ name, id }`, `:name:`, `name:id`, or `<:name:id>`. Requires moderator permissions.
957
1055
  */
958
- edit(options: RESTUpdateRoleBody & {
959
- permissions?: string | PermissionResolvable;
960
- }): Promise<Role>;
1056
+ removeReactionEmoji(emoji: string | {
1057
+ name: string;
1058
+ id?: string;
1059
+ animated?: boolean;
1060
+ }): Promise<void>;
961
1061
  /**
962
- * Delete this role.
963
- * Requires Manage Roles permission.
1062
+ * Fetch users who reacted with the given emoji.
1063
+ * @param emoji - Unicode emoji or custom `{ name, id }`
1064
+ * @param options - limit (1–100), after (user ID for pagination)
1065
+ * @returns Array of User objects
1066
+ */
1067
+ fetchReactionUsers(emoji: string | {
1068
+ name: string;
1069
+ id?: string;
1070
+ animated?: boolean;
1071
+ }, options?: {
1072
+ limit?: number;
1073
+ after?: string;
1074
+ }): Promise<User[]>;
1075
+ }
1076
+
1077
+ /**
1078
+ * Manages messages for a channel. Access via channel.messages.
1079
+ * @example
1080
+ * const message = await channel.messages.fetch(messageId);
1081
+ * if (message) await message.edit({ content: 'Updated!' });
1082
+ */
1083
+ declare class MessageManager {
1084
+ private readonly client;
1085
+ private readonly channelId;
1086
+ constructor(client: Client, channelId: string);
1087
+ /**
1088
+ * Fetch a message by ID from this channel.
1089
+ * @param messageId - Snowflake of the message
1090
+ * @returns The message
1091
+ * @throws FluxerError with MESSAGE_NOT_FOUND if the message does not exist
964
1092
  */
965
- delete(): Promise<void>;
1093
+ fetch(messageId: string): Promise<Message>;
966
1094
  }
967
1095
 
968
- /** Represents a ban in a guild. */
969
- declare class GuildBan extends Base {
1096
+ interface MessageCollectorOptions {
1097
+ /** Filter function. Return true to collect the message. */
1098
+ filter?: (message: Message) => boolean;
1099
+ /** Max duration in ms. Collector stops when time expires. */
1100
+ time?: number;
1101
+ /** Max messages to collect. Collector stops when limit reached. */
1102
+ max?: number;
1103
+ }
1104
+ type MessageCollectorEndReason = 'time' | 'limit' | 'user';
1105
+ interface MessageCollectorEvents {
1106
+ collect: [message: Message];
1107
+ end: [collected: Collection<string, Message>, reason: MessageCollectorEndReason];
1108
+ }
1109
+ /**
1110
+ * Collects messages in a channel. Use channel.createMessageCollector().
1111
+ * @example
1112
+ * const collector = channel.createMessageCollector({ filter: m => m.author.id === userId, time: 10000 });
1113
+ * collector.on('collect', m => console.log(m.content));
1114
+ * collector.on('end', (collected, reason) => console.log(`Stopped: ${reason}`));
1115
+ */
1116
+ declare class MessageCollector extends EventEmitter {
970
1117
  readonly client: Client;
971
- readonly guildId: string;
972
- readonly user: User;
973
- readonly reason: string | null;
974
- /** ISO timestamp when a temporary ban expires. Null for permanent bans. */
1118
+ readonly channelId: string;
1119
+ readonly options: Required<MessageCollectorOptions>;
1120
+ readonly collected: Collection<string, Message>;
1121
+ private _timeout;
1122
+ private _ended;
1123
+ private _listener;
1124
+ constructor(client: Client, channelId: string, options?: MessageCollectorOptions);
1125
+ stop(reason?: MessageCollectorEndReason): void;
1126
+ on<K extends keyof MessageCollectorEvents>(event: K, listener: (...args: MessageCollectorEvents[K]) => void): this;
1127
+ emit<K extends keyof MessageCollectorEvents>(event: K, ...args: MessageCollectorEvents[K]): boolean;
1128
+ }
1129
+
1130
+ /** Represents an invite to a guild or channel. */
1131
+ declare class Invite extends Base {
1132
+ readonly client: Client;
1133
+ readonly code: string;
1134
+ readonly type: number;
1135
+ readonly guild: APIGuildPartial;
1136
+ readonly channel: APIChannelPartial;
1137
+ readonly inviter: User | null;
1138
+ readonly memberCount: number | null;
1139
+ readonly presenceCount: number | null;
975
1140
  readonly expiresAt: string | null;
976
- /** @param data - API ban from GET /guilds/{id}/bans or gateway GUILD_BAN_ADD */
977
- constructor(client: Client, data: APIBan & {
978
- guild_id?: string;
979
- }, guildId: string);
1141
+ readonly temporary: boolean | null;
1142
+ readonly createdAt: string | null;
1143
+ readonly uses: number | null;
1144
+ readonly maxUses: number | null;
1145
+ readonly maxAge: number | null;
1146
+ /** @param data - API invite from GET /invites/{code}, channel/guild invite list, or gateway INVITE_CREATE */
1147
+ constructor(client: Client, data: APIInvite);
1148
+ /** Full invite URL (https://fluxer.gg/{code} or instance-specific). */
1149
+ get url(): string;
980
1150
  /**
981
- * Remove this ban (unban the user).
982
- * Requires Ban Members permission.
1151
+ * Resolve the guild from cache if available.
1152
+ * @returns The guild, or null if not cached
983
1153
  */
984
- unban(): Promise<void>;
1154
+ getGuild(): Guild | null;
1155
+ /**
1156
+ * Delete this invite.
1157
+ * Requires Manage Guild or Create Instant Invite permission.
1158
+ */
1159
+ delete(): Promise<void>;
985
1160
  }
986
1161
 
987
- /** Represents a Fluxer guild (server). */
988
- declare class Guild extends Base {
1162
+ /** Base class for all channel types. */
1163
+ declare abstract class Channel extends Base {
1164
+ /** Whether this channel has a send method (TextChannel, DMChannel). */
1165
+ isSendable(): this is TextChannel | DMChannel;
1166
+ /** Whether this channel is a DM or Group DM. */
1167
+ isDM(): boolean;
1168
+ /** Whether this channel is voice-based (VoiceChannel). */
1169
+ isVoice(): boolean;
1170
+ /** Create a DM channel from API data (type DM or GroupDM). */
1171
+ static createDM(client: Client, data: APIChannelPartial): DMChannel;
989
1172
  readonly client: Client;
990
1173
  readonly id: string;
991
- name: string;
1174
+ type: ChannelType;
1175
+ /** Channel name. Guild channels and Group DMs have names; 1:1 DMs are typically null. */
1176
+ name: string | null;
1177
+ /** Channel icon hash (Group DMs). Null if none. */
992
1178
  icon: string | null;
993
- banner: string | null;
994
- readonly ownerId: string;
995
- /** Invite splash image hash. Null if none. */
996
- splash: string | null;
997
- /** Custom vanity URL code (e.g. fluxer.gg/code). Null if none. */
998
- vanityURLCode: string | null;
999
- /** Enabled guild features. */
1000
- features: GuildFeature[];
1001
- verificationLevel: GuildVerificationLevel;
1002
- defaultMessageNotifications: DefaultMessageNotifications;
1003
- explicitContentFilter: GuildExplicitContentFilter;
1004
- /** AFK voice channel ID. Null if none. */
1005
- afkChannelId: string | null;
1006
- /** AFK timeout in seconds. */
1007
- afkTimeout: number;
1008
- /** System messages channel ID. Null if none. */
1009
- systemChannelId: string | null;
1010
- /** Rules/guidelines channel ID. Null if none. */
1011
- rulesChannelId: string | null;
1012
- nsfwLevel: number;
1013
- mfaLevel: GuildMFALevel;
1014
- /** Banner image width. Optional. */
1015
- bannerWidth?: number | null;
1016
- /** Banner image height. Optional. */
1017
- bannerHeight?: number | null;
1018
- /** Splash image width. Optional. */
1019
- splashWidth?: number | null;
1020
- /** Splash image height. Optional. */
1021
- splashHeight?: number | null;
1022
- members: GuildMemberManager;
1023
- channels: Collection<string, GuildChannel>;
1024
- roles: Collection<string, Role>;
1025
- /** @param data - API guild from GET /guilds/{id} or gateway GUILD_CREATE */
1026
- constructor(client: Client, data: APIGuild & {
1027
- roles?: APIRole[];
1028
- ownerId?: string;
1029
- });
1030
- /** Get the guild icon URL, or null if no icon. */
1031
- iconURL(options?: {
1032
- size?: number;
1033
- }): string | null;
1034
- /** Get the guild banner URL, or null if no banner. */
1035
- bannerURL(options?: {
1036
- size?: number;
1037
- }): string | null;
1038
- /** Get the guild splash (invite background) URL, or null if no splash. */
1039
- splashURL(options?: {
1040
- size?: number;
1041
- }): string | null;
1042
- /**
1043
- * Add a role to a member by user ID. Does not require fetching the member first.
1044
- * @param userId - The user ID of the member
1045
- * @param roleId - The role ID to add (or use guild.resolveRoleId for mention/name resolution)
1046
- * Requires Manage Roles permission.
1047
- */
1048
- addRoleToMember(userId: string, roleId: string): Promise<void>;
1049
- /**
1050
- * Remove a role from a member by user ID. Does not require fetching the member first.
1051
- * @param userId - The user ID of the member
1052
- * @param roleId - The role ID to remove
1053
- * Requires Manage Roles permission.
1054
- */
1055
- removeRoleFromMember(userId: string, roleId: string): Promise<void>;
1179
+ /** ISO timestamp when the last message was pinned. Null if never pinned. */
1180
+ lastPinTimestamp: string | null;
1181
+ /** @param data - API channel from GET /channels/{id} or GET /guilds/{id}/channels */
1182
+ constructor(client: Client, data: APIChannelPartial);
1056
1183
  /**
1057
- * Create a role in this guild.
1058
- * Requires Manage Roles permission.
1059
- * @param options - Role data (permissions accepts PermissionResolvable for convenience)
1060
- * @returns The created role
1061
- * @example
1062
- * const role = await guild.createRole({ name: 'Mod', permissions: ['KickMembers', 'BanMembers'] });
1184
+ * Create the appropriate channel subclass from API data.
1185
+ * @param client - The client instance
1186
+ * @param data - Channel data from the API
1063
1187
  */
1064
- createRole(options: RESTCreateRoleBody & {
1065
- permissions?: string | PermissionResolvable;
1066
- }): Promise<Role>;
1188
+ static from(client: Client, data: APIChannel | APIChannelPartial): GuildChannel | TextChannel | null;
1067
1189
  /**
1068
- * Fetch all roles in this guild.
1069
- * @returns Array of Role objects (cached in guild.roles)
1190
+ * Create a channel from API data, including DM and GroupDM.
1191
+ * Used by ChannelManager.fetch() for GET /channels/{id}.
1070
1192
  */
1071
- fetchRoles(): Promise<Role[]>;
1193
+ static fromOrCreate(client: Client, data: APIChannel | APIChannelPartial): TextChannel | DMChannel | GuildChannel | null;
1072
1194
  /**
1073
- * Fetch a role by ID.
1074
- * @param roleId - The role ID to fetch
1075
- * @returns The role
1076
- * @throws FluxerError with ROLE_NOT_FOUND if role does not exist (404)
1195
+ * Bulk delete messages. Requires Manage Messages permission.
1196
+ * @param messageIds - Array of message IDs to delete (2–100)
1077
1197
  */
1078
- fetchRole(roleId: string): Promise<Role>;
1198
+ bulkDeleteMessages(messageIds: string[]): Promise<void>;
1079
1199
  /**
1080
- * Resolve a role ID from an argument (role mention, raw ID, or name).
1081
- * Fetches guild roles if name is provided.
1082
- * @param arg - Role mention (@role), role ID, or role name
1083
- * @returns The role ID, or null if not found
1200
+ * Send a typing indicator to the channel. Lasts ~10 seconds.
1084
1201
  */
1085
- resolveRoleId(arg: string): Promise<string | null>;
1202
+ sendTyping(): Promise<void>;
1203
+ }
1204
+ declare class GuildChannel extends Channel {
1205
+ readonly guildId: string;
1206
+ name: string | null;
1207
+ position?: number;
1208
+ parentId: string | null;
1209
+ /** Permission overwrites for roles and members. */
1210
+ permissionOverwrites: APIChannelOverwrite[];
1211
+ constructor(client: Client, data: APIChannel);
1086
1212
  /**
1087
- * Ban a user from this guild.
1088
- * @param userId - The user ID to ban
1089
- * @param options - Optional reason, delete_message_days (0–7), and ban_duration_seconds (temporary ban).
1090
- * ban_duration_seconds: 0 = permanent, or use 3600, 43200, 86400, 259200, 432000, 604800, 1209600, 2592000.
1091
- * Requires Ban Members permission.
1213
+ * Create a webhook in this channel.
1214
+ * @param options - Webhook name and optional avatar URL
1215
+ * @returns The webhook with token (required for send()). Requires Manage Webhooks permission.
1092
1216
  */
1093
- ban(userId: string, options?: {
1094
- reason?: string;
1095
- delete_message_days?: number;
1096
- ban_duration_seconds?: number;
1097
- }): Promise<void>;
1217
+ createWebhook(options: {
1218
+ name: string;
1219
+ avatar?: string | null;
1220
+ }): Promise<Webhook>;
1098
1221
  /**
1099
- * Fetch guild bans. Requires Ban Members permission.
1100
- * @returns List of GuildBan objects
1222
+ * Fetch all webhooks in this channel.
1223
+ * @returns Webhooks (includes token when listing from channel; can send via send())
1101
1224
  */
1102
- fetchBans(): Promise<GuildBan[]>;
1225
+ fetchWebhooks(): Promise<Webhook[]>;
1103
1226
  /**
1104
- * Remove a ban (unban a user).
1105
- * @param userId - The user ID to unban
1106
- * Requires Ban Members permission.
1227
+ * Create an invite for this channel.
1228
+ * @param options - max_uses (0–100), max_age (0–604800 seconds), unique, temporary
1229
+ * Requires Create Instant Invite permission.
1107
1230
  */
1108
- unban(userId: string): Promise<void>;
1231
+ createInvite(options?: {
1232
+ max_uses?: number;
1233
+ max_age?: number;
1234
+ unique?: boolean;
1235
+ temporary?: boolean;
1236
+ }): Promise<Invite>;
1109
1237
  /**
1110
- * Kick a member from this guild.
1111
- * @param userId - The user ID to kick
1112
- * Requires Kick Members permission.
1238
+ * Fetch invites for this channel.
1239
+ * Requires Manage Channel permission.
1113
1240
  */
1114
- kick(userId: string): Promise<void>;
1241
+ fetchInvites(): Promise<Invite[]>;
1115
1242
  /**
1116
- * Fetch a guild member by user ID.
1117
- * @param userId - The user ID of the member to fetch
1118
- * @returns The guild member
1119
- * @throws FluxerError with MEMBER_NOT_FOUND if user is not in the guild (404)
1120
- * @throws FluxerError with cause for permission denied (403) or other REST errors
1243
+ * Set or update a permission overwrite. PUT /channels/{id}/permissions/{overwriteId}.
1244
+ * @param overwriteId - Role or member ID
1245
+ * @param options - type (0=role, 1=member), allow, deny (permission bitfields)
1121
1246
  */
1122
- fetchMember(userId: string): Promise<GuildMember>;
1247
+ editPermission(overwriteId: string, options: {
1248
+ type: 0 | 1;
1249
+ allow?: string;
1250
+ deny?: string;
1251
+ }): Promise<void>;
1123
1252
  /**
1124
- * Fetch guild audit logs. Requires View Audit Log permission.
1125
- * @param options - Optional limit, before, after, user_id, action_type for filtering
1253
+ * Remove a permission overwrite. DELETE /channels/{id}/permissions/{overwriteId}.
1126
1254
  */
1127
- fetchAuditLogs(options?: {
1128
- limit?: number;
1129
- before?: string;
1130
- after?: string;
1131
- userId?: string;
1132
- actionType?: number;
1133
- }): Promise<APIGuildAuditLog>;
1134
- /** Fetch all webhooks in this guild. Returned webhooks do not include the token (cannot send). */
1135
- fetchWebhooks(): Promise<Webhook[]>;
1255
+ deletePermission(overwriteId: string): Promise<void>;
1136
1256
  /**
1137
- * Create a channel in this guild.
1138
- * @param data - Channel data: type (0=text, 2=voice, 4=category, 5=link), name, and optional parent_id, topic, bitrate, user_limit, nsfw, permission_overwrites
1139
- * Requires Manage Channels permission.
1257
+ * Edit this channel. PATCH /channels/{id}.
1258
+ * Requires Manage Channel permission.
1140
1259
  */
1141
- createChannel(data: {
1142
- type: 0 | 2 | 4 | 5;
1143
- name: string;
1144
- parent_id?: string | null;
1260
+ edit(options: {
1261
+ name?: string | null;
1145
1262
  topic?: string | null;
1263
+ parent_id?: string | null;
1146
1264
  bitrate?: number | null;
1147
1265
  user_limit?: number | null;
1148
1266
  nsfw?: boolean;
1267
+ rate_limit_per_user?: number;
1268
+ rtc_region?: string | null;
1149
1269
  permission_overwrites?: Array<{
1150
1270
  id: string;
1151
1271
  type: number;
1152
- allow: string;
1153
- deny: string;
1272
+ allow?: string;
1273
+ deny?: string;
1154
1274
  }>;
1155
- }): Promise<GuildChannel>;
1156
- /**
1157
- * Fetch all channels in this guild.
1158
- * @returns Array of GuildChannel objects (cached in guild.channels and client.channels)
1159
- */
1160
- fetchChannels(): Promise<GuildChannel[]>;
1161
- /**
1162
- * Edit this guild. PATCH /guilds/{id}.
1163
- * Requires guild owner or Administrator.
1164
- */
1165
- edit(options: {
1166
- name?: string;
1167
- icon?: string | null;
1168
- system_channel_id?: string | null;
1169
- system_channel_flags?: number;
1170
- afk_channel_id?: string | null;
1171
- afk_timeout?: number;
1172
- default_message_notifications?: DefaultMessageNotifications;
1173
- verification_level?: GuildVerificationLevel;
1174
- mfa_level?: GuildMFALevel;
1175
- explicit_content_filter?: GuildExplicitContentFilter;
1176
- banner?: string | null;
1177
- splash?: string | null;
1178
- embed_splash?: string | null;
1179
- splash_card_alignment?: string;
1180
- features?: GuildFeature[];
1181
1275
  }): Promise<this>;
1182
1276
  /**
1183
- * Delete this guild. POST /guilds/{id}/delete.
1184
- * Must be the guild owner.
1185
- */
1186
- delete(): Promise<void>;
1187
- /**
1188
- * Fetch vanity URL for this guild. GET /guilds/{id}/vanity-url.
1189
- * Requires Manage Guild permission.
1190
- */
1191
- fetchVanityURL(): Promise<APIVanityURL>;
1192
- /**
1193
- * Transfer guild ownership to another user. POST /guilds/{id}/transfer-ownership.
1194
- * Must be the guild owner.
1195
- */
1196
- transferOwnership(newOwnerId: string, password?: string): Promise<void>;
1197
- /**
1198
- * Set text channel flexible names feature. PATCH /guilds/{id}/text-channel-flexible-names.
1277
+ * Delete this channel. Requires Manage Channel permission.
1278
+ * @param options - silent: if true, does not send a system message (default false)
1199
1279
  */
1200
- setTextChannelFlexibleNames(enabled: boolean): Promise<this>;
1280
+ delete(options?: {
1281
+ silent?: boolean;
1282
+ }): Promise<void>;
1283
+ }
1284
+ declare class TextChannel extends GuildChannel {
1285
+ topic?: string | null;
1286
+ nsfw?: boolean;
1287
+ rateLimitPerUser?: number;
1288
+ lastMessageId?: string | null;
1289
+ constructor(client: Client, data: APIChannel);
1201
1290
  /**
1202
- * Set detached banner feature. PATCH /guilds/{id}/detached-banner.
1291
+ * Send a message to this channel.
1292
+ * @param options - Text content or object with content, embeds, and/or files
1203
1293
  */
1204
- setDetachedBanner(enabled: boolean): Promise<this>;
1294
+ send(options: MessageSendOptions): Promise<Message>;
1295
+ /** Message manager for this channel. Use channel.messages.fetch(messageId). */
1296
+ get messages(): MessageManager;
1205
1297
  /**
1206
- * Set disallow unclaimed accounts. PATCH /guilds/{id}/disallow-unclaimed-accounts.
1298
+ * Create a message collector for this channel.
1299
+ * Collects messages matching the filter until time expires or max is reached.
1300
+ * @param options - Filter, time (ms), and max count
1301
+ * @example
1302
+ * const collector = channel.createMessageCollector({ filter: m => m.author.id === userId, time: 10000 });
1303
+ * collector.on('collect', m => console.log(m.content));
1304
+ * collector.on('end', (collected, reason) => { ... });
1207
1305
  */
1208
- setDisallowUnclaimedAccounts(enabled: boolean): Promise<this>;
1306
+ createMessageCollector(options?: MessageCollectorOptions): MessageCollector;
1209
1307
  /**
1210
- * Update role positions. PATCH /guilds/{id}/roles.
1211
- * @param updates - Array of { id, position? }
1308
+ * Fetch pinned messages in this channel.
1309
+ * @returns Pinned messages
1212
1310
  */
1213
- setRolePositions(updates: Array<{
1214
- id: string;
1215
- position?: number;
1216
- }>): Promise<APIRole[]>;
1311
+ fetchPinnedMessages(): Promise<Message[]>;
1217
1312
  /**
1218
- * Update role hoist positions. PATCH /guilds/{id}/roles/hoist-positions.
1313
+ * Fetch a message by ID from this channel.
1314
+ * @param messageId - Snowflake of the message
1315
+ * @returns The message, or null if not found
1316
+ * @deprecated Use channel.messages.fetch(messageId) instead.
1219
1317
  */
1220
- setRoleHoistPositions(updates: Array<{
1221
- id: string;
1222
- hoist_position?: number;
1223
- }>): Promise<APIRole[]>;
1318
+ fetchMessage(messageId: string): Promise<Message>;
1319
+ }
1320
+ declare class CategoryChannel extends GuildChannel {
1321
+ }
1322
+ declare class VoiceChannel extends GuildChannel {
1323
+ bitrate?: number | null;
1324
+ userLimit?: number | null;
1325
+ rtcRegion?: string | null;
1326
+ constructor(client: Client, data: APIChannel);
1327
+ }
1328
+ declare class LinkChannel extends GuildChannel {
1329
+ url?: string | null;
1330
+ constructor(client: Client, data: APIChannel);
1331
+ }
1332
+ /** DM channel (direct message between bot and a user). */
1333
+ declare class DMChannel extends Channel {
1334
+ lastMessageId?: string | null;
1335
+ /** Group DM creator ID. Null for 1:1 DMs. */
1336
+ ownerId: string | null;
1337
+ /** Group DM recipients as User objects. Empty for 1:1 DMs. */
1338
+ recipients: User[];
1339
+ /** Group DM member display names (userId -> nickname). */
1340
+ nicks: Record<string, string>;
1341
+ constructor(client: Client, data: APIChannelPartial & Partial<APIChannel>);
1224
1342
  /**
1225
- * Reset role hoist positions. DELETE /guilds/{id}/roles/hoist-positions.
1343
+ * Send a message to this DM channel.
1344
+ * @param options - Text content or object with content, embeds, and/or files
1226
1345
  */
1227
- resetRoleHoistPositions(): Promise<APIRole[]>;
1346
+ send(options: MessageSendOptions): Promise<Message>;
1347
+ /** Message manager for this channel. Use channel.messages.fetch(messageId). */
1348
+ get messages(): MessageManager;
1228
1349
  /**
1229
- * Update channel positions.
1230
- * @param updates - Array of { id, position?, parent_id?, lock_permissions? }
1231
- * Requires Manage Channels permission.
1350
+ * Create a message collector for this DM channel.
1351
+ * @param options - Filter, time (ms), and max count
1232
1352
  */
1233
- setChannelPositions(updates: Array<{
1234
- id: string;
1235
- position?: number;
1236
- parent_id?: string | null;
1237
- lock_permissions?: boolean;
1238
- }>): Promise<void>;
1353
+ createMessageCollector(options?: MessageCollectorOptions): MessageCollector;
1239
1354
  /**
1240
- * Bulk create emojis. POST /guilds/{id}/emojis/bulk.
1241
- * @param emojis - Array of { name, image } (base64), 1-50 emojis
1242
- * @returns Array of created GuildEmoji objects
1355
+ * Fetch pinned messages in this DM channel.
1356
+ * @returns Pinned messages
1243
1357
  */
1244
- createEmojisBulk(emojis: Array<{
1245
- name: string;
1246
- image: string;
1247
- }>): Promise<GuildEmoji[]>;
1358
+ fetchPinnedMessages(): Promise<Message[]>;
1248
1359
  /**
1249
- * Bulk create stickers. POST /guilds/{id}/stickers/bulk.
1250
- * @param stickers - Array of { name, image, description?, tags? }, 1-50 stickers
1251
- * @returns Array of created GuildSticker objects
1360
+ * Fetch a message by ID from this DM channel.
1361
+ * @param messageId - Snowflake of the message
1362
+ * @returns The message, or null if not found
1363
+ * @deprecated Use channel.messages.fetch(messageId) instead.
1252
1364
  */
1253
- createStickersBulk(stickers: Array<{
1254
- name: string;
1255
- image: string;
1256
- description?: string;
1257
- tags?: string[];
1258
- }>): Promise<GuildSticker[]>;
1259
- }
1260
-
1261
- /** Represents an invite to a guild or channel. */
1262
- declare class Invite extends Base {
1263
- readonly client: Client;
1264
- readonly code: string;
1265
- readonly type: number;
1266
- readonly guild: APIGuildPartial;
1267
- readonly channel: APIChannelPartial;
1268
- readonly inviter: User | null;
1269
- readonly memberCount: number | null;
1270
- readonly presenceCount: number | null;
1271
- readonly expiresAt: string | null;
1272
- readonly temporary: boolean | null;
1273
- readonly createdAt: string | null;
1274
- readonly uses: number | null;
1275
- readonly maxUses: number | null;
1276
- readonly maxAge: number | null;
1277
- /** @param data - API invite from GET /invites/{code}, channel/guild invite list, or gateway INVITE_CREATE */
1278
- constructor(client: Client, data: APIInvite);
1279
- /** Full invite URL (https://fluxer.gg/{code} or instance-specific). */
1280
- get url(): string;
1365
+ fetchMessage(messageId: string): Promise<Message>;
1281
1366
  /**
1282
- * Resolve the guild from cache if available.
1283
- * @returns The guild, or null if not cached
1367
+ * Add a recipient to this Group DM. Requires Group DM (type GroupDM).
1368
+ * PUT /channels/{id}/recipients/{userId}.
1284
1369
  */
1285
- getGuild(): Guild | null;
1370
+ addRecipient(userId: string): Promise<void>;
1286
1371
  /**
1287
- * Delete this invite.
1288
- * Requires Manage Guild or Create Instant Invite permission.
1372
+ * Remove a recipient from this Group DM. Requires Group DM (type GroupDM).
1373
+ * DELETE /channels/{id}/recipients/{userId}.
1374
+ * @param options - silent: if true, does not send a system message (default false)
1289
1375
  */
1290
- delete(): Promise<void>;
1291
- }
1292
-
1293
- /** Minimal message data for MessageDelete when the full message is not available. */
1294
- interface PartialMessage {
1295
- id: string;
1296
- channelId: string;
1297
- channel?: Channel | null;
1298
- /** Message content, when provided by the gateway (e.g. Fluxer). */
1299
- content?: string | null;
1300
- /** Author user ID, when provided by the gateway (e.g. Fluxer). */
1301
- authorId?: string | null;
1376
+ removeRecipient(userId: string, options?: {
1377
+ silent?: boolean;
1378
+ }): Promise<void>;
1302
1379
  }
1303
1380
 
1304
1381
  /**
1305
1382
  * Manages channels with fetch and send.
1306
1383
  * Extends Collection so you can use .get(), .set(), .filter(), etc.
1307
1384
  */
1308
- declare class ChannelManager extends Collection<string, Channel> {
1385
+ declare class ChannelManager extends Collection<string, Channel | GuildChannel> {
1309
1386
  private readonly client;
1310
1387
  private readonly maxSize;
1311
1388
  constructor(client: Client);
@@ -1543,6 +1620,17 @@ declare class UsersManager extends Collection<string, User> {
1543
1620
  }): Promise<FetchedUserWithProfile>;
1544
1621
  }
1545
1622
 
1623
+ /** Minimal message data for MessageDelete when the full message is not available. */
1624
+ interface PartialMessage {
1625
+ id: string;
1626
+ channelId: string;
1627
+ channel?: Channel | null;
1628
+ /** Message content, when provided by the gateway (e.g. Fluxer). */
1629
+ content?: string | null;
1630
+ /** Author user ID, when provided by the gateway (e.g. Fluxer). */
1631
+ authorId?: string | null;
1632
+ }
1633
+
1546
1634
  /**
1547
1635
  * Callback parameter types for client events. Use with client.on(Events.X, handler).
1548
1636
  * @see Events
@@ -1550,10 +1638,7 @@ declare class UsersManager extends Collection<string, User> {
1550
1638
  interface ClientEvents {
1551
1639
  [Events.Ready]: [];
1552
1640
  [Events.MessageCreate]: [message: Message];
1553
- [Events.MessageUpdate]: [
1554
- oldMessage: Message | null,
1555
- newMessage: Message
1556
- ];
1641
+ [Events.MessageUpdate]: [oldMessage: Message | null, newMessage: Message];
1557
1642
  [Events.MessageDelete]: [message: PartialMessage];
1558
1643
  [Events.MessageReactionAdd]: [
1559
1644
  reaction: MessageReaction,
@@ -1573,9 +1658,7 @@ interface ClientEvents {
1573
1658
  ];
1574
1659
  [Events.MessageReactionRemoveAll]: [data: GatewayMessageReactionRemoveAllDispatchData];
1575
1660
  [Events.MessageReactionRemoveEmoji]: [data: GatewayMessageReactionRemoveEmojiDispatchData];
1576
- [Events.InteractionCreate]: [
1577
- interaction: _fluxerjs_types.APIApplicationCommandInteraction
1578
- ];
1661
+ [Events.InteractionCreate]: [interaction: APIApplicationCommandInteraction];
1579
1662
  [Events.GuildCreate]: [guild: Guild];
1580
1663
  [Events.GuildUpdate]: [oldGuild: Guild, newGuild: Guild];
1581
1664
  [Events.GuildDelete]: [guild: Guild];
@@ -1583,10 +1666,7 @@ interface ClientEvents {
1583
1666
  [Events.ChannelUpdate]: [oldChannel: Channel, newChannel: Channel];
1584
1667
  [Events.ChannelDelete]: [channel: Channel];
1585
1668
  [Events.GuildMemberAdd]: [member: GuildMember];
1586
- [Events.GuildMemberUpdate]: [
1587
- oldMember: GuildMember,
1588
- newMember: GuildMember
1589
- ];
1669
+ [Events.GuildMemberUpdate]: [oldMember: GuildMember, newMember: GuildMember];
1590
1670
  [Events.GuildMemberRemove]: [member: GuildMember];
1591
1671
  [Events.VoiceStateUpdate]: [data: GatewayVoiceStateUpdateDispatchData];
1592
1672
  [Events.VoiceServerUpdate]: [data: GatewayVoiceServerUpdateDispatchData];
@@ -1599,25 +1679,23 @@ interface ClientEvents {
1599
1679
  }>;
1600
1680
  }
1601
1681
  ];
1602
- [Events.MessageDeleteBulk]: [
1603
- data: _fluxerjs_types.GatewayMessageDeleteBulkDispatchData
1604
- ];
1682
+ [Events.MessageDeleteBulk]: [data: GatewayMessageDeleteBulkDispatchData];
1605
1683
  [Events.GuildBanAdd]: [ban: GuildBan];
1606
1684
  [Events.GuildBanRemove]: [ban: GuildBan];
1607
1685
  [Events.GuildEmojisUpdate]: [data: GatewayGuildEmojisUpdateDispatchData];
1608
1686
  [Events.GuildStickersUpdate]: [data: GatewayGuildStickersUpdateDispatchData];
1609
1687
  [Events.GuildIntegrationsUpdate]: [data: GatewayGuildIntegrationsUpdateDispatchData];
1610
- [Events.GuildRoleCreate]: [data: _fluxerjs_types.GatewayGuildRoleCreateDispatchData];
1611
- [Events.GuildRoleUpdate]: [data: _fluxerjs_types.GatewayGuildRoleUpdateDispatchData];
1612
- [Events.GuildRoleDelete]: [data: _fluxerjs_types.GatewayGuildRoleDeleteDispatchData];
1688
+ [Events.GuildRoleCreate]: [data: GatewayGuildRoleCreateDispatchData];
1689
+ [Events.GuildRoleUpdate]: [data: GatewayGuildRoleUpdateDispatchData];
1690
+ [Events.GuildRoleDelete]: [data: GatewayGuildRoleDeleteDispatchData];
1613
1691
  [Events.GuildScheduledEventCreate]: [data: GatewayGuildScheduledEventCreateDispatchData];
1614
1692
  [Events.GuildScheduledEventUpdate]: [data: GatewayGuildScheduledEventUpdateDispatchData];
1615
1693
  [Events.GuildScheduledEventDelete]: [data: GatewayGuildScheduledEventDeleteDispatchData];
1616
1694
  [Events.ChannelPinsUpdate]: [data: GatewayChannelPinsUpdateDispatchData];
1617
1695
  [Events.InviteCreate]: [invite: Invite];
1618
- [Events.InviteDelete]: [data: _fluxerjs_types.GatewayInviteDeleteDispatchData];
1619
- [Events.TypingStart]: [data: _fluxerjs_types.GatewayTypingStartDispatchData];
1620
- [Events.UserUpdate]: [data: _fluxerjs_types.GatewayUserUpdateDispatchData];
1696
+ [Events.InviteDelete]: [data: GatewayInviteDeleteDispatchData];
1697
+ [Events.TypingStart]: [data: GatewayTypingStartDispatchData];
1698
+ [Events.UserUpdate]: [data: GatewayUserUpdateDispatchData];
1621
1699
  [Events.PresenceUpdate]: [data: GatewayPresenceUpdateDispatchData];
1622
1700
  [Events.WebhooksUpdate]: [data: GatewayWebhooksUpdateDispatchData];
1623
1701
  [Events.Resumed]: [];
@@ -1687,7 +1765,7 @@ declare class Client extends EventEmitter {
1687
1765
  */
1688
1766
  sendToChannel(channelId: string, payload: string | {
1689
1767
  content?: string;
1690
- embeds?: _fluxerjs_types.APIEmbed[];
1768
+ embeds?: APIEmbed[];
1691
1769
  }): Promise<Message>;
1692
1770
  /**
1693
1771
  * Get or create a User from API data. Caches in client.users.
@@ -1743,6 +1821,7 @@ declare const ErrorCodes: {
1743
1821
  readonly MemberNotFound: "MEMBER_NOT_FOUND";
1744
1822
  readonly RoleNotFound: "ROLE_NOT_FOUND";
1745
1823
  readonly EmojiNotInGuild: "EMOJI_NOT_IN_GUILD";
1824
+ readonly EmojiNotFound: "EMOJI_NOT_FOUND";
1746
1825
  };
1747
1826
 
1748
1827
  /** User Content CDN (avatars, icons, banners, emojis, attachments). */
@@ -1812,4 +1891,4 @@ declare function cdnMemberBannerURL(guildId: string, userId: string, bannerHash:
1812
1891
  */
1813
1892
  declare function cdnDefaultAvatarURL(userIdOrIndex: string | number): string;
1814
1893
 
1815
- export { Base, CDN_URL, CategoryChannel, type CdnUrlOptions, Channel, ChannelManager, Client, type ClientEventMethods, type ClientEvents, ClientUser, type CollectedReaction, DMChannel, ErrorCodes, Events, type FetchedUserWithProfile, FluxerError, type FluxerErrorOptions, Guild, GuildBan, GuildChannel, GuildEmoji, GuildMember, GuildMemberManager, GuildSticker, Invite, LinkChannel, Message, MessageCollector, type MessageCollectorEndReason, type MessageCollectorOptions, type MessageEditOptions, MessageManager, MessageReaction, type MessageSendOptions, type PartialMessage, ReactionCollector, type ReactionCollectorEndReason, type ReactionCollectorOptions, Role, STATIC_CDN_URL, TextChannel, User, UsersManager, VoiceChannel, Webhook, type WebhookSendOptions, cdnAvatarURL, cdnBannerURL, cdnDefaultAvatarURL, cdnDisplayAvatarURL, cdnMemberAvatarURL, cdnMemberBannerURL };
1894
+ export { Base, CDN_URL, CategoryChannel, type CdnUrlOptions, Channel, ChannelManager, Client, type ClientEventMethods, type ClientEvents, ClientUser, type CollectedReaction, DMChannel, ErrorCodes, Events, type FetchedUserWithProfile, FluxerError, type FluxerErrorOptions, Guild, GuildBan, GuildChannel, GuildEmoji, GuildMember, GuildMemberManager, GuildMemberRoleManager, GuildSticker, Invite, LinkChannel, Message, MessageCollector, type MessageCollectorEndReason, type MessageCollectorOptions, type MessageEditOptions, MessageManager, MessageReaction, type MessageSendOptions, type PartialMessage, ReactionCollector, type ReactionCollectorEndReason, type ReactionCollectorOptions, Role, type RoleResolvable, STATIC_CDN_URL, TextChannel, User, UsersManager, VoiceChannel, Webhook, type WebhookSendOptions, cdnAvatarURL, cdnBannerURL, cdnDefaultAvatarURL, cdnDisplayAvatarURL, cdnMemberAvatarURL, cdnMemberBannerURL };