@fluxerjs/core 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SubpathMessage-CNJlnR6y.d.mts → SubpathMessage-BAwFSagN.d.mts} +86 -10
- package/dist/{SubpathMessage-DjLo6il5.d.ts → SubpathMessage-Dq-1tI7E.d.ts} +86 -10
- package/dist/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +533 -133
- package/dist/client.mjs +533 -133
- package/dist/cluster.d.mts +1 -1
- package/dist/cluster.d.ts +1 -1
- package/dist/cluster.js +533 -133
- package/dist/cluster.mjs +533 -133
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +531 -133
- package/dist/index.mjs +531 -133
- package/dist/message.d.mts +1 -1
- package/dist/message.d.ts +1 -1
- package/dist/message.js +141 -41
- package/dist/message.mjs +141 -41
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _fluxerjs_types from '@fluxerjs/types';
|
|
2
|
-
import { APIGuild, APIRole, SystemChannelFlagsValue, DefaultMessageNotifications, GuildVerificationLevel, GuildMFALevel, GuildExplicitContentFilter, SplashCardAlignment, GuildNSFWLevel, ContentWarningLevel, GuildFeature, EmbedType, ChannelType, APIChannel, APIUserPartial, APIBan, APIEmoji, APISticker, InviteType, APIInvite, WebhookType, APIWebhook, RESTPostAPIEmbed, AuditLogActionType, APIInstanceEndpoints, APIInstance, APIGuildMember, APIMessageReaction, APIMessageSticker, MessageType, APIChannelPartial, OverwriteType, APIChannelOverwrite, APIForumTag, APIDefaultReactionEmoji, ForumSortOrder, ForumTagSetting, ForumLayout, APIThreadMember, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, APIMessage, GatewayVoiceStateUpdateDispatchData, GatewayVoiceStateAckDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayEntranceSoundPlayDispatchData, GatewayVoiceStatesSyncData, GatewayUserConnectionsUpdateDispatchData, GatewayWebAuthnCredentialsUpdateDispatchData, GatewayReceivePayload, APIGatewayBotResponse, APIEmojiMetadata, APIStickerMetadata, APIApplicationMe, APIOAuthApplication, APIPreloadMessagesResponse, APIBulkMessageFetchResponse, GatewaySendPayload, Routes } from '@fluxerjs/types';
|
|
2
|
+
import { APIGuild, APIRole, SystemChannelFlagsValue, DefaultMessageNotifications, GuildVerificationLevel, GuildMFALevel, GuildExplicitContentFilter, SplashCardAlignment, GuildNSFWLevel, ContentWarningLevel, GuildFeature, EmbedType, ChannelType, APIChannel, APIUserPartial, APIBan, APIEmoji, APISticker, InviteType, APIInvite, WebhookType, APIWebhook, RESTPostAPIEmbed, AuditLogActionType, APIInstanceEndpoints, APIInstance, APIGuildMember, APIMessageReaction, APIMessageSticker, MessageType, APIChannelPartial, OverwriteType, APIChannelOverwrite, APIForumTag, APIDefaultReactionEmoji, ForumSortOrder, ForumTagSetting, ForumLayout, APIThreadMember, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, APIMessage, GatewayVoiceStateUpdateDispatchData, GatewayVoiceStateAckDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayEntranceSoundPlayDispatchData, GatewayVoiceSignalDispatchData, GatewayGuildHealthUpdateDispatchData, GatewayOperatorPassUpdateDispatchData, GatewayVoiceStatesSyncData, GatewayUserConnectionsUpdateDispatchData, GatewayWebAuthnCredentialsUpdateDispatchData, GatewayReceivePayload, APIGatewayBotResponse, APIEmojiMetadata, APIStickerMetadata, APIApplicationMe, APIOAuthApplication, APIPreloadMessagesResponse, APIBulkMessageFetchResponse, GatewaySendPayload, Routes } from '@fluxerjs/types';
|
|
3
3
|
import * as _fluxerjs_collection from '@fluxerjs/collection';
|
|
4
4
|
import { LimitedCollection, Collection } from '@fluxerjs/collection';
|
|
5
5
|
import { PermissionsBitField, LogLevel, Logger, MessageFlagsResolvable, PermissionResolvable, MessageFlagsBitField } from '@fluxerjs/util';
|
|
@@ -173,6 +173,7 @@ interface FetchGuildMembersOptions {
|
|
|
173
173
|
*/
|
|
174
174
|
declare class GuildMemberManager extends LimitedCollection<string, GuildMember> {
|
|
175
175
|
private readonly guild;
|
|
176
|
+
private readonly pendingFetches;
|
|
176
177
|
constructor(guild: Guild);
|
|
177
178
|
/**
|
|
178
179
|
* Get a guild member from cache or fetch from the API if not present.
|
|
@@ -313,6 +314,8 @@ declare class User extends Base {
|
|
|
313
314
|
readonly system: boolean;
|
|
314
315
|
/** Banner hash for profile. */
|
|
315
316
|
banner: string | null;
|
|
317
|
+
/** True when this user was created from an ID-only stub and not yet hydrated from REST/gateway. */
|
|
318
|
+
partial: boolean;
|
|
316
319
|
constructor(client: Client, data: APIUserPartial & {
|
|
317
320
|
banner?: string | null;
|
|
318
321
|
});
|
|
@@ -320,6 +323,8 @@ declare class User extends Base {
|
|
|
320
323
|
_patch(data: APIUserPartial & {
|
|
321
324
|
banner?: string | null;
|
|
322
325
|
}): void;
|
|
326
|
+
/** Fetch the full user from REST when this instance is a partial stub. */
|
|
327
|
+
fetch(): Promise<User>;
|
|
323
328
|
private cdnOpts;
|
|
324
329
|
/**
|
|
325
330
|
* User avatar CDN URL (null if no custom avatar set).
|
|
@@ -453,6 +458,8 @@ declare class Role extends Base {
|
|
|
453
458
|
mentionable: boolean;
|
|
454
459
|
/** Unicode emoji for this role (null = none). */
|
|
455
460
|
unicodeEmoji: string | null;
|
|
461
|
+
/** Role icon image hash (null = none). */
|
|
462
|
+
icon: string | null;
|
|
456
463
|
/** Hoist position (null = not hoisted). */
|
|
457
464
|
hoistPosition: number | null;
|
|
458
465
|
constructor(client: Client, data: APIRole, guildId: string);
|
|
@@ -739,6 +746,11 @@ declare class Guild extends Base {
|
|
|
739
746
|
readonly id: string;
|
|
740
747
|
/** Whether the guild is currently available through the gateway. */
|
|
741
748
|
available: boolean;
|
|
749
|
+
/**
|
|
750
|
+
* True when only guild metadata is known (e.g. created from `GET /guilds/{id}`)
|
|
751
|
+
* and nested channels/roles have not been synced yet. `guilds.resolve()` hydrates partial guilds.
|
|
752
|
+
*/
|
|
753
|
+
partial: boolean;
|
|
742
754
|
/** Guild name. */
|
|
743
755
|
name: string;
|
|
744
756
|
/** Icon hash (use {@link iconURL} to get full CDN URL). */
|
|
@@ -888,6 +900,8 @@ declare class Guild extends Base {
|
|
|
888
900
|
resetRoleHoistPositions(): Promise<Role[]>;
|
|
889
901
|
/** Ban a user from the guild. Requires Ban Members. `banDurationSeconds`: 0 = permanent. */
|
|
890
902
|
ban(userId: string, options?: GuildBanOptions): Promise<void>;
|
|
903
|
+
/** Fetch a single ban by user ID. Requires Ban Members. */
|
|
904
|
+
fetchBan(userId: string): Promise<GuildBan>;
|
|
891
905
|
/** Fetch all bans in this guild. Requires Ban Members. */
|
|
892
906
|
fetchBans(): Promise<GuildBan[]>;
|
|
893
907
|
/** Unban a user from the guild. Requires Ban Members. */
|
|
@@ -973,7 +987,7 @@ declare class Guild extends Base {
|
|
|
973
987
|
}
|
|
974
988
|
|
|
975
989
|
/**
|
|
976
|
-
* Optional cache size limits (
|
|
990
|
+
* Optional cache size limits (LRU eviction when exceeded).
|
|
977
991
|
*
|
|
978
992
|
* | Value | Meaning |
|
|
979
993
|
* |-------|---------|
|
|
@@ -1269,17 +1283,18 @@ declare class CacheController {
|
|
|
1269
1283
|
/**
|
|
1270
1284
|
* Channel cache + fetch/send helpers.
|
|
1271
1285
|
* Extends {@link LimitedCollection} (`.get()`, `.set()`, `.filter()`, …).
|
|
1272
|
-
*
|
|
1286
|
+
* LRU-evicts (and keeps guild indexes / message caches aligned) at `cache.channels`.
|
|
1273
1287
|
*/
|
|
1274
1288
|
declare class ChannelManager extends LimitedCollection<string, Channel> {
|
|
1275
1289
|
private readonly client;
|
|
1290
|
+
private readonly pendingFetches;
|
|
1276
1291
|
constructor(client: Client);
|
|
1277
1292
|
/**
|
|
1278
1293
|
* Remove a channel from cache. Does not delete it on the API.
|
|
1279
1294
|
* Use {@link Channel.delete} after {@link fetch} to delete the channel.
|
|
1280
1295
|
*/
|
|
1281
1296
|
delete(key: string): boolean;
|
|
1282
|
-
/** Retrieve from cache, otherwise {@link fetch}. */
|
|
1297
|
+
/** Retrieve from cache (hydrating partial stubs), otherwise {@link fetch}. */
|
|
1283
1298
|
resolve(channelId: string): Promise<Channel>;
|
|
1284
1299
|
/**
|
|
1285
1300
|
* Fetch a channel by ID. The returned {@link Channel} has {@link Channel.delete}
|
|
@@ -1294,6 +1309,7 @@ declare class ChannelManager extends LimitedCollection<string, Channel> {
|
|
|
1294
1309
|
fetch(channelId: string, options?: {
|
|
1295
1310
|
force?: boolean;
|
|
1296
1311
|
}): Promise<Channel>;
|
|
1312
|
+
private fetchFresh;
|
|
1297
1313
|
/**
|
|
1298
1314
|
* Fetch a message by channel + message ID (no channel resolve required).
|
|
1299
1315
|
* Prefer `channel.messages.fetch(messageId)` when you already have a text channel.
|
|
@@ -1336,10 +1352,11 @@ declare class ClientUser extends User {
|
|
|
1336
1352
|
/**
|
|
1337
1353
|
* Guild cache and manager with fetch.
|
|
1338
1354
|
* Extends {@link LimitedCollection} so you can use `.get()`, `.set()`, `.filter()`, etc.
|
|
1339
|
-
*
|
|
1355
|
+
* LRU-evicts (and cascades nested caches) when at the resolved `cache.guilds` limit.
|
|
1340
1356
|
*/
|
|
1341
1357
|
declare class GuildManager extends LimitedCollection<string, Guild> {
|
|
1342
1358
|
private readonly client;
|
|
1359
|
+
private readonly pendingFetches;
|
|
1343
1360
|
constructor(client: Client);
|
|
1344
1361
|
/**
|
|
1345
1362
|
* Remove a guild from cache and cascade its channels / message caches.
|
|
@@ -1348,6 +1365,7 @@ declare class GuildManager extends LimitedCollection<string, Guild> {
|
|
|
1348
1365
|
delete(key: string): boolean;
|
|
1349
1366
|
/**
|
|
1350
1367
|
* Get a guild from cache or fetch from the API if not present.
|
|
1368
|
+
* Partial (metadata-only) cached guilds are hydrated first.
|
|
1351
1369
|
* @param guildId - Snowflake of the guild
|
|
1352
1370
|
* @returns The guild
|
|
1353
1371
|
* @throws FluxerError with GUILD_NOT_FOUND if missing
|
|
@@ -1355,12 +1373,15 @@ declare class GuildManager extends LimitedCollection<string, Guild> {
|
|
|
1355
1373
|
resolve(guildId: string): Promise<Guild>;
|
|
1356
1374
|
/**
|
|
1357
1375
|
* Fetch a guild by ID.
|
|
1358
|
-
* Returns the cached guild unless `force` is set, in which case REST metadata
|
|
1376
|
+
* Returns the cached guild unless `force` is set, in which case REST metadata
|
|
1377
|
+
* is applied via `_patch`. Use {@link resolve} to also hydrate nested caches.
|
|
1359
1378
|
* @throws FluxerError with GUILD_NOT_FOUND if missing
|
|
1360
1379
|
*/
|
|
1361
1380
|
fetch(guildId: string, options?: {
|
|
1362
1381
|
force?: boolean;
|
|
1363
1382
|
}): Promise<Guild>;
|
|
1383
|
+
/** Best-effort nested sync for a metadata-only guild. Failures keep `partial` set. */
|
|
1384
|
+
private hydrate;
|
|
1364
1385
|
}
|
|
1365
1386
|
|
|
1366
1387
|
type MemberPayload = APIGuildMember & {
|
|
@@ -1384,14 +1405,18 @@ interface FetchedUserWithProfile {
|
|
|
1384
1405
|
*/
|
|
1385
1406
|
declare class UserManager extends LimitedCollection<string, User> {
|
|
1386
1407
|
private readonly client;
|
|
1408
|
+
private readonly pendingFetches;
|
|
1387
1409
|
constructor(client: Client);
|
|
1388
1410
|
/** Remove matching users (skips `client.user`). Returns count removed. */
|
|
1389
1411
|
sweep(filter?: (user: User, id: string) => boolean): number;
|
|
1390
|
-
/**
|
|
1412
|
+
/**
|
|
1413
|
+
* Fetch a user by ID and update cache. Returns the cached user unless `force` is set
|
|
1414
|
+
* or the cached entry is only a partial stub (e.g. from a reaction event).
|
|
1415
|
+
*/
|
|
1391
1416
|
fetch(userId: string, options?: {
|
|
1392
1417
|
force?: boolean;
|
|
1393
1418
|
}): Promise<User>;
|
|
1394
|
-
/** Return a cached user, otherwise {@link fetch}. */
|
|
1419
|
+
/** Return a cached (non-partial) user, otherwise {@link fetch}. */
|
|
1395
1420
|
resolve(userId: string): Promise<User>;
|
|
1396
1421
|
/**
|
|
1397
1422
|
* Fetch user + profiles (+ optional guild member). Ideal for userinfo commands.
|
|
@@ -1508,6 +1533,7 @@ declare const Events: {
|
|
|
1508
1533
|
readonly GuildEmojisUpdate: "guildEmojisUpdate";
|
|
1509
1534
|
readonly GuildStickersUpdate: "guildStickersUpdate";
|
|
1510
1535
|
readonly GuildCountsUpdate: "guildCountsUpdate";
|
|
1536
|
+
readonly GuildHealthUpdate: "guildHealthUpdate";
|
|
1511
1537
|
readonly ChannelMemberCountsUpdate: "channelMemberCountsUpdate";
|
|
1512
1538
|
readonly GuildMemberAdd: "guildMemberAdd";
|
|
1513
1539
|
readonly GuildMemberUpdate: "guildMemberUpdate";
|
|
@@ -1542,6 +1568,8 @@ declare const Events: {
|
|
|
1542
1568
|
readonly VoiceStateAck: "voiceStateAck";
|
|
1543
1569
|
readonly VoiceServerUpdate: "voiceServerUpdate";
|
|
1544
1570
|
readonly EntranceSoundPlay: "entranceSoundPlay";
|
|
1571
|
+
readonly VoiceSignal: "voiceSignal";
|
|
1572
|
+
readonly OperatorPassUpdate: "operatorPassUpdate";
|
|
1545
1573
|
readonly VoiceStatesSync: "voiceStatesSync";
|
|
1546
1574
|
readonly WebhooksUpdate: "webhooksUpdate";
|
|
1547
1575
|
readonly Resumed: "resumed";
|
|
@@ -1567,7 +1595,7 @@ interface ResolvedInstance {
|
|
|
1567
1595
|
declare const INSTANCE_DISCOVERY_PATH: "/.well-known/fluxer";
|
|
1568
1596
|
/**
|
|
1569
1597
|
* Absolute unversioned discovery URL for an origin.
|
|
1570
|
-
* Hosted Fluxer: `https://fluxer.
|
|
1598
|
+
* Hosted Fluxer: `https://fluxer.com/.well-known/fluxer` (may 308 to `api_public`).
|
|
1571
1599
|
*/
|
|
1572
1600
|
declare function instanceDiscoveryUrl(origin: string): string;
|
|
1573
1601
|
/** Strip trailing `/vN` and trailing slash from an API origin. */
|
|
@@ -1696,6 +1724,7 @@ declare const DMChannel_base: (abstract new (...args: any[]) => {
|
|
|
1696
1724
|
name: string | null;
|
|
1697
1725
|
icon: string | null;
|
|
1698
1726
|
lastPinTimestamp: string | null;
|
|
1727
|
+
partial: boolean;
|
|
1699
1728
|
get createdTimestamp(): number;
|
|
1700
1729
|
get createdAt(): Date;
|
|
1701
1730
|
_patch(data: APIChannelPartial | APIChannel): void;
|
|
@@ -1876,6 +1905,7 @@ declare const TextChannel_base: (abstract new (...args: any[]) => {
|
|
|
1876
1905
|
name: string | null;
|
|
1877
1906
|
icon: string | null;
|
|
1878
1907
|
lastPinTimestamp: string | null;
|
|
1908
|
+
partial: boolean;
|
|
1879
1909
|
get createdTimestamp(): number;
|
|
1880
1910
|
get createdAt(): Date;
|
|
1881
1911
|
_patch(data: _fluxerjs_types.APIChannelPartial | APIChannel): void;
|
|
@@ -1954,6 +1984,13 @@ declare class TextChannel extends TextChannel_base {
|
|
|
1954
1984
|
* Same fields and slowmode as a text channel. Published messages are copied into channels that follow it.
|
|
1955
1985
|
*/
|
|
1956
1986
|
declare class AnnouncementChannel extends TextChannel {
|
|
1987
|
+
/**
|
|
1988
|
+
* Follow this announcement channel into `webhookChannelId` (a channel in a guild
|
|
1989
|
+
* where the bot can manage webhooks). Published messages are copied there.
|
|
1990
|
+
*/
|
|
1991
|
+
follow(webhookChannelId: string): Promise<_fluxerjs_types.APIFollowedChannel>;
|
|
1992
|
+
/** Fetch follower counts for this announcement channel. */
|
|
1993
|
+
fetchFollowerStats(): Promise<_fluxerjs_types.APIChannelFollowerStats>;
|
|
1957
1994
|
}
|
|
1958
1995
|
/** A category channel (container for organizing channels). */
|
|
1959
1996
|
declare class CategoryChannel extends GuildChannel {
|
|
@@ -1969,6 +2006,7 @@ declare const VoiceChannel_base: (abstract new (...args: any[]) => {
|
|
|
1969
2006
|
name: string | null;
|
|
1970
2007
|
icon: string | null;
|
|
1971
2008
|
lastPinTimestamp: string | null;
|
|
2009
|
+
partial: boolean;
|
|
1972
2010
|
get createdTimestamp(): number;
|
|
1973
2011
|
get createdAt(): Date;
|
|
1974
2012
|
_patch(data: _fluxerjs_types.APIChannelPartial | APIChannel): void;
|
|
@@ -2033,6 +2071,8 @@ declare class VoiceChannel extends VoiceChannel_base {
|
|
|
2033
2071
|
voiceConnectionLimit?: number | null;
|
|
2034
2072
|
/** RTC region override for this channel. */
|
|
2035
2073
|
rtcRegion?: string | null;
|
|
2074
|
+
/** Whether voice in this channel is peer-to-peer (`rtc_p2p`). */
|
|
2075
|
+
rtcP2p?: boolean;
|
|
2036
2076
|
constructor(client: Client, data: APIChannel);
|
|
2037
2077
|
/**
|
|
2038
2078
|
* Set slowmode (seconds between messages). Pass `0` to disable.
|
|
@@ -2139,6 +2179,7 @@ declare const ThreadChannel_base: (abstract new (...args: any[]) => {
|
|
|
2139
2179
|
name: string | null;
|
|
2140
2180
|
icon: string | null;
|
|
2141
2181
|
lastPinTimestamp: string | null;
|
|
2182
|
+
partial: boolean;
|
|
2142
2183
|
get createdTimestamp(): number;
|
|
2143
2184
|
get createdAt(): Date;
|
|
2144
2185
|
_patch(data: _fluxerjs_types.APIChannelPartial | APIChannel): void;
|
|
@@ -2808,6 +2849,10 @@ declare class Message extends Base {
|
|
|
2808
2849
|
startThread(options: StartThreadFromMessageOptions): Promise<ThreadChannel>;
|
|
2809
2850
|
/** Fetch the latest version of this message from the API. */
|
|
2810
2851
|
fetch(): Promise<Message>;
|
|
2852
|
+
/** Publish this announcement message to channels following its channel. */
|
|
2853
|
+
crosspost(): Promise<Message>;
|
|
2854
|
+
/** Fetch the source guild of a crossposted (followed-channel) message. */
|
|
2855
|
+
fetchCrosspostSource(): Promise<_fluxerjs_types.APICrosspostSource>;
|
|
2811
2856
|
/** Delete this message. */
|
|
2812
2857
|
delete(reason?: string): Promise<void>;
|
|
2813
2858
|
/** Delete a specific attachment from this message. */
|
|
@@ -2872,6 +2917,7 @@ declare class MessageManager {
|
|
|
2872
2917
|
private readonly channelId;
|
|
2873
2918
|
/** Structure cache keyed by message id (identity for {@link get}). */
|
|
2874
2919
|
private readonly _structures;
|
|
2920
|
+
private readonly pendingFetches;
|
|
2875
2921
|
constructor(client: Client, channelId: string);
|
|
2876
2922
|
/** Retrieve a cached message by ID, or `undefined` if missing / caching disabled. */
|
|
2877
2923
|
get(messageId: string): Message | undefined;
|
|
@@ -2885,6 +2931,7 @@ declare class MessageManager {
|
|
|
2885
2931
|
private wrap;
|
|
2886
2932
|
/** Fetch a single message from the API. */
|
|
2887
2933
|
private fetchOne;
|
|
2934
|
+
private fetchOneFresh;
|
|
2888
2935
|
/** Fetch multiple messages from the API with pagination/filtering. */
|
|
2889
2936
|
private fetchMany;
|
|
2890
2937
|
}
|
|
@@ -2909,6 +2956,11 @@ declare abstract class Channel extends Base {
|
|
|
2909
2956
|
icon: string | null;
|
|
2910
2957
|
/** ISO8601 timestamp of the last pinned message update. */
|
|
2911
2958
|
lastPinTimestamp: string | null;
|
|
2959
|
+
/**
|
|
2960
|
+
* True when built from a partial payload (e.g. a DM stub) and not yet hydrated
|
|
2961
|
+
* with a full channel object. `channels.resolve()` refetches partial channels.
|
|
2962
|
+
*/
|
|
2963
|
+
partial: boolean;
|
|
2912
2964
|
constructor(client: Client, data: APIChannelPartial);
|
|
2913
2965
|
/** Unix timestamp (ms) when this channel was created, derived from its snowflake ID. */
|
|
2914
2966
|
get createdTimestamp(): number;
|
|
@@ -3191,6 +3243,9 @@ interface ClientEvents {
|
|
|
3191
3243
|
[Events.VoiceStateAck]: [data: GatewayVoiceStateAckDispatchData];
|
|
3192
3244
|
[Events.VoiceServerUpdate]: [data: GatewayVoiceServerUpdateDispatchData];
|
|
3193
3245
|
[Events.EntranceSoundPlay]: [data: GatewayEntranceSoundPlayDispatchData];
|
|
3246
|
+
[Events.VoiceSignal]: [data: GatewayVoiceSignalDispatchData];
|
|
3247
|
+
[Events.GuildHealthUpdate]: [data: GatewayGuildHealthUpdateDispatchData];
|
|
3248
|
+
[Events.OperatorPassUpdate]: [data: GatewayOperatorPassUpdateDispatchData];
|
|
3194
3249
|
[Events.VoiceStatesSync]: [data: GatewayVoiceStatesSyncData];
|
|
3195
3250
|
[Events.MessageDeleteBulk]: [payload: MessageDeleteBulkPayload];
|
|
3196
3251
|
[Events.GuildBanAdd]: [ban: GuildBan];
|
|
@@ -3304,7 +3359,7 @@ declare class Client extends EventEmitter {
|
|
|
3304
3359
|
* Wires REST from `endpoints.api_public`. `endpoints.api` / `api_client` stay on the instance for inspection.
|
|
3305
3360
|
* Does not log in. Call {@link login} with a token afterward.
|
|
3306
3361
|
*
|
|
3307
|
-
* @param origin - Origin used only to fetch discovery (e.g. `https://fluxer.
|
|
3362
|
+
* @param origin - Origin used only to fetch discovery (e.g. `https://fluxer.com` or `https://my.instance`)
|
|
3308
3363
|
* @param options - Client options (must not conflict with discovered `endpoints.api_public`)
|
|
3309
3364
|
* @param connectOptions - Optional abort signal for the discovery request
|
|
3310
3365
|
*/
|
|
@@ -3356,6 +3411,27 @@ declare class Client extends EventEmitter {
|
|
|
3356
3411
|
* @returns Sticker metadata (name, pack, tags, etc.)
|
|
3357
3412
|
*/
|
|
3358
3413
|
fetchStickerMetadata(stickerId: string): Promise<APIStickerMetadata>;
|
|
3414
|
+
/** Fetch the source guild of a custom emoji. */
|
|
3415
|
+
fetchEmojiSource(emojiId: string): Promise<_fluxerjs_types.APIExpressionSourceGuild>;
|
|
3416
|
+
/** Fetch the source guild of a custom sticker. */
|
|
3417
|
+
fetchStickerSource(stickerId: string): Promise<_fluxerjs_types.APIExpressionSourceGuild>;
|
|
3418
|
+
/** List discovery categories. */
|
|
3419
|
+
fetchDiscoveryCategories(): Promise<_fluxerjs_types.APIDiscoveryCategory[]>;
|
|
3420
|
+
/** Search discoverable guilds. */
|
|
3421
|
+
searchDiscoveryGuilds(options?: _fluxerjs_types.APIDiscoveryGuildSearchOptions): Promise<_fluxerjs_types.APIDiscoveryGuildList>;
|
|
3422
|
+
/** Fetch experiment assignments for this account. */
|
|
3423
|
+
fetchExperiments(): Promise<_fluxerjs_types.APIExperimentAssignments>;
|
|
3424
|
+
/** Refresh expiring attachment CDN URLs. */
|
|
3425
|
+
refreshAttachmentUrls(attachmentUrls: string[]): Promise<_fluxerjs_types.APIRefreshAttachmentUrlsResponse>;
|
|
3426
|
+
/** List instance custom guild badges (`GET /instance/badges`). */
|
|
3427
|
+
fetchInstanceBadges(options?: {
|
|
3428
|
+
ids?: string;
|
|
3429
|
+
after?: string;
|
|
3430
|
+
limit?: number;
|
|
3431
|
+
version?: string;
|
|
3432
|
+
}): Promise<_fluxerjs_types.APIInstanceBadges>;
|
|
3433
|
+
/** Fetch forum/media thread post data for a channel. */
|
|
3434
|
+
fetchChannelPostData(channelId: string, threadIds: string[]): Promise<_fluxerjs_types.APIThreadPostDataResponse>;
|
|
3359
3435
|
/**
|
|
3360
3436
|
* Fetch the current application (`/applications/@me`).
|
|
3361
3437
|
* @returns Application metadata (owner, flags, RPC origins, etc.)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _fluxerjs_types from '@fluxerjs/types';
|
|
2
|
-
import { APIGuild, APIRole, SystemChannelFlagsValue, DefaultMessageNotifications, GuildVerificationLevel, GuildMFALevel, GuildExplicitContentFilter, SplashCardAlignment, GuildNSFWLevel, ContentWarningLevel, GuildFeature, EmbedType, ChannelType, APIChannel, APIUserPartial, APIBan, APIEmoji, APISticker, InviteType, APIInvite, WebhookType, APIWebhook, RESTPostAPIEmbed, AuditLogActionType, APIInstanceEndpoints, APIInstance, APIGuildMember, APIMessageReaction, APIMessageSticker, MessageType, APIChannelPartial, OverwriteType, APIChannelOverwrite, APIForumTag, APIDefaultReactionEmoji, ForumSortOrder, ForumTagSetting, ForumLayout, APIThreadMember, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, APIMessage, GatewayVoiceStateUpdateDispatchData, GatewayVoiceStateAckDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayEntranceSoundPlayDispatchData, GatewayVoiceStatesSyncData, GatewayUserConnectionsUpdateDispatchData, GatewayWebAuthnCredentialsUpdateDispatchData, GatewayReceivePayload, APIGatewayBotResponse, APIEmojiMetadata, APIStickerMetadata, APIApplicationMe, APIOAuthApplication, APIPreloadMessagesResponse, APIBulkMessageFetchResponse, GatewaySendPayload, Routes } from '@fluxerjs/types';
|
|
2
|
+
import { APIGuild, APIRole, SystemChannelFlagsValue, DefaultMessageNotifications, GuildVerificationLevel, GuildMFALevel, GuildExplicitContentFilter, SplashCardAlignment, GuildNSFWLevel, ContentWarningLevel, GuildFeature, EmbedType, ChannelType, APIChannel, APIUserPartial, APIBan, APIEmoji, APISticker, InviteType, APIInvite, WebhookType, APIWebhook, RESTPostAPIEmbed, AuditLogActionType, APIInstanceEndpoints, APIInstance, APIGuildMember, APIMessageReaction, APIMessageSticker, MessageType, APIChannelPartial, OverwriteType, APIChannelOverwrite, APIForumTag, APIDefaultReactionEmoji, ForumSortOrder, ForumTagSetting, ForumLayout, APIThreadMember, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, APIMessage, GatewayVoiceStateUpdateDispatchData, GatewayVoiceStateAckDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayEntranceSoundPlayDispatchData, GatewayVoiceSignalDispatchData, GatewayGuildHealthUpdateDispatchData, GatewayOperatorPassUpdateDispatchData, GatewayVoiceStatesSyncData, GatewayUserConnectionsUpdateDispatchData, GatewayWebAuthnCredentialsUpdateDispatchData, GatewayReceivePayload, APIGatewayBotResponse, APIEmojiMetadata, APIStickerMetadata, APIApplicationMe, APIOAuthApplication, APIPreloadMessagesResponse, APIBulkMessageFetchResponse, GatewaySendPayload, Routes } from '@fluxerjs/types';
|
|
3
3
|
import * as _fluxerjs_collection from '@fluxerjs/collection';
|
|
4
4
|
import { LimitedCollection, Collection } from '@fluxerjs/collection';
|
|
5
5
|
import { PermissionsBitField, LogLevel, Logger, MessageFlagsResolvable, PermissionResolvable, MessageFlagsBitField } from '@fluxerjs/util';
|
|
@@ -173,6 +173,7 @@ interface FetchGuildMembersOptions {
|
|
|
173
173
|
*/
|
|
174
174
|
declare class GuildMemberManager extends LimitedCollection<string, GuildMember> {
|
|
175
175
|
private readonly guild;
|
|
176
|
+
private readonly pendingFetches;
|
|
176
177
|
constructor(guild: Guild);
|
|
177
178
|
/**
|
|
178
179
|
* Get a guild member from cache or fetch from the API if not present.
|
|
@@ -313,6 +314,8 @@ declare class User extends Base {
|
|
|
313
314
|
readonly system: boolean;
|
|
314
315
|
/** Banner hash for profile. */
|
|
315
316
|
banner: string | null;
|
|
317
|
+
/** True when this user was created from an ID-only stub and not yet hydrated from REST/gateway. */
|
|
318
|
+
partial: boolean;
|
|
316
319
|
constructor(client: Client, data: APIUserPartial & {
|
|
317
320
|
banner?: string | null;
|
|
318
321
|
});
|
|
@@ -320,6 +323,8 @@ declare class User extends Base {
|
|
|
320
323
|
_patch(data: APIUserPartial & {
|
|
321
324
|
banner?: string | null;
|
|
322
325
|
}): void;
|
|
326
|
+
/** Fetch the full user from REST when this instance is a partial stub. */
|
|
327
|
+
fetch(): Promise<User>;
|
|
323
328
|
private cdnOpts;
|
|
324
329
|
/**
|
|
325
330
|
* User avatar CDN URL (null if no custom avatar set).
|
|
@@ -453,6 +458,8 @@ declare class Role extends Base {
|
|
|
453
458
|
mentionable: boolean;
|
|
454
459
|
/** Unicode emoji for this role (null = none). */
|
|
455
460
|
unicodeEmoji: string | null;
|
|
461
|
+
/** Role icon image hash (null = none). */
|
|
462
|
+
icon: string | null;
|
|
456
463
|
/** Hoist position (null = not hoisted). */
|
|
457
464
|
hoistPosition: number | null;
|
|
458
465
|
constructor(client: Client, data: APIRole, guildId: string);
|
|
@@ -739,6 +746,11 @@ declare class Guild extends Base {
|
|
|
739
746
|
readonly id: string;
|
|
740
747
|
/** Whether the guild is currently available through the gateway. */
|
|
741
748
|
available: boolean;
|
|
749
|
+
/**
|
|
750
|
+
* True when only guild metadata is known (e.g. created from `GET /guilds/{id}`)
|
|
751
|
+
* and nested channels/roles have not been synced yet. `guilds.resolve()` hydrates partial guilds.
|
|
752
|
+
*/
|
|
753
|
+
partial: boolean;
|
|
742
754
|
/** Guild name. */
|
|
743
755
|
name: string;
|
|
744
756
|
/** Icon hash (use {@link iconURL} to get full CDN URL). */
|
|
@@ -888,6 +900,8 @@ declare class Guild extends Base {
|
|
|
888
900
|
resetRoleHoistPositions(): Promise<Role[]>;
|
|
889
901
|
/** Ban a user from the guild. Requires Ban Members. `banDurationSeconds`: 0 = permanent. */
|
|
890
902
|
ban(userId: string, options?: GuildBanOptions): Promise<void>;
|
|
903
|
+
/** Fetch a single ban by user ID. Requires Ban Members. */
|
|
904
|
+
fetchBan(userId: string): Promise<GuildBan>;
|
|
891
905
|
/** Fetch all bans in this guild. Requires Ban Members. */
|
|
892
906
|
fetchBans(): Promise<GuildBan[]>;
|
|
893
907
|
/** Unban a user from the guild. Requires Ban Members. */
|
|
@@ -973,7 +987,7 @@ declare class Guild extends Base {
|
|
|
973
987
|
}
|
|
974
988
|
|
|
975
989
|
/**
|
|
976
|
-
* Optional cache size limits (
|
|
990
|
+
* Optional cache size limits (LRU eviction when exceeded).
|
|
977
991
|
*
|
|
978
992
|
* | Value | Meaning |
|
|
979
993
|
* |-------|---------|
|
|
@@ -1269,17 +1283,18 @@ declare class CacheController {
|
|
|
1269
1283
|
/**
|
|
1270
1284
|
* Channel cache + fetch/send helpers.
|
|
1271
1285
|
* Extends {@link LimitedCollection} (`.get()`, `.set()`, `.filter()`, …).
|
|
1272
|
-
*
|
|
1286
|
+
* LRU-evicts (and keeps guild indexes / message caches aligned) at `cache.channels`.
|
|
1273
1287
|
*/
|
|
1274
1288
|
declare class ChannelManager extends LimitedCollection<string, Channel> {
|
|
1275
1289
|
private readonly client;
|
|
1290
|
+
private readonly pendingFetches;
|
|
1276
1291
|
constructor(client: Client);
|
|
1277
1292
|
/**
|
|
1278
1293
|
* Remove a channel from cache. Does not delete it on the API.
|
|
1279
1294
|
* Use {@link Channel.delete} after {@link fetch} to delete the channel.
|
|
1280
1295
|
*/
|
|
1281
1296
|
delete(key: string): boolean;
|
|
1282
|
-
/** Retrieve from cache, otherwise {@link fetch}. */
|
|
1297
|
+
/** Retrieve from cache (hydrating partial stubs), otherwise {@link fetch}. */
|
|
1283
1298
|
resolve(channelId: string): Promise<Channel>;
|
|
1284
1299
|
/**
|
|
1285
1300
|
* Fetch a channel by ID. The returned {@link Channel} has {@link Channel.delete}
|
|
@@ -1294,6 +1309,7 @@ declare class ChannelManager extends LimitedCollection<string, Channel> {
|
|
|
1294
1309
|
fetch(channelId: string, options?: {
|
|
1295
1310
|
force?: boolean;
|
|
1296
1311
|
}): Promise<Channel>;
|
|
1312
|
+
private fetchFresh;
|
|
1297
1313
|
/**
|
|
1298
1314
|
* Fetch a message by channel + message ID (no channel resolve required).
|
|
1299
1315
|
* Prefer `channel.messages.fetch(messageId)` when you already have a text channel.
|
|
@@ -1336,10 +1352,11 @@ declare class ClientUser extends User {
|
|
|
1336
1352
|
/**
|
|
1337
1353
|
* Guild cache and manager with fetch.
|
|
1338
1354
|
* Extends {@link LimitedCollection} so you can use `.get()`, `.set()`, `.filter()`, etc.
|
|
1339
|
-
*
|
|
1355
|
+
* LRU-evicts (and cascades nested caches) when at the resolved `cache.guilds` limit.
|
|
1340
1356
|
*/
|
|
1341
1357
|
declare class GuildManager extends LimitedCollection<string, Guild> {
|
|
1342
1358
|
private readonly client;
|
|
1359
|
+
private readonly pendingFetches;
|
|
1343
1360
|
constructor(client: Client);
|
|
1344
1361
|
/**
|
|
1345
1362
|
* Remove a guild from cache and cascade its channels / message caches.
|
|
@@ -1348,6 +1365,7 @@ declare class GuildManager extends LimitedCollection<string, Guild> {
|
|
|
1348
1365
|
delete(key: string): boolean;
|
|
1349
1366
|
/**
|
|
1350
1367
|
* Get a guild from cache or fetch from the API if not present.
|
|
1368
|
+
* Partial (metadata-only) cached guilds are hydrated first.
|
|
1351
1369
|
* @param guildId - Snowflake of the guild
|
|
1352
1370
|
* @returns The guild
|
|
1353
1371
|
* @throws FluxerError with GUILD_NOT_FOUND if missing
|
|
@@ -1355,12 +1373,15 @@ declare class GuildManager extends LimitedCollection<string, Guild> {
|
|
|
1355
1373
|
resolve(guildId: string): Promise<Guild>;
|
|
1356
1374
|
/**
|
|
1357
1375
|
* Fetch a guild by ID.
|
|
1358
|
-
* Returns the cached guild unless `force` is set, in which case REST metadata
|
|
1376
|
+
* Returns the cached guild unless `force` is set, in which case REST metadata
|
|
1377
|
+
* is applied via `_patch`. Use {@link resolve} to also hydrate nested caches.
|
|
1359
1378
|
* @throws FluxerError with GUILD_NOT_FOUND if missing
|
|
1360
1379
|
*/
|
|
1361
1380
|
fetch(guildId: string, options?: {
|
|
1362
1381
|
force?: boolean;
|
|
1363
1382
|
}): Promise<Guild>;
|
|
1383
|
+
/** Best-effort nested sync for a metadata-only guild. Failures keep `partial` set. */
|
|
1384
|
+
private hydrate;
|
|
1364
1385
|
}
|
|
1365
1386
|
|
|
1366
1387
|
type MemberPayload = APIGuildMember & {
|
|
@@ -1384,14 +1405,18 @@ interface FetchedUserWithProfile {
|
|
|
1384
1405
|
*/
|
|
1385
1406
|
declare class UserManager extends LimitedCollection<string, User> {
|
|
1386
1407
|
private readonly client;
|
|
1408
|
+
private readonly pendingFetches;
|
|
1387
1409
|
constructor(client: Client);
|
|
1388
1410
|
/** Remove matching users (skips `client.user`). Returns count removed. */
|
|
1389
1411
|
sweep(filter?: (user: User, id: string) => boolean): number;
|
|
1390
|
-
/**
|
|
1412
|
+
/**
|
|
1413
|
+
* Fetch a user by ID and update cache. Returns the cached user unless `force` is set
|
|
1414
|
+
* or the cached entry is only a partial stub (e.g. from a reaction event).
|
|
1415
|
+
*/
|
|
1391
1416
|
fetch(userId: string, options?: {
|
|
1392
1417
|
force?: boolean;
|
|
1393
1418
|
}): Promise<User>;
|
|
1394
|
-
/** Return a cached user, otherwise {@link fetch}. */
|
|
1419
|
+
/** Return a cached (non-partial) user, otherwise {@link fetch}. */
|
|
1395
1420
|
resolve(userId: string): Promise<User>;
|
|
1396
1421
|
/**
|
|
1397
1422
|
* Fetch user + profiles (+ optional guild member). Ideal for userinfo commands.
|
|
@@ -1508,6 +1533,7 @@ declare const Events: {
|
|
|
1508
1533
|
readonly GuildEmojisUpdate: "guildEmojisUpdate";
|
|
1509
1534
|
readonly GuildStickersUpdate: "guildStickersUpdate";
|
|
1510
1535
|
readonly GuildCountsUpdate: "guildCountsUpdate";
|
|
1536
|
+
readonly GuildHealthUpdate: "guildHealthUpdate";
|
|
1511
1537
|
readonly ChannelMemberCountsUpdate: "channelMemberCountsUpdate";
|
|
1512
1538
|
readonly GuildMemberAdd: "guildMemberAdd";
|
|
1513
1539
|
readonly GuildMemberUpdate: "guildMemberUpdate";
|
|
@@ -1542,6 +1568,8 @@ declare const Events: {
|
|
|
1542
1568
|
readonly VoiceStateAck: "voiceStateAck";
|
|
1543
1569
|
readonly VoiceServerUpdate: "voiceServerUpdate";
|
|
1544
1570
|
readonly EntranceSoundPlay: "entranceSoundPlay";
|
|
1571
|
+
readonly VoiceSignal: "voiceSignal";
|
|
1572
|
+
readonly OperatorPassUpdate: "operatorPassUpdate";
|
|
1545
1573
|
readonly VoiceStatesSync: "voiceStatesSync";
|
|
1546
1574
|
readonly WebhooksUpdate: "webhooksUpdate";
|
|
1547
1575
|
readonly Resumed: "resumed";
|
|
@@ -1567,7 +1595,7 @@ interface ResolvedInstance {
|
|
|
1567
1595
|
declare const INSTANCE_DISCOVERY_PATH: "/.well-known/fluxer";
|
|
1568
1596
|
/**
|
|
1569
1597
|
* Absolute unversioned discovery URL for an origin.
|
|
1570
|
-
* Hosted Fluxer: `https://fluxer.
|
|
1598
|
+
* Hosted Fluxer: `https://fluxer.com/.well-known/fluxer` (may 308 to `api_public`).
|
|
1571
1599
|
*/
|
|
1572
1600
|
declare function instanceDiscoveryUrl(origin: string): string;
|
|
1573
1601
|
/** Strip trailing `/vN` and trailing slash from an API origin. */
|
|
@@ -1696,6 +1724,7 @@ declare const DMChannel_base: (abstract new (...args: any[]) => {
|
|
|
1696
1724
|
name: string | null;
|
|
1697
1725
|
icon: string | null;
|
|
1698
1726
|
lastPinTimestamp: string | null;
|
|
1727
|
+
partial: boolean;
|
|
1699
1728
|
get createdTimestamp(): number;
|
|
1700
1729
|
get createdAt(): Date;
|
|
1701
1730
|
_patch(data: APIChannelPartial | APIChannel): void;
|
|
@@ -1876,6 +1905,7 @@ declare const TextChannel_base: (abstract new (...args: any[]) => {
|
|
|
1876
1905
|
name: string | null;
|
|
1877
1906
|
icon: string | null;
|
|
1878
1907
|
lastPinTimestamp: string | null;
|
|
1908
|
+
partial: boolean;
|
|
1879
1909
|
get createdTimestamp(): number;
|
|
1880
1910
|
get createdAt(): Date;
|
|
1881
1911
|
_patch(data: _fluxerjs_types.APIChannelPartial | APIChannel): void;
|
|
@@ -1954,6 +1984,13 @@ declare class TextChannel extends TextChannel_base {
|
|
|
1954
1984
|
* Same fields and slowmode as a text channel. Published messages are copied into channels that follow it.
|
|
1955
1985
|
*/
|
|
1956
1986
|
declare class AnnouncementChannel extends TextChannel {
|
|
1987
|
+
/**
|
|
1988
|
+
* Follow this announcement channel into `webhookChannelId` (a channel in a guild
|
|
1989
|
+
* where the bot can manage webhooks). Published messages are copied there.
|
|
1990
|
+
*/
|
|
1991
|
+
follow(webhookChannelId: string): Promise<_fluxerjs_types.APIFollowedChannel>;
|
|
1992
|
+
/** Fetch follower counts for this announcement channel. */
|
|
1993
|
+
fetchFollowerStats(): Promise<_fluxerjs_types.APIChannelFollowerStats>;
|
|
1957
1994
|
}
|
|
1958
1995
|
/** A category channel (container for organizing channels). */
|
|
1959
1996
|
declare class CategoryChannel extends GuildChannel {
|
|
@@ -1969,6 +2006,7 @@ declare const VoiceChannel_base: (abstract new (...args: any[]) => {
|
|
|
1969
2006
|
name: string | null;
|
|
1970
2007
|
icon: string | null;
|
|
1971
2008
|
lastPinTimestamp: string | null;
|
|
2009
|
+
partial: boolean;
|
|
1972
2010
|
get createdTimestamp(): number;
|
|
1973
2011
|
get createdAt(): Date;
|
|
1974
2012
|
_patch(data: _fluxerjs_types.APIChannelPartial | APIChannel): void;
|
|
@@ -2033,6 +2071,8 @@ declare class VoiceChannel extends VoiceChannel_base {
|
|
|
2033
2071
|
voiceConnectionLimit?: number | null;
|
|
2034
2072
|
/** RTC region override for this channel. */
|
|
2035
2073
|
rtcRegion?: string | null;
|
|
2074
|
+
/** Whether voice in this channel is peer-to-peer (`rtc_p2p`). */
|
|
2075
|
+
rtcP2p?: boolean;
|
|
2036
2076
|
constructor(client: Client, data: APIChannel);
|
|
2037
2077
|
/**
|
|
2038
2078
|
* Set slowmode (seconds between messages). Pass `0` to disable.
|
|
@@ -2139,6 +2179,7 @@ declare const ThreadChannel_base: (abstract new (...args: any[]) => {
|
|
|
2139
2179
|
name: string | null;
|
|
2140
2180
|
icon: string | null;
|
|
2141
2181
|
lastPinTimestamp: string | null;
|
|
2182
|
+
partial: boolean;
|
|
2142
2183
|
get createdTimestamp(): number;
|
|
2143
2184
|
get createdAt(): Date;
|
|
2144
2185
|
_patch(data: _fluxerjs_types.APIChannelPartial | APIChannel): void;
|
|
@@ -2808,6 +2849,10 @@ declare class Message extends Base {
|
|
|
2808
2849
|
startThread(options: StartThreadFromMessageOptions): Promise<ThreadChannel>;
|
|
2809
2850
|
/** Fetch the latest version of this message from the API. */
|
|
2810
2851
|
fetch(): Promise<Message>;
|
|
2852
|
+
/** Publish this announcement message to channels following its channel. */
|
|
2853
|
+
crosspost(): Promise<Message>;
|
|
2854
|
+
/** Fetch the source guild of a crossposted (followed-channel) message. */
|
|
2855
|
+
fetchCrosspostSource(): Promise<_fluxerjs_types.APICrosspostSource>;
|
|
2811
2856
|
/** Delete this message. */
|
|
2812
2857
|
delete(reason?: string): Promise<void>;
|
|
2813
2858
|
/** Delete a specific attachment from this message. */
|
|
@@ -2872,6 +2917,7 @@ declare class MessageManager {
|
|
|
2872
2917
|
private readonly channelId;
|
|
2873
2918
|
/** Structure cache keyed by message id (identity for {@link get}). */
|
|
2874
2919
|
private readonly _structures;
|
|
2920
|
+
private readonly pendingFetches;
|
|
2875
2921
|
constructor(client: Client, channelId: string);
|
|
2876
2922
|
/** Retrieve a cached message by ID, or `undefined` if missing / caching disabled. */
|
|
2877
2923
|
get(messageId: string): Message | undefined;
|
|
@@ -2885,6 +2931,7 @@ declare class MessageManager {
|
|
|
2885
2931
|
private wrap;
|
|
2886
2932
|
/** Fetch a single message from the API. */
|
|
2887
2933
|
private fetchOne;
|
|
2934
|
+
private fetchOneFresh;
|
|
2888
2935
|
/** Fetch multiple messages from the API with pagination/filtering. */
|
|
2889
2936
|
private fetchMany;
|
|
2890
2937
|
}
|
|
@@ -2909,6 +2956,11 @@ declare abstract class Channel extends Base {
|
|
|
2909
2956
|
icon: string | null;
|
|
2910
2957
|
/** ISO8601 timestamp of the last pinned message update. */
|
|
2911
2958
|
lastPinTimestamp: string | null;
|
|
2959
|
+
/**
|
|
2960
|
+
* True when built from a partial payload (e.g. a DM stub) and not yet hydrated
|
|
2961
|
+
* with a full channel object. `channels.resolve()` refetches partial channels.
|
|
2962
|
+
*/
|
|
2963
|
+
partial: boolean;
|
|
2912
2964
|
constructor(client: Client, data: APIChannelPartial);
|
|
2913
2965
|
/** Unix timestamp (ms) when this channel was created, derived from its snowflake ID. */
|
|
2914
2966
|
get createdTimestamp(): number;
|
|
@@ -3191,6 +3243,9 @@ interface ClientEvents {
|
|
|
3191
3243
|
[Events.VoiceStateAck]: [data: GatewayVoiceStateAckDispatchData];
|
|
3192
3244
|
[Events.VoiceServerUpdate]: [data: GatewayVoiceServerUpdateDispatchData];
|
|
3193
3245
|
[Events.EntranceSoundPlay]: [data: GatewayEntranceSoundPlayDispatchData];
|
|
3246
|
+
[Events.VoiceSignal]: [data: GatewayVoiceSignalDispatchData];
|
|
3247
|
+
[Events.GuildHealthUpdate]: [data: GatewayGuildHealthUpdateDispatchData];
|
|
3248
|
+
[Events.OperatorPassUpdate]: [data: GatewayOperatorPassUpdateDispatchData];
|
|
3194
3249
|
[Events.VoiceStatesSync]: [data: GatewayVoiceStatesSyncData];
|
|
3195
3250
|
[Events.MessageDeleteBulk]: [payload: MessageDeleteBulkPayload];
|
|
3196
3251
|
[Events.GuildBanAdd]: [ban: GuildBan];
|
|
@@ -3304,7 +3359,7 @@ declare class Client extends EventEmitter {
|
|
|
3304
3359
|
* Wires REST from `endpoints.api_public`. `endpoints.api` / `api_client` stay on the instance for inspection.
|
|
3305
3360
|
* Does not log in. Call {@link login} with a token afterward.
|
|
3306
3361
|
*
|
|
3307
|
-
* @param origin - Origin used only to fetch discovery (e.g. `https://fluxer.
|
|
3362
|
+
* @param origin - Origin used only to fetch discovery (e.g. `https://fluxer.com` or `https://my.instance`)
|
|
3308
3363
|
* @param options - Client options (must not conflict with discovered `endpoints.api_public`)
|
|
3309
3364
|
* @param connectOptions - Optional abort signal for the discovery request
|
|
3310
3365
|
*/
|
|
@@ -3356,6 +3411,27 @@ declare class Client extends EventEmitter {
|
|
|
3356
3411
|
* @returns Sticker metadata (name, pack, tags, etc.)
|
|
3357
3412
|
*/
|
|
3358
3413
|
fetchStickerMetadata(stickerId: string): Promise<APIStickerMetadata>;
|
|
3414
|
+
/** Fetch the source guild of a custom emoji. */
|
|
3415
|
+
fetchEmojiSource(emojiId: string): Promise<_fluxerjs_types.APIExpressionSourceGuild>;
|
|
3416
|
+
/** Fetch the source guild of a custom sticker. */
|
|
3417
|
+
fetchStickerSource(stickerId: string): Promise<_fluxerjs_types.APIExpressionSourceGuild>;
|
|
3418
|
+
/** List discovery categories. */
|
|
3419
|
+
fetchDiscoveryCategories(): Promise<_fluxerjs_types.APIDiscoveryCategory[]>;
|
|
3420
|
+
/** Search discoverable guilds. */
|
|
3421
|
+
searchDiscoveryGuilds(options?: _fluxerjs_types.APIDiscoveryGuildSearchOptions): Promise<_fluxerjs_types.APIDiscoveryGuildList>;
|
|
3422
|
+
/** Fetch experiment assignments for this account. */
|
|
3423
|
+
fetchExperiments(): Promise<_fluxerjs_types.APIExperimentAssignments>;
|
|
3424
|
+
/** Refresh expiring attachment CDN URLs. */
|
|
3425
|
+
refreshAttachmentUrls(attachmentUrls: string[]): Promise<_fluxerjs_types.APIRefreshAttachmentUrlsResponse>;
|
|
3426
|
+
/** List instance custom guild badges (`GET /instance/badges`). */
|
|
3427
|
+
fetchInstanceBadges(options?: {
|
|
3428
|
+
ids?: string;
|
|
3429
|
+
after?: string;
|
|
3430
|
+
limit?: number;
|
|
3431
|
+
version?: string;
|
|
3432
|
+
}): Promise<_fluxerjs_types.APIInstanceBadges>;
|
|
3433
|
+
/** Fetch forum/media thread post data for a channel. */
|
|
3434
|
+
fetchChannelPostData(channelId: string, threadIds: string[]): Promise<_fluxerjs_types.APIThreadPostDataResponse>;
|
|
3359
3435
|
/**
|
|
3360
3436
|
* Fetch the current application (`/applications/@me`).
|
|
3361
3437
|
* @returns Application metadata (owner, flags, RPC origins, etc.)
|
package/dist/client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as AuditLogChange, b as AuditLogEntryPayload, g as CacheSizeLimits, l as ChannelMemberCountsUpdatePayload, m as ChannelPinsUpdatePayload, n as ChannelRecipientPayload, o as Client, p as ClientEventListener, q as ClientEventMethods, r as ClientEventName, s as ClientEvents, t as ClientOptions, E as Events, O as GuildCountsUpdatePayload, Q as GuildEmojisUpdatePayload, X as GuildMembersChunkPayload, Y as GuildRoleDeletePayload, _ as GuildRoleUpdatePayload, a0 as GuildStickersUpdatePayload, a4 as InviteDeletePayload, ae as MessageDeleteBulkPayload, an as MessageReactionAddManyEntry, ao as MessageReactionAddManyPayload, aq as MessageReactionPayload, ar as MessageReactionRemoveAllPayload, as as MessageReactionRemoveEmojiPayload, aD as PresenceActivity, aE as PresenceUpdateBulkPayload, aF as PresenceUpdatePayload, aJ as ReactionEmojiPayload, a_ as TypingStartPayload, b8 as WebhooksUpdatePayload } from './SubpathMessage-
|
|
1
|
+
export { a as AuditLogChange, b as AuditLogEntryPayload, g as CacheSizeLimits, l as ChannelMemberCountsUpdatePayload, m as ChannelPinsUpdatePayload, n as ChannelRecipientPayload, o as Client, p as ClientEventListener, q as ClientEventMethods, r as ClientEventName, s as ClientEvents, t as ClientOptions, E as Events, O as GuildCountsUpdatePayload, Q as GuildEmojisUpdatePayload, X as GuildMembersChunkPayload, Y as GuildRoleDeletePayload, _ as GuildRoleUpdatePayload, a0 as GuildStickersUpdatePayload, a4 as InviteDeletePayload, ae as MessageDeleteBulkPayload, an as MessageReactionAddManyEntry, ao as MessageReactionAddManyPayload, aq as MessageReactionPayload, ar as MessageReactionRemoveAllPayload, as as MessageReactionRemoveEmojiPayload, aD as PresenceActivity, aE as PresenceUpdateBulkPayload, aF as PresenceUpdatePayload, aJ as ReactionEmojiPayload, a_ as TypingStartPayload, b8 as WebhooksUpdatePayload } from './SubpathMessage-BAwFSagN.mjs';
|
|
2
2
|
import '@fluxerjs/types';
|
|
3
3
|
import '@fluxerjs/collection';
|
|
4
4
|
import '@fluxerjs/util';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as AuditLogChange, b as AuditLogEntryPayload, g as CacheSizeLimits, l as ChannelMemberCountsUpdatePayload, m as ChannelPinsUpdatePayload, n as ChannelRecipientPayload, o as Client, p as ClientEventListener, q as ClientEventMethods, r as ClientEventName, s as ClientEvents, t as ClientOptions, E as Events, O as GuildCountsUpdatePayload, Q as GuildEmojisUpdatePayload, X as GuildMembersChunkPayload, Y as GuildRoleDeletePayload, _ as GuildRoleUpdatePayload, a0 as GuildStickersUpdatePayload, a4 as InviteDeletePayload, ae as MessageDeleteBulkPayload, an as MessageReactionAddManyEntry, ao as MessageReactionAddManyPayload, aq as MessageReactionPayload, ar as MessageReactionRemoveAllPayload, as as MessageReactionRemoveEmojiPayload, aD as PresenceActivity, aE as PresenceUpdateBulkPayload, aF as PresenceUpdatePayload, aJ as ReactionEmojiPayload, a_ as TypingStartPayload, b8 as WebhooksUpdatePayload } from './SubpathMessage-
|
|
1
|
+
export { a as AuditLogChange, b as AuditLogEntryPayload, g as CacheSizeLimits, l as ChannelMemberCountsUpdatePayload, m as ChannelPinsUpdatePayload, n as ChannelRecipientPayload, o as Client, p as ClientEventListener, q as ClientEventMethods, r as ClientEventName, s as ClientEvents, t as ClientOptions, E as Events, O as GuildCountsUpdatePayload, Q as GuildEmojisUpdatePayload, X as GuildMembersChunkPayload, Y as GuildRoleDeletePayload, _ as GuildRoleUpdatePayload, a0 as GuildStickersUpdatePayload, a4 as InviteDeletePayload, ae as MessageDeleteBulkPayload, an as MessageReactionAddManyEntry, ao as MessageReactionAddManyPayload, aq as MessageReactionPayload, ar as MessageReactionRemoveAllPayload, as as MessageReactionRemoveEmojiPayload, aD as PresenceActivity, aE as PresenceUpdateBulkPayload, aF as PresenceUpdatePayload, aJ as ReactionEmojiPayload, a_ as TypingStartPayload, b8 as WebhooksUpdatePayload } from './SubpathMessage-Dq-1tI7E.js';
|
|
2
2
|
import '@fluxerjs/types';
|
|
3
3
|
import '@fluxerjs/collection';
|
|
4
4
|
import '@fluxerjs/util';
|