@fluxerjs/core 1.1.5 → 1.1.7
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/{Channel-HBKXUNL5.mjs → Channel-L6UE2MAF.mjs} +1 -1
- package/dist/{ClientUser-RXOB6K6C.mjs → ClientUser-JCRVGIJL.mjs} +1 -1
- package/dist/{Guild-3ETPHHF5.mjs → Guild-RXGLAN54.mjs} +2 -2
- package/dist/GuildEmoji-SOGQ4C32.mjs +8 -0
- package/dist/{GuildMember-43B5E5CH.mjs → GuildMember-F5FZJOHD.mjs} +1 -1
- package/dist/GuildSticker-3QYT6ZIY.mjs +8 -0
- package/dist/{Message-DXBXIQIJ.mjs → Message-QNWAPT55.mjs} +1 -1
- package/dist/{MessageReaction-NIAHV3EM.mjs → MessageReaction-MFK2N3AD.mjs} +1 -1
- package/dist/{Webhook-WIF6OGPA.mjs → Webhook-IWPKKMWD.mjs} +1 -1
- package/dist/{chunk-FSXTONUR.mjs → chunk-2245SAIA.mjs} +1 -1
- package/dist/{chunk-VZPN7FNH.mjs → chunk-4OEOU7G7.mjs} +11 -0
- package/dist/{chunk-DUQAD7F6.mjs → chunk-5JEDVRKU.mjs} +20 -0
- package/dist/chunk-5QRROWJS.mjs +56 -0
- package/dist/{chunk-E6SU3TR5.mjs → chunk-B6F5LWNS.mjs} +1 -1
- package/dist/{chunk-CREI4MOS.mjs → chunk-BRIU4HGS.mjs} +194 -21
- package/dist/{chunk-NNZUZLG3.mjs → chunk-EUKEYW72.mjs} +87 -7
- package/dist/chunk-KUMLJGXY.mjs +58 -0
- package/dist/{chunk-4S42USSG.mjs → chunk-S25KNTHZ.mjs} +2 -2
- package/dist/index.d.mts +246 -54
- package/dist/index.d.ts +246 -54
- package/dist/index.js +534 -194
- package/dist/index.mjs +78 -132
- package/package.json +7 -7
|
@@ -29,7 +29,7 @@ var MessageManager = class {
|
|
|
29
29
|
*/
|
|
30
30
|
async fetch(messageId) {
|
|
31
31
|
try {
|
|
32
|
-
const { Message } = await import("./Message-
|
|
32
|
+
const { Message } = await import("./Message-QNWAPT55.mjs");
|
|
33
33
|
const data = await this.client.rest.get(
|
|
34
34
|
Routes.channelMessage(this.channelId, messageId)
|
|
35
35
|
);
|
|
@@ -200,7 +200,7 @@ var GuildChannel = class extends Channel {
|
|
|
200
200
|
* @returns The webhook with token (required for send()). Requires Manage Webhooks permission.
|
|
201
201
|
*/
|
|
202
202
|
async createWebhook(options) {
|
|
203
|
-
const { Webhook } = await import("./Webhook-
|
|
203
|
+
const { Webhook } = await import("./Webhook-IWPKKMWD.mjs");
|
|
204
204
|
const data = await this.client.rest.post(Routes2.channelWebhooks(this.id), {
|
|
205
205
|
body: options,
|
|
206
206
|
auth: true
|
|
@@ -212,7 +212,7 @@ var GuildChannel = class extends Channel {
|
|
|
212
212
|
* @returns Webhooks (includes token when listing from channel; can send via send())
|
|
213
213
|
*/
|
|
214
214
|
async fetchWebhooks() {
|
|
215
|
-
const { Webhook } = await import("./Webhook-
|
|
215
|
+
const { Webhook } = await import("./Webhook-IWPKKMWD.mjs");
|
|
216
216
|
const data = await this.client.rest.get(Routes2.channelWebhooks(this.id));
|
|
217
217
|
const list = Array.isArray(data) ? data : Object.values(data ?? {});
|
|
218
218
|
return list.map((w) => new Webhook(this.client, w));
|
|
@@ -245,6 +245,66 @@ var GuildChannel = class extends Channel {
|
|
|
245
245
|
const list = Array.isArray(data) ? data : Object.values(data ?? {});
|
|
246
246
|
return list.map((i) => new Invite(this.client, i));
|
|
247
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Set or update a permission overwrite. PUT /channels/{id}/permissions/{overwriteId}.
|
|
250
|
+
* @param overwriteId - Role or member ID
|
|
251
|
+
* @param options - type (0=role, 1=member), allow, deny (permission bitfields)
|
|
252
|
+
*/
|
|
253
|
+
async editPermission(overwriteId, options) {
|
|
254
|
+
await this.client.rest.put(Routes2.channelPermission(this.id, overwriteId), {
|
|
255
|
+
body: options,
|
|
256
|
+
auth: true
|
|
257
|
+
});
|
|
258
|
+
const idx = this.permissionOverwrites.findIndex((o) => o.id === overwriteId);
|
|
259
|
+
const entry = {
|
|
260
|
+
id: overwriteId,
|
|
261
|
+
type: options.type,
|
|
262
|
+
allow: options.allow ?? "0",
|
|
263
|
+
deny: options.deny ?? "0"
|
|
264
|
+
};
|
|
265
|
+
if (idx >= 0) this.permissionOverwrites[idx] = entry;
|
|
266
|
+
else this.permissionOverwrites.push(entry);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Remove a permission overwrite. DELETE /channels/{id}/permissions/{overwriteId}.
|
|
270
|
+
*/
|
|
271
|
+
async deletePermission(overwriteId) {
|
|
272
|
+
await this.client.rest.delete(Routes2.channelPermission(this.id, overwriteId), { auth: true });
|
|
273
|
+
const idx = this.permissionOverwrites.findIndex((o) => o.id === overwriteId);
|
|
274
|
+
if (idx >= 0) this.permissionOverwrites.splice(idx, 1);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Edit this channel. PATCH /channels/{id}.
|
|
278
|
+
* Requires Manage Channel permission.
|
|
279
|
+
*/
|
|
280
|
+
async edit(options) {
|
|
281
|
+
const data = await this.client.rest.patch(Routes2.channel(this.id), {
|
|
282
|
+
body: options,
|
|
283
|
+
auth: true
|
|
284
|
+
});
|
|
285
|
+
this.name = data.name ?? this.name;
|
|
286
|
+
this.parentId = data.parent_id ?? this.parentId;
|
|
287
|
+
this.permissionOverwrites = data.permission_overwrites ?? this.permissionOverwrites;
|
|
288
|
+
const self = this;
|
|
289
|
+
if ("topic" in self && "topic" in data) self.topic = data.topic ?? null;
|
|
290
|
+
if ("nsfw" in self && "nsfw" in data) self.nsfw = data.nsfw ?? false;
|
|
291
|
+
if ("rate_limit_per_user" in data) self.rateLimitPerUser = data.rate_limit_per_user ?? 0;
|
|
292
|
+
if ("bitrate" in self && "bitrate" in data) self.bitrate = data.bitrate ?? null;
|
|
293
|
+
if ("user_limit" in data) self.userLimit = data.user_limit ?? null;
|
|
294
|
+
if ("rtc_region" in data) self.rtcRegion = data.rtc_region ?? null;
|
|
295
|
+
return this;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Delete this channel. Requires Manage Channel permission.
|
|
299
|
+
* @param options - silent: if true, does not send a system message (default false)
|
|
300
|
+
*/
|
|
301
|
+
async delete(options) {
|
|
302
|
+
const url = Routes2.channel(this.id) + (options?.silent ? "?silent=true" : "");
|
|
303
|
+
await this.client.rest.delete(url, { auth: true });
|
|
304
|
+
this.client.channels.delete(this.id);
|
|
305
|
+
const guild = this.client.guilds.get(this.guildId);
|
|
306
|
+
if (guild) guild.channels.delete(this.id);
|
|
307
|
+
}
|
|
248
308
|
};
|
|
249
309
|
var TextChannel = class extends GuildChannel {
|
|
250
310
|
topic;
|
|
@@ -265,7 +325,7 @@ var TextChannel = class extends GuildChannel {
|
|
|
265
325
|
async send(options) {
|
|
266
326
|
const opts = typeof options === "string" ? { content: options } : options;
|
|
267
327
|
const body = buildSendBody(options);
|
|
268
|
-
const { Message } = await import("./Message-
|
|
328
|
+
const { Message } = await import("./Message-QNWAPT55.mjs");
|
|
269
329
|
const files = opts.files?.length ? await resolveMessageFiles(opts.files) : void 0;
|
|
270
330
|
const postOptions = files?.length ? { body, files } : { body };
|
|
271
331
|
const data = await this.client.rest.post(Routes2.channelMessages(this.id), postOptions);
|
|
@@ -292,7 +352,7 @@ var TextChannel = class extends GuildChannel {
|
|
|
292
352
|
* @returns Pinned messages
|
|
293
353
|
*/
|
|
294
354
|
async fetchPinnedMessages() {
|
|
295
|
-
const { Message } = await import("./Message-
|
|
355
|
+
const { Message } = await import("./Message-QNWAPT55.mjs");
|
|
296
356
|
const data = await this.client.rest.get(Routes2.channelPins(this.id));
|
|
297
357
|
const list = Array.isArray(data) ? data : data?.items ?? [];
|
|
298
358
|
return list.map((item) => {
|
|
@@ -358,7 +418,7 @@ var DMChannel = class extends Channel {
|
|
|
358
418
|
async send(options) {
|
|
359
419
|
const opts = typeof options === "string" ? { content: options } : options;
|
|
360
420
|
const body = buildSendBody(options);
|
|
361
|
-
const { Message } = await import("./Message-
|
|
421
|
+
const { Message } = await import("./Message-QNWAPT55.mjs");
|
|
362
422
|
const files = opts.files?.length ? await resolveMessageFiles(opts.files) : void 0;
|
|
363
423
|
const postOptions = files?.length ? { body, files } : { body };
|
|
364
424
|
const data = await this.client.rest.post(Routes2.channelMessages(this.id), postOptions);
|
|
@@ -380,7 +440,7 @@ var DMChannel = class extends Channel {
|
|
|
380
440
|
* @returns Pinned messages
|
|
381
441
|
*/
|
|
382
442
|
async fetchPinnedMessages() {
|
|
383
|
-
const { Message } = await import("./Message-
|
|
443
|
+
const { Message } = await import("./Message-QNWAPT55.mjs");
|
|
384
444
|
const data = await this.client.rest.get(Routes2.channelPins(this.id));
|
|
385
445
|
const list = Array.isArray(data) ? data : data?.items ?? [];
|
|
386
446
|
return list.map((item) => {
|
|
@@ -401,6 +461,26 @@ var DMChannel = class extends Channel {
|
|
|
401
461
|
);
|
|
402
462
|
return this.client.channels.fetchMessage(this.id, messageId);
|
|
403
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* Add a recipient to this Group DM. Requires Group DM (type GroupDM).
|
|
466
|
+
* PUT /channels/{id}/recipients/{userId}.
|
|
467
|
+
*/
|
|
468
|
+
async addRecipient(userId) {
|
|
469
|
+
await this.client.rest.put(Routes2.channelRecipient(this.id, userId), { auth: true });
|
|
470
|
+
const user = this.client.users.get(userId) ?? await this.client.users.fetch(userId);
|
|
471
|
+
if (user) this.recipients.push(user);
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Remove a recipient from this Group DM. Requires Group DM (type GroupDM).
|
|
475
|
+
* DELETE /channels/{id}/recipients/{userId}.
|
|
476
|
+
* @param options - silent: if true, does not send a system message (default false)
|
|
477
|
+
*/
|
|
478
|
+
async removeRecipient(userId, options) {
|
|
479
|
+
const url = Routes2.channelRecipient(this.id, userId) + (options?.silent ? "?silent=true" : "");
|
|
480
|
+
await this.client.rest.delete(url, { auth: true });
|
|
481
|
+
const idx = this.recipients.findIndex((u) => u.id === userId);
|
|
482
|
+
if (idx >= 0) this.recipients.splice(idx, 1);
|
|
483
|
+
}
|
|
404
484
|
};
|
|
405
485
|
|
|
406
486
|
export {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CDN_URL
|
|
3
|
+
} from "./chunk-HQMYRYMY.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Base
|
|
6
|
+
} from "./chunk-XNS4O6QJ.mjs";
|
|
7
|
+
|
|
8
|
+
// src/structures/GuildSticker.ts
|
|
9
|
+
import { Routes } from "@fluxerjs/types";
|
|
10
|
+
var GuildSticker = class extends Base {
|
|
11
|
+
client;
|
|
12
|
+
id;
|
|
13
|
+
guildId;
|
|
14
|
+
name;
|
|
15
|
+
description;
|
|
16
|
+
tags;
|
|
17
|
+
animated;
|
|
18
|
+
/** @param data - API sticker from GET /guilds/{id}/stickers or guild sticker events */
|
|
19
|
+
constructor(client, data, guildId) {
|
|
20
|
+
super();
|
|
21
|
+
this.client = client;
|
|
22
|
+
this.id = data.id;
|
|
23
|
+
this.guildId = data.guild_id ?? guildId;
|
|
24
|
+
this.name = data.name;
|
|
25
|
+
this.description = data.description ?? "";
|
|
26
|
+
this.tags = data.tags ?? [];
|
|
27
|
+
this.animated = data.animated ?? false;
|
|
28
|
+
}
|
|
29
|
+
/** CDN URL for this sticker image. */
|
|
30
|
+
get url() {
|
|
31
|
+
const ext = this.animated ? "gif" : "png";
|
|
32
|
+
return `${CDN_URL}/stickers/${this.id}.${ext}`;
|
|
33
|
+
}
|
|
34
|
+
/** Delete this sticker. Requires Manage Emojis and Stickers permission. */
|
|
35
|
+
async delete() {
|
|
36
|
+
await this.client.rest.delete(Routes.guildSticker(this.guildId, this.id), {
|
|
37
|
+
auth: true
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Edit this sticker's name and/or description.
|
|
42
|
+
* Requires Manage Emojis and Stickers permission.
|
|
43
|
+
*/
|
|
44
|
+
async edit(options) {
|
|
45
|
+
const data = await this.client.rest.patch(Routes.guildSticker(this.guildId, this.id), {
|
|
46
|
+
body: options,
|
|
47
|
+
auth: true
|
|
48
|
+
});
|
|
49
|
+
const s = data;
|
|
50
|
+
this.name = s.name;
|
|
51
|
+
this.description = s.description ?? "";
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
GuildSticker
|
|
58
|
+
};
|
|
@@ -82,7 +82,7 @@ var User = class extends Base {
|
|
|
82
82
|
* Returns the DM channel; use {@link DMChannel.send} to send messages.
|
|
83
83
|
*/
|
|
84
84
|
async createDM() {
|
|
85
|
-
const { DMChannel: DMChannelClass } = await import("./Channel-
|
|
85
|
+
const { DMChannel: DMChannelClass } = await import("./Channel-L6UE2MAF.mjs");
|
|
86
86
|
const data = await this.client.rest.post(Routes.userMeChannels(), {
|
|
87
87
|
body: { recipient_id: this.id },
|
|
88
88
|
auth: true
|
|
@@ -110,7 +110,7 @@ var ClientUser = class extends User {
|
|
|
110
110
|
* @returns Array of Guild objects (cached in client.guilds)
|
|
111
111
|
*/
|
|
112
112
|
async fetchGuilds() {
|
|
113
|
-
const { Guild } = await import("./Guild-
|
|
113
|
+
const { Guild } = await import("./Guild-RXGLAN54.mjs");
|
|
114
114
|
const data = await this.client.rest.get(Routes2.currentUserGuilds());
|
|
115
115
|
const list = Array.isArray(data) ? data : data?.guilds ?? [];
|
|
116
116
|
const guilds = [];
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _fluxerjs_types from '@fluxerjs/types';
|
|
2
|
-
import { 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, APIGuildPartial, APIInvite, GatewayPresenceUpdateData, APIProfileResponse, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewaySendPayload, Routes
|
|
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';
|
|
3
3
|
export { GatewayOpcodes, MessageAttachmentFlags, Routes } from '@fluxerjs/types';
|
|
4
4
|
import { PermissionResolvable } from '@fluxerjs/util';
|
|
5
5
|
export { PermissionFlags, PermissionResolvable, PermissionString, PermissionsBitField, UserFlagsBitField, UserFlagsBits, UserFlagsResolvable, UserFlagsString, resolvePermissionsToBitfield, resolveTenorToImageUrl } from '@fluxerjs/util';
|
|
@@ -16,6 +16,59 @@ declare abstract class Base {
|
|
|
16
16
|
abstract readonly client: Client;
|
|
17
17
|
}
|
|
18
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
|
+
|
|
19
72
|
/**
|
|
20
73
|
* Manages messages for a channel. Access via channel.messages.
|
|
21
74
|
* @example
|
|
@@ -274,6 +327,47 @@ declare class GuildChannel extends Channel {
|
|
|
274
327
|
* Requires Manage Channel permission.
|
|
275
328
|
*/
|
|
276
329
|
fetchInvites(): Promise<Invite[]>;
|
|
330
|
+
/**
|
|
331
|
+
* Set or update a permission overwrite. PUT /channels/{id}/permissions/{overwriteId}.
|
|
332
|
+
* @param overwriteId - Role or member ID
|
|
333
|
+
* @param options - type (0=role, 1=member), allow, deny (permission bitfields)
|
|
334
|
+
*/
|
|
335
|
+
editPermission(overwriteId: string, options: {
|
|
336
|
+
type: 0 | 1;
|
|
337
|
+
allow?: string;
|
|
338
|
+
deny?: string;
|
|
339
|
+
}): Promise<void>;
|
|
340
|
+
/**
|
|
341
|
+
* Remove a permission overwrite. DELETE /channels/{id}/permissions/{overwriteId}.
|
|
342
|
+
*/
|
|
343
|
+
deletePermission(overwriteId: string): Promise<void>;
|
|
344
|
+
/**
|
|
345
|
+
* Edit this channel. PATCH /channels/{id}.
|
|
346
|
+
* Requires Manage Channel permission.
|
|
347
|
+
*/
|
|
348
|
+
edit(options: {
|
|
349
|
+
name?: string | null;
|
|
350
|
+
topic?: string | null;
|
|
351
|
+
parent_id?: string | null;
|
|
352
|
+
bitrate?: number | null;
|
|
353
|
+
user_limit?: number | null;
|
|
354
|
+
nsfw?: boolean;
|
|
355
|
+
rate_limit_per_user?: number;
|
|
356
|
+
rtc_region?: string | null;
|
|
357
|
+
permission_overwrites?: Array<{
|
|
358
|
+
id: string;
|
|
359
|
+
type: number;
|
|
360
|
+
allow?: string;
|
|
361
|
+
deny?: string;
|
|
362
|
+
}>;
|
|
363
|
+
}): Promise<this>;
|
|
364
|
+
/**
|
|
365
|
+
* Delete this channel. Requires Manage Channel permission.
|
|
366
|
+
* @param options - silent: if true, does not send a system message (default false)
|
|
367
|
+
*/
|
|
368
|
+
delete(options?: {
|
|
369
|
+
silent?: boolean;
|
|
370
|
+
}): Promise<void>;
|
|
277
371
|
}
|
|
278
372
|
declare class TextChannel extends GuildChannel {
|
|
279
373
|
topic?: string | null;
|
|
@@ -357,6 +451,19 @@ declare class DMChannel extends Channel {
|
|
|
357
451
|
* @deprecated Use channel.messages.fetch(messageId) instead.
|
|
358
452
|
*/
|
|
359
453
|
fetchMessage(messageId: string): Promise<Message>;
|
|
454
|
+
/**
|
|
455
|
+
* Add a recipient to this Group DM. Requires Group DM (type GroupDM).
|
|
456
|
+
* PUT /channels/{id}/recipients/{userId}.
|
|
457
|
+
*/
|
|
458
|
+
addRecipient(userId: string): Promise<void>;
|
|
459
|
+
/**
|
|
460
|
+
* Remove a recipient from this Group DM. Requires Group DM (type GroupDM).
|
|
461
|
+
* DELETE /channels/{id}/recipients/{userId}.
|
|
462
|
+
* @param options - silent: if true, does not send a system message (default false)
|
|
463
|
+
*/
|
|
464
|
+
removeRecipient(userId: string, options?: {
|
|
465
|
+
silent?: boolean;
|
|
466
|
+
}): Promise<void>;
|
|
360
467
|
}
|
|
361
468
|
|
|
362
469
|
/** Represents a reaction added to or removed from a message. */
|
|
@@ -515,6 +622,11 @@ declare class Message extends Base {
|
|
|
515
622
|
fetch(): Promise<Message>;
|
|
516
623
|
/** Delete this message. */
|
|
517
624
|
delete(): Promise<void>;
|
|
625
|
+
/**
|
|
626
|
+
* Delete a specific attachment from this message.
|
|
627
|
+
* DELETE /channels/{id}/messages/{id}/attachments/{attachmentId}.
|
|
628
|
+
*/
|
|
629
|
+
deleteAttachment(attachmentId: string): Promise<void>;
|
|
518
630
|
/** Pin this message to the channel. Requires Manage Messages permission. */
|
|
519
631
|
pin(): Promise<void>;
|
|
520
632
|
/** Unpin this message from the channel. Requires Manage Messages permission. */
|
|
@@ -689,6 +801,28 @@ declare class GuildMember extends Base {
|
|
|
689
801
|
* Requires Manage Roles permission.
|
|
690
802
|
*/
|
|
691
803
|
removeRole(roleId: string): Promise<void>;
|
|
804
|
+
/**
|
|
805
|
+
* Edit this guild member. PATCH /guilds/{id}/members/{userId} or /members/@me for the bot.
|
|
806
|
+
* For @me: nick, avatar, banner, bio, pronouns, accent_color, profile_flags, mute, deaf,
|
|
807
|
+
* communication_disabled_until, timeout_reason, channel_id, connection_id.
|
|
808
|
+
* For other members: same plus roles (array of role IDs).
|
|
809
|
+
*/
|
|
810
|
+
edit(options: {
|
|
811
|
+
nick?: string | null;
|
|
812
|
+
roles?: string[];
|
|
813
|
+
avatar?: string | null;
|
|
814
|
+
banner?: string | null;
|
|
815
|
+
bio?: string | null;
|
|
816
|
+
pronouns?: string | null;
|
|
817
|
+
accent_color?: number | null;
|
|
818
|
+
profile_flags?: number | null;
|
|
819
|
+
mute?: boolean;
|
|
820
|
+
deaf?: boolean;
|
|
821
|
+
communication_disabled_until?: string | null;
|
|
822
|
+
timeout_reason?: string | null;
|
|
823
|
+
channel_id?: string | null;
|
|
824
|
+
connection_id?: string | null;
|
|
825
|
+
}): Promise<this>;
|
|
692
826
|
/**
|
|
693
827
|
* Get the member's guild-level permissions (from roles only, no channel overwrites).
|
|
694
828
|
* Use this for server-wide permission checks (e.g. ban, kick, manage roles).
|
|
@@ -743,6 +877,15 @@ declare class GuildMemberManager extends Collection<string, GuildMember> {
|
|
|
743
877
|
* console.log(me.displayName);
|
|
744
878
|
*/
|
|
745
879
|
fetchMe(): Promise<GuildMember>;
|
|
880
|
+
/**
|
|
881
|
+
* Fetch guild members with pagination. GET /guilds/{id}/members.
|
|
882
|
+
* @param options - limit (1-1000), after (user ID for pagination)
|
|
883
|
+
* @returns Array of GuildMember objects (cached in guild.members)
|
|
884
|
+
*/
|
|
885
|
+
fetch(options?: {
|
|
886
|
+
limit?: number;
|
|
887
|
+
after?: string;
|
|
888
|
+
}): Promise<GuildMember[]>;
|
|
746
889
|
}
|
|
747
890
|
|
|
748
891
|
/** Represents a role in a guild. */
|
|
@@ -987,6 +1130,73 @@ declare class Guild extends Base {
|
|
|
987
1130
|
* @returns Array of GuildChannel objects (cached in guild.channels and client.channels)
|
|
988
1131
|
*/
|
|
989
1132
|
fetchChannels(): Promise<GuildChannel[]>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Edit this guild. PATCH /guilds/{id}.
|
|
1135
|
+
* Requires guild owner or Administrator.
|
|
1136
|
+
*/
|
|
1137
|
+
edit(options: {
|
|
1138
|
+
name?: string;
|
|
1139
|
+
icon?: string | null;
|
|
1140
|
+
system_channel_id?: string | null;
|
|
1141
|
+
system_channel_flags?: number;
|
|
1142
|
+
afk_channel_id?: string | null;
|
|
1143
|
+
afk_timeout?: number;
|
|
1144
|
+
default_message_notifications?: DefaultMessageNotifications;
|
|
1145
|
+
verification_level?: GuildVerificationLevel;
|
|
1146
|
+
mfa_level?: GuildMFALevel;
|
|
1147
|
+
explicit_content_filter?: GuildExplicitContentFilter;
|
|
1148
|
+
banner?: string | null;
|
|
1149
|
+
splash?: string | null;
|
|
1150
|
+
embed_splash?: string | null;
|
|
1151
|
+
splash_card_alignment?: string;
|
|
1152
|
+
features?: GuildFeature[];
|
|
1153
|
+
}): Promise<this>;
|
|
1154
|
+
/**
|
|
1155
|
+
* Delete this guild. POST /guilds/{id}/delete.
|
|
1156
|
+
* Must be the guild owner.
|
|
1157
|
+
*/
|
|
1158
|
+
delete(): Promise<void>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Fetch vanity URL for this guild. GET /guilds/{id}/vanity-url.
|
|
1161
|
+
* Requires Manage Guild permission.
|
|
1162
|
+
*/
|
|
1163
|
+
fetchVanityURL(): Promise<APIVanityURL>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Transfer guild ownership to another user. POST /guilds/{id}/transfer-ownership.
|
|
1166
|
+
* Must be the guild owner.
|
|
1167
|
+
*/
|
|
1168
|
+
transferOwnership(newOwnerId: string, password?: string): Promise<void>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Set text channel flexible names feature. PATCH /guilds/{id}/text-channel-flexible-names.
|
|
1171
|
+
*/
|
|
1172
|
+
setTextChannelFlexibleNames(enabled: boolean): Promise<this>;
|
|
1173
|
+
/**
|
|
1174
|
+
* Set detached banner feature. PATCH /guilds/{id}/detached-banner.
|
|
1175
|
+
*/
|
|
1176
|
+
setDetachedBanner(enabled: boolean): Promise<this>;
|
|
1177
|
+
/**
|
|
1178
|
+
* Set disallow unclaimed accounts. PATCH /guilds/{id}/disallow-unclaimed-accounts.
|
|
1179
|
+
*/
|
|
1180
|
+
setDisallowUnclaimedAccounts(enabled: boolean): Promise<this>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Update role positions. PATCH /guilds/{id}/roles.
|
|
1183
|
+
* @param updates - Array of { id, position? }
|
|
1184
|
+
*/
|
|
1185
|
+
setRolePositions(updates: Array<{
|
|
1186
|
+
id: string;
|
|
1187
|
+
position?: number;
|
|
1188
|
+
}>): Promise<APIRole[]>;
|
|
1189
|
+
/**
|
|
1190
|
+
* Update role hoist positions. PATCH /guilds/{id}/roles/hoist-positions.
|
|
1191
|
+
*/
|
|
1192
|
+
setRoleHoistPositions(updates: Array<{
|
|
1193
|
+
id: string;
|
|
1194
|
+
hoist_position?: number;
|
|
1195
|
+
}>): Promise<APIRole[]>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Reset role hoist positions. DELETE /guilds/{id}/roles/hoist-positions.
|
|
1198
|
+
*/
|
|
1199
|
+
resetRoleHoistPositions(): Promise<APIRole[]>;
|
|
990
1200
|
/**
|
|
991
1201
|
* Update channel positions.
|
|
992
1202
|
* @param updates - Array of { id, position?, parent_id?, lock_permissions? }
|
|
@@ -998,6 +1208,26 @@ declare class Guild extends Base {
|
|
|
998
1208
|
parent_id?: string | null;
|
|
999
1209
|
lock_permissions?: boolean;
|
|
1000
1210
|
}>): Promise<void>;
|
|
1211
|
+
/**
|
|
1212
|
+
* Bulk create emojis. POST /guilds/{id}/emojis/bulk.
|
|
1213
|
+
* @param emojis - Array of { name, image } (base64), 1-50 emojis
|
|
1214
|
+
* @returns Array of created GuildEmoji objects
|
|
1215
|
+
*/
|
|
1216
|
+
createEmojisBulk(emojis: Array<{
|
|
1217
|
+
name: string;
|
|
1218
|
+
image: string;
|
|
1219
|
+
}>): Promise<GuildEmoji[]>;
|
|
1220
|
+
/**
|
|
1221
|
+
* Bulk create stickers. POST /guilds/{id}/stickers/bulk.
|
|
1222
|
+
* @param stickers - Array of { name, image, description?, tags? }, 1-50 stickers
|
|
1223
|
+
* @returns Array of created GuildSticker objects
|
|
1224
|
+
*/
|
|
1225
|
+
createStickersBulk(stickers: Array<{
|
|
1226
|
+
name: string;
|
|
1227
|
+
image: string;
|
|
1228
|
+
description?: string;
|
|
1229
|
+
tags?: string[];
|
|
1230
|
+
}>): Promise<GuildSticker[]>;
|
|
1001
1231
|
}
|
|
1002
1232
|
|
|
1003
1233
|
/** Represents an invite to a guild or channel. */
|
|
@@ -1089,6 +1319,16 @@ declare class ChannelManager extends Collection<string, Channel> {
|
|
|
1089
1319
|
declare class GuildManager extends Collection<string, Guild> {
|
|
1090
1320
|
private readonly client;
|
|
1091
1321
|
constructor(client: Client);
|
|
1322
|
+
/**
|
|
1323
|
+
* Create a guild. POST /guilds.
|
|
1324
|
+
* @param options - name (required), icon (base64), empty_features
|
|
1325
|
+
* @returns The created guild
|
|
1326
|
+
*/
|
|
1327
|
+
create(options: {
|
|
1328
|
+
name: string;
|
|
1329
|
+
icon?: string | null;
|
|
1330
|
+
empty_features?: boolean;
|
|
1331
|
+
}): Promise<Guild>;
|
|
1092
1332
|
/**
|
|
1093
1333
|
* Fetch a guild by ID from the API (or return from cache if present).
|
|
1094
1334
|
* @param guildId - Snowflake of the guild
|
|
@@ -1347,6 +1587,11 @@ declare class Client extends EventEmitter {
|
|
|
1347
1587
|
id?: string;
|
|
1348
1588
|
animated?: boolean;
|
|
1349
1589
|
}, guildId?: string | null): Promise<string>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Fetch instance info (API URL, gateway URL, features). GET /instance.
|
|
1592
|
+
* Does not require authentication.
|
|
1593
|
+
*/
|
|
1594
|
+
fetchInstance(): Promise<APIInstance>;
|
|
1350
1595
|
/**
|
|
1351
1596
|
* Fetch a message by channel and message ID. Use when you have IDs (e.g. from a DB).
|
|
1352
1597
|
* @param channelId - Snowflake of the channel
|
|
@@ -1395,59 +1640,6 @@ declare class Client extends EventEmitter {
|
|
|
1395
1640
|
static get Routes(): typeof Routes;
|
|
1396
1641
|
}
|
|
1397
1642
|
|
|
1398
|
-
/** Represents a custom emoji in a guild. */
|
|
1399
|
-
declare class GuildEmoji extends Base {
|
|
1400
|
-
readonly client: Client;
|
|
1401
|
-
readonly id: string;
|
|
1402
|
-
readonly guildId: string;
|
|
1403
|
-
name: string;
|
|
1404
|
-
readonly animated: boolean;
|
|
1405
|
-
/** @param data - API emoji from GET /guilds/{id}/emojis or guild emoji events */
|
|
1406
|
-
constructor(client: Client, data: APIEmoji & {
|
|
1407
|
-
guild_id?: string;
|
|
1408
|
-
}, guildId: string);
|
|
1409
|
-
/** CDN URL for this emoji image. */
|
|
1410
|
-
get url(): string;
|
|
1411
|
-
/** Emoji identifier for use in reactions: `name:id` */
|
|
1412
|
-
get identifier(): string;
|
|
1413
|
-
/** Delete this emoji. Requires Manage Emojis and Stickers permission. */
|
|
1414
|
-
delete(): Promise<void>;
|
|
1415
|
-
/**
|
|
1416
|
-
* Edit this emoji's name.
|
|
1417
|
-
* Requires Manage Emojis and Stickers permission.
|
|
1418
|
-
*/
|
|
1419
|
-
edit(options: {
|
|
1420
|
-
name: string;
|
|
1421
|
-
}): Promise<GuildEmoji>;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
/** Represents a custom sticker in a guild. */
|
|
1425
|
-
declare class GuildSticker extends Base {
|
|
1426
|
-
readonly client: Client;
|
|
1427
|
-
readonly id: string;
|
|
1428
|
-
readonly guildId: string;
|
|
1429
|
-
name: string;
|
|
1430
|
-
description: string;
|
|
1431
|
-
readonly tags: string[];
|
|
1432
|
-
readonly animated: boolean;
|
|
1433
|
-
/** @param data - API sticker from GET /guilds/{id}/stickers or guild sticker events */
|
|
1434
|
-
constructor(client: Client, data: APISticker & {
|
|
1435
|
-
guild_id?: string;
|
|
1436
|
-
}, guildId: string);
|
|
1437
|
-
/** CDN URL for this sticker image. */
|
|
1438
|
-
get url(): string;
|
|
1439
|
-
/** Delete this sticker. Requires Manage Emojis and Stickers permission. */
|
|
1440
|
-
delete(): Promise<void>;
|
|
1441
|
-
/**
|
|
1442
|
-
* Edit this sticker's name and/or description.
|
|
1443
|
-
* Requires Manage Emojis and Stickers permission.
|
|
1444
|
-
*/
|
|
1445
|
-
edit(options: {
|
|
1446
|
-
name?: string;
|
|
1447
|
-
description?: string;
|
|
1448
|
-
}): Promise<GuildSticker>;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
1643
|
interface FluxerErrorOptions {
|
|
1452
1644
|
code?: string;
|
|
1453
1645
|
cause?: Error;
|