@fluxerjs/core 3.0.0 → 3.2.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-CjQBbVmb.d.mts → SubpathMessage-DHo7ltTz.d.ts} +78 -24
- package/dist/{SubpathMessage-DNlKq2Nj.d.ts → SubpathMessage-DW9TgPNl.d.mts} +78 -24
- package/dist/{Sudo-CFfbmis3.d.mts → Sudo-DwxTf-jj.d.mts} +14 -1
- package/dist/{Sudo-CFfbmis3.d.ts → Sudo-DwxTf-jj.d.ts} +14 -1
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +294 -93
- package/dist/client.mjs +294 -93
- package/dist/cluster.d.mts +3 -3
- package/dist/cluster.d.ts +3 -3
- package/dist/cluster.js +294 -93
- package/dist/cluster.mjs +294 -93
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +300 -93
- package/dist/index.mjs +297 -93
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -0
- package/dist/internal.mjs +1 -0
- package/dist/message.d.mts +2 -2
- package/dist/message.d.ts +2 -2
- package/dist/message.js +83 -3
- package/dist/message.mjs +83 -3
- package/package.json +6 -6
|
@@ -7,7 +7,7 @@ import { EventEmitter } from 'node:events';
|
|
|
7
7
|
import { REST } from '@fluxerjs/rest';
|
|
8
8
|
import * as _fluxerjs_ws from '@fluxerjs/ws';
|
|
9
9
|
import { WebSocketManager } from '@fluxerjs/ws';
|
|
10
|
-
import { a as RoleEditOptions, I as GuildMemberSearchOptions, M as MessageAttachmentEdit, F as GuildChannelCreateOptions, R as RoleCreateOptions, E as DiscoveryStatusPayload, D as DiscoveryApplicationOptions, z as DiscoveryApplicationPayload, S as SudoVerificationOptions, P as PresenceUpdateOptions, O as ProfilePayload, v as AttachmentUploadPlanItem, w as AttachmentUploadPlanResponse, A as AttachmentUploadCompleteItem, u as AttachmentUploadCompleteResponse, Q as RtcRegionPayload, y as ChannelSlowmodePayload, x as ChannelInviteCreateOptions, C as ChannelEditOptions, G as GroupDmEditOptions, H as GuildMemberEditOptions, B as BulkFetchMessagesRequest, K as MessageSearchOptions, L as MessageSearchResponse } from './Sudo-
|
|
10
|
+
import { a as RoleEditOptions, I as GuildMemberSearchOptions, M as MessageAttachmentEdit, F as GuildChannelCreateOptions, R as RoleCreateOptions, E as DiscoveryStatusPayload, D as DiscoveryApplicationOptions, z as DiscoveryApplicationPayload, S as SudoVerificationOptions, P as PresenceUpdateOptions, O as ProfilePayload, v as AttachmentUploadPlanItem, w as AttachmentUploadPlanResponse, A as AttachmentUploadCompleteItem, u as AttachmentUploadCompleteResponse, Q as RtcRegionPayload, y as ChannelSlowmodePayload, x as ChannelInviteCreateOptions, C as ChannelEditOptions, G as GroupDmEditOptions, H as GuildMemberEditOptions, B as BulkFetchMessagesRequest, K as MessageSearchOptions, L as MessageSearchResponse } from './Sudo-DwxTf-jj.mjs';
|
|
11
11
|
import { EmbedBuilder, AttachmentBuilder, MessagePayload } from '@fluxerjs/builders';
|
|
12
12
|
|
|
13
13
|
type GuildData = Partial<APIGuild> & {
|
|
@@ -323,13 +323,14 @@ declare class GuildEmoji extends Base {
|
|
|
323
323
|
/** Renders this emoji for use in message content: `<:name:id>` (or `<a:name:id>` when animated). */
|
|
324
324
|
toString(): string;
|
|
325
325
|
/** Delete this emoji. Requires Manage Emojis and Stickers permission. */
|
|
326
|
-
delete(): Promise<void>;
|
|
326
|
+
delete(reason?: string): Promise<void>;
|
|
327
327
|
/**
|
|
328
328
|
* Edit this emoji's name.
|
|
329
329
|
* Requires Manage Emojis and Stickers permission.
|
|
330
330
|
*/
|
|
331
331
|
edit(options: {
|
|
332
332
|
name: string;
|
|
333
|
+
reason?: string;
|
|
333
334
|
}): Promise<GuildEmoji>;
|
|
334
335
|
}
|
|
335
336
|
|
|
@@ -361,7 +362,7 @@ declare class GuildSticker extends Base {
|
|
|
361
362
|
/** Date when this sticker was created, derived from its snowflake ID. */
|
|
362
363
|
get createdAt(): Date;
|
|
363
364
|
/** Delete this sticker. Requires Manage Emojis and Stickers permission. */
|
|
364
|
-
delete(): Promise<void>;
|
|
365
|
+
delete(reason?: string): Promise<void>;
|
|
365
366
|
/**
|
|
366
367
|
* Edit this sticker's name and/or description.
|
|
367
368
|
* Requires Manage Emojis and Stickers permission.
|
|
@@ -369,6 +370,7 @@ declare class GuildSticker extends Base {
|
|
|
369
370
|
edit(options: {
|
|
370
371
|
name?: string;
|
|
371
372
|
description?: string;
|
|
373
|
+
reason?: string;
|
|
372
374
|
}): Promise<GuildSticker>;
|
|
373
375
|
}
|
|
374
376
|
|
|
@@ -434,8 +436,9 @@ declare class Role extends Base {
|
|
|
434
436
|
edit(options: RoleEditOptions): Promise<Role>;
|
|
435
437
|
/**
|
|
436
438
|
* DELETE role. Requires Manage Roles.
|
|
439
|
+
* @param reason - Audit log reason (`X-Audit-Log-Reason`)
|
|
437
440
|
*/
|
|
438
|
-
delete(): Promise<void>;
|
|
441
|
+
delete(reason?: string): Promise<void>;
|
|
439
442
|
}
|
|
440
443
|
|
|
441
444
|
/**
|
|
@@ -1059,7 +1062,7 @@ declare class GuildBan extends Base {
|
|
|
1059
1062
|
* Remove this ban (unban the user).
|
|
1060
1063
|
* Requires Ban Members permission.
|
|
1061
1064
|
*/
|
|
1062
|
-
unban(): Promise<void>;
|
|
1065
|
+
unban(reason?: string): Promise<void>;
|
|
1063
1066
|
}
|
|
1064
1067
|
|
|
1065
1068
|
/**
|
|
@@ -1231,9 +1234,9 @@ declare class Guild extends Base {
|
|
|
1231
1234
|
/** Fetch all bans in this guild. Requires Ban Members. */
|
|
1232
1235
|
fetchBans(): Promise<GuildBan[]>;
|
|
1233
1236
|
/** Unban a user from the guild. Requires Ban Members. */
|
|
1234
|
-
unban(userId: string): Promise<void>;
|
|
1237
|
+
unban(userId: string, reason?: string): Promise<void>;
|
|
1235
1238
|
/** Kick a user from the guild. Requires Kick Members. */
|
|
1236
|
-
kick(userId: string): Promise<void>;
|
|
1239
|
+
kick(userId: string, reason?: string): Promise<void>;
|
|
1237
1240
|
/** Fetch all emojis in this guild from the API. */
|
|
1238
1241
|
fetchEmojis(): Promise<GuildEmoji[]>;
|
|
1239
1242
|
/** Fetch a specific emoji by ID. */
|
|
@@ -1242,6 +1245,7 @@ declare class Guild extends Base {
|
|
|
1242
1245
|
createEmoji(options: {
|
|
1243
1246
|
name: string;
|
|
1244
1247
|
image: string;
|
|
1248
|
+
reason?: string;
|
|
1245
1249
|
}): Promise<GuildEmoji>;
|
|
1246
1250
|
/** Clone an emoji from another guild. Requires Manage Emojis and Stickers. */
|
|
1247
1251
|
cloneEmoji(sourceEmojiId: string): Promise<GuildEmoji>;
|
|
@@ -1262,6 +1266,7 @@ declare class Guild extends Base {
|
|
|
1262
1266
|
image: string;
|
|
1263
1267
|
description?: string | null;
|
|
1264
1268
|
tags?: string[];
|
|
1269
|
+
reason?: string;
|
|
1265
1270
|
}): Promise<GuildSticker>;
|
|
1266
1271
|
/** Clone a sticker from another guild. Requires Manage Emojis and Stickers. */
|
|
1267
1272
|
cloneSticker(sourceStickerId: string): Promise<GuildSticker>;
|
|
@@ -1586,6 +1591,8 @@ declare class Message extends Base {
|
|
|
1586
1591
|
mentionRoles: string[];
|
|
1587
1592
|
/** Client-side nonce for deduplication. */
|
|
1588
1593
|
nonce: string | null;
|
|
1594
|
+
/** IDs of custom emojis in the message classified as explicit. */
|
|
1595
|
+
nsfwEmojis: string[];
|
|
1589
1596
|
/**
|
|
1590
1597
|
* Cached text-capable channel (guild text, guild voice, or DM), or null if uncached / not text-based.
|
|
1591
1598
|
* Narrowed type has {@link Channel.send} and {@link Channel.delete}.
|
|
@@ -1668,7 +1675,7 @@ declare class Message extends Base {
|
|
|
1668
1675
|
/** Fetch the latest version of this message from the API. */
|
|
1669
1676
|
fetch(): Promise<Message>;
|
|
1670
1677
|
/** Delete this message. */
|
|
1671
|
-
delete(): Promise<void>;
|
|
1678
|
+
delete(reason?: string): Promise<void>;
|
|
1672
1679
|
/** Delete a specific attachment from this message. */
|
|
1673
1680
|
deleteAttachment(attachmentId: string): Promise<void>;
|
|
1674
1681
|
/** Pin this message in the channel. */
|
|
@@ -1874,7 +1881,7 @@ declare function resolveCacheLimits(input?: CacheSizeLimits): ResolvedCacheOptio
|
|
|
1874
1881
|
* @example
|
|
1875
1882
|
* ```ts
|
|
1876
1883
|
* const client = new Client({
|
|
1877
|
-
* instance: {
|
|
1884
|
+
* instance: { api_public: 'https://api.example.com' },
|
|
1878
1885
|
* cache: { guilds: 100, messages: 20 },
|
|
1879
1886
|
* waitForGuilds: true,
|
|
1880
1887
|
* });
|
|
@@ -1885,33 +1892,51 @@ interface ClientOptions {
|
|
|
1885
1892
|
* Instance endpoints for this client (API, CDN, invite, etc.).
|
|
1886
1893
|
* Pass a partial map to override hosted defaults, or a full discovery document.
|
|
1887
1894
|
* Prefer this over `rest.api` for multi-instance / self-hosted bots.
|
|
1895
|
+
* REST uses `api_public`; `api` / `api_client` are kept for inspection.
|
|
1888
1896
|
* @see {@link Client.fromDiscovery}
|
|
1889
1897
|
*/
|
|
1890
1898
|
instance?: Partial<APIInstanceEndpoints> | APIInstance;
|
|
1891
1899
|
/**
|
|
1892
1900
|
* REST options. Prefer {@link ClientOptions.instance} for the API host.
|
|
1893
|
-
* If both `instance.
|
|
1901
|
+
* If both `instance.api_public` (or resolved default) and `rest.api` are set and differ, construction throws.
|
|
1894
1902
|
*/
|
|
1895
1903
|
rest?: Partial<ConstructorParameters<typeof REST>[0]>;
|
|
1896
1904
|
/**
|
|
1897
|
-
*
|
|
1905
|
+
* BCP 47 locale sent as REST `Accept-Language`. Defaults to {@link import('@fluxerjs/rest').DEFAULT_LOCALE}.
|
|
1906
|
+
* Overrides `rest.locale` when both are set.
|
|
1907
|
+
* @see {@link ClientOptions.rest}
|
|
1908
|
+
*/
|
|
1909
|
+
locale?: string;
|
|
1910
|
+
/**
|
|
1911
|
+
* @deprecated Fluxer has no intents. Prefer {@link ClientOptions.ignoredEvents}. Kept only for migration; identify always sends `0`.
|
|
1898
1912
|
*/
|
|
1899
1913
|
intents?: number;
|
|
1900
1914
|
/**
|
|
1901
1915
|
* @deprecated No-op. Fluxer has no intents warning to suppress.
|
|
1902
1916
|
*/
|
|
1903
1917
|
suppressIntentWarning?: boolean;
|
|
1904
|
-
/** {@link GatewayIdentifyFlags} bitfield sent as Identify `flags`. */
|
|
1918
|
+
/** {@link import('@fluxerjs/types').GatewayIdentifyFlags} bitfield sent as Identify `flags`. */
|
|
1905
1919
|
identifyFlags?: number;
|
|
1906
1920
|
/** Dispatch event names to suppress for this session (`ignored_events`). */
|
|
1907
1921
|
ignoredEvents?: string[];
|
|
1908
1922
|
/** Prefer hydrating this guild first after READY (`initial_guild_id`). */
|
|
1909
1923
|
initialGuildId?: string;
|
|
1910
1924
|
/**
|
|
1911
|
-
* Delay Ready until all READY guilds arrive via GUILD_CREATE; queue other dispatches until then.
|
|
1925
|
+
* Delay {@link Events.Ready} until all READY guilds arrive via GUILD_CREATE; queue other dispatches until then.
|
|
1926
|
+
* Startup backfill emits {@link Events.GuildAvailable} (not {@link Events.GuildCreate}) unless
|
|
1927
|
+
* {@link ClientOptions.emitGuildCreateOnStartup} is set.
|
|
1912
1928
|
* @default false
|
|
1929
|
+
* @see {@link ClientOptions.emitGuildCreateOnStartup}
|
|
1913
1930
|
*/
|
|
1914
1931
|
waitForGuilds?: boolean;
|
|
1932
|
+
/**
|
|
1933
|
+
* Emit {@link Events.GuildCreate} for READY / initial-stream guild hydrations instead of {@link Events.GuildAvailable}.
|
|
1934
|
+
* Default behavior matches Discord.js: startup backfill uses {@link Events.GuildAvailable}, and
|
|
1935
|
+
* {@link Events.GuildCreate} means the bot joined after {@link Events.Ready}.
|
|
1936
|
+
* @default false
|
|
1937
|
+
* @see {@link ClientOptions.waitForGuilds}
|
|
1938
|
+
*/
|
|
1939
|
+
emitGuildCreateOnStartup?: boolean;
|
|
1915
1940
|
/**
|
|
1916
1941
|
* Cache size limits per bucket. Defaults to {@link DEFAULT_CACHE_LIMITS}.
|
|
1917
1942
|
* Pass `0` / `Infinity` per numeric field for unbounded; `messages: false` to disable message caching.
|
|
@@ -2281,6 +2306,13 @@ interface ResolvedInstance {
|
|
|
2281
2306
|
/** Full discovery document when available (fromDiscovery / fetchInstance). */
|
|
2282
2307
|
readonly discovery: Readonly<APIInstance> | null;
|
|
2283
2308
|
}
|
|
2309
|
+
/** Unversioned well-known path (`GET /.well-known/fluxer`). */
|
|
2310
|
+
declare const INSTANCE_DISCOVERY_PATH: "/.well-known/fluxer";
|
|
2311
|
+
/**
|
|
2312
|
+
* Absolute unversioned discovery URL for an origin.
|
|
2313
|
+
* Hosted Fluxer: `https://fluxer.app/.well-known/fluxer` (may 308 to `api_public`).
|
|
2314
|
+
*/
|
|
2315
|
+
declare function instanceDiscoveryUrl(origin: string): string;
|
|
2284
2316
|
/** Strip trailing `/vN` and trailing slash from an API origin. */
|
|
2285
2317
|
declare function normalizeApiOrigin(api: string): string;
|
|
2286
2318
|
/**
|
|
@@ -2407,6 +2439,7 @@ declare const TextChannel_base: (abstract new (...args: any[]) => {
|
|
|
2407
2439
|
isTextBased(): this is TextChannel | VoiceChannel | DMChannel;
|
|
2408
2440
|
isGuild(): this is GuildChannel;
|
|
2409
2441
|
isText(): this is TextChannel;
|
|
2442
|
+
isAnnouncement(): this is AnnouncementChannel;
|
|
2410
2443
|
isCategory(): this is CategoryChannel;
|
|
2411
2444
|
isDM(): this is DMChannel;
|
|
2412
2445
|
isPersonalNotes(): boolean;
|
|
@@ -2431,6 +2464,7 @@ declare const TextChannel_base: (abstract new (...args: any[]) => {
|
|
|
2431
2464
|
delete(options?: SudoVerificationOptions & {
|
|
2432
2465
|
silent?: boolean;
|
|
2433
2466
|
deleteMessages?: boolean;
|
|
2467
|
+
reason?: string;
|
|
2434
2468
|
}): Promise<void>;
|
|
2435
2469
|
toString(): string;
|
|
2436
2470
|
}) & typeof GuildChannel;
|
|
@@ -2458,6 +2492,12 @@ declare class TextChannel extends TextChannel_base {
|
|
|
2458
2492
|
setSlowmode(seconds: number): Promise<this>;
|
|
2459
2493
|
protected applyEditPatch(data: APIChannel): void;
|
|
2460
2494
|
}
|
|
2495
|
+
/**
|
|
2496
|
+
* A guild announcement channel (type 5).
|
|
2497
|
+
* Same fields and slowmode as a text channel. Published messages are copied into channels that follow it.
|
|
2498
|
+
*/
|
|
2499
|
+
declare class AnnouncementChannel extends TextChannel {
|
|
2500
|
+
}
|
|
2461
2501
|
/** A category channel (container for organizing channels). */
|
|
2462
2502
|
declare class CategoryChannel extends GuildChannel {
|
|
2463
2503
|
}
|
|
@@ -2478,6 +2518,7 @@ declare const VoiceChannel_base: (abstract new (...args: any[]) => {
|
|
|
2478
2518
|
isTextBased(): this is TextChannel | VoiceChannel | DMChannel;
|
|
2479
2519
|
isGuild(): this is GuildChannel;
|
|
2480
2520
|
isText(): this is TextChannel;
|
|
2521
|
+
isAnnouncement(): this is AnnouncementChannel;
|
|
2481
2522
|
isCategory(): this is CategoryChannel;
|
|
2482
2523
|
isDM(): this is DMChannel;
|
|
2483
2524
|
isPersonalNotes(): boolean;
|
|
@@ -2502,6 +2543,7 @@ declare const VoiceChannel_base: (abstract new (...args: any[]) => {
|
|
|
2502
2543
|
delete(options?: SudoVerificationOptions & {
|
|
2503
2544
|
silent?: boolean;
|
|
2504
2545
|
deleteMessages?: boolean;
|
|
2546
|
+
reason?: string;
|
|
2505
2547
|
}): Promise<void>;
|
|
2506
2548
|
toString(): string;
|
|
2507
2549
|
}) & typeof GuildChannel;
|
|
@@ -2564,6 +2606,7 @@ declare const DMChannel_base: (abstract new (...args: any[]) => {
|
|
|
2564
2606
|
isTextBased(): this is TextChannel | VoiceChannel | DMChannel;
|
|
2565
2607
|
isGuild(): this is GuildChannel;
|
|
2566
2608
|
isText(): this is TextChannel;
|
|
2609
|
+
isAnnouncement(): this is AnnouncementChannel;
|
|
2567
2610
|
isCategory(): this is CategoryChannel;
|
|
2568
2611
|
isDM(): this is DMChannel;
|
|
2569
2612
|
isPersonalNotes(): boolean;
|
|
@@ -2588,6 +2631,7 @@ declare const DMChannel_base: (abstract new (...args: any[]) => {
|
|
|
2588
2631
|
delete(options?: SudoVerificationOptions & {
|
|
2589
2632
|
silent?: boolean;
|
|
2590
2633
|
deleteMessages?: boolean;
|
|
2634
|
+
reason?: string;
|
|
2591
2635
|
}): Promise<void>;
|
|
2592
2636
|
toString(): string;
|
|
2593
2637
|
}) & typeof Channel;
|
|
@@ -2675,14 +2719,16 @@ declare abstract class Channel extends Base {
|
|
|
2675
2719
|
/** @internal Factory wired after subclasses load. */
|
|
2676
2720
|
static createDM(_c: Client, _d: APIChannelPartial): DMChannel;
|
|
2677
2721
|
/**
|
|
2678
|
-
* Whether this channel type can carry messages (text, voice, DM, group DM, notes).
|
|
2722
|
+
* Whether this channel type can carry messages (text, announcement, voice, DM, group DM, notes).
|
|
2679
2723
|
* Checks {@link ChannelType}, not whether `send` exists on the instance.
|
|
2680
2724
|
*/
|
|
2681
2725
|
isTextBased(): this is TextChannel | VoiceChannel | DMChannel;
|
|
2682
|
-
/** Check if this is a guild channel (text, voice, category, or link). */
|
|
2726
|
+
/** Check if this is a guild channel (text, announcement, voice, category, or link). */
|
|
2683
2727
|
isGuild(): this is GuildChannel;
|
|
2684
2728
|
/** Check if this is a guild text channel. */
|
|
2685
2729
|
isText(): this is TextChannel;
|
|
2730
|
+
/** Check if this is a guild announcement channel. */
|
|
2731
|
+
isAnnouncement(): this is AnnouncementChannel;
|
|
2686
2732
|
/** Check if this is a category channel. */
|
|
2687
2733
|
isCategory(): this is CategoryChannel;
|
|
2688
2734
|
/** Check if this is a DM, group DM, or personal notes channel. */
|
|
@@ -2752,12 +2798,13 @@ declare abstract class Channel extends Base {
|
|
|
2752
2798
|
delete(options?: SudoVerificationOptions & {
|
|
2753
2799
|
silent?: boolean;
|
|
2754
2800
|
deleteMessages?: boolean;
|
|
2801
|
+
reason?: string;
|
|
2755
2802
|
}): Promise<void>;
|
|
2756
2803
|
/** Channel mention (`<#id>`). */
|
|
2757
2804
|
toString(): string;
|
|
2758
2805
|
}
|
|
2759
2806
|
|
|
2760
|
-
/** Channel types that can carry messages (guild text, guild voice, DMs). */
|
|
2807
|
+
/** Channel types that can carry messages (guild text, announcement, guild voice, DMs). */
|
|
2761
2808
|
type TextBasedChannel = TextChannel | VoiceChannel | DMChannel;
|
|
2762
2809
|
|
|
2763
2810
|
/** Member payload plus fields that exist on update/edit but not always on GET. */
|
|
@@ -2857,7 +2904,7 @@ declare class GuildMember extends Base {
|
|
|
2857
2904
|
*/
|
|
2858
2905
|
move(channelId: string | null, connectionId?: string | null): Promise<void>;
|
|
2859
2906
|
/** Kick this member. Requires Kick Members. */
|
|
2860
|
-
kick(): Promise<void>;
|
|
2907
|
+
kick(reason?: string): Promise<void>;
|
|
2861
2908
|
/** Ban this member. Requires Ban Members. */
|
|
2862
2909
|
ban(options?: GuildBanOptions): Promise<void>;
|
|
2863
2910
|
/**
|
|
@@ -2972,7 +3019,7 @@ type ClientEventMethods = {
|
|
|
2972
3019
|
[K in keyof typeof Events]: (cb: (...args: ClientEvents[(typeof Events)[K]]) => void) => Client;
|
|
2973
3020
|
};
|
|
2974
3021
|
|
|
2975
|
-
/** Bootstrap origin for {@link Client.fromDiscovery}. */
|
|
3022
|
+
/** Bootstrap origin for {@link Client.fromDiscovery} (`GET {origin}/.well-known/fluxer`, unversioned). */
|
|
2976
3023
|
type DiscoveryOrigin = string | {
|
|
2977
3024
|
api: string;
|
|
2978
3025
|
version?: string;
|
|
@@ -3012,7 +3059,12 @@ declare class Client extends EventEmitter {
|
|
|
3012
3059
|
_ws: WebSocketManager | null;
|
|
3013
3060
|
/** When waitForGuilds, guild IDs still expected via GUILD_CREATE. */
|
|
3014
3061
|
_pendingGuildIds: Set<string> | null;
|
|
3015
|
-
/**
|
|
3062
|
+
/** Guild IDs inserted as unavailable stubs from READY (startup / reconnect backfill). */
|
|
3063
|
+
_readyStubGuildIds: Set<string>;
|
|
3064
|
+
/**
|
|
3065
|
+
* @internal Empty-READY guild stream window.
|
|
3066
|
+
* Classifies incoming GUILD_CREATE as startup hydration. Also delays Ready when waitForGuilds.
|
|
3067
|
+
*/
|
|
3016
3068
|
_guildStreamSettleTimeout: ReturnType<typeof setTimeout> | null;
|
|
3017
3069
|
/** @internal Dispatches queued until Ready when waitForGuilds delays Ready. */
|
|
3018
3070
|
_deferredGatewayDispatches: GatewayReceivePayload[];
|
|
@@ -3024,10 +3076,12 @@ declare class Client extends EventEmitter {
|
|
|
3024
3076
|
constructor(options?: ClientOptions);
|
|
3025
3077
|
/**
|
|
3026
3078
|
* Create a client from instance discovery (`GET /.well-known/fluxer`).
|
|
3027
|
-
*
|
|
3079
|
+
* Fetches the unversioned well-known document from the given origin (not `{api}/v1/.well-known/fluxer`).
|
|
3080
|
+
* Wires REST from `endpoints.api_public`. `endpoints.api` / `api_client` stay on the instance for inspection.
|
|
3081
|
+
* Does not log in. Call {@link login} with a token afterward.
|
|
3028
3082
|
*
|
|
3029
|
-
* @param origin -
|
|
3030
|
-
* @param options - Client options (must not conflict with discovered `endpoints.
|
|
3083
|
+
* @param origin - Origin used only to fetch discovery (e.g. `https://fluxer.app` or `https://my.instance`)
|
|
3084
|
+
* @param options - Client options (must not conflict with discovered `endpoints.api_public`)
|
|
3031
3085
|
* @param connectOptions - Optional abort signal for the discovery request
|
|
3032
3086
|
*/
|
|
3033
3087
|
static fromDiscovery(origin: DiscoveryOrigin, options?: Omit<ClientOptions, 'instance'>, connectOptions?: {
|
|
@@ -3057,7 +3111,7 @@ declare class Client extends EventEmitter {
|
|
|
3057
3111
|
animated?: boolean;
|
|
3058
3112
|
}, guildId?: string | null): Promise<string>;
|
|
3059
3113
|
/**
|
|
3060
|
-
* Fetch instance discovery document (
|
|
3114
|
+
* Fetch instance discovery document (unversioned `GET /.well-known/fluxer` on the REST host).
|
|
3061
3115
|
* @returns Instance configuration (endpoints, features, metadata)
|
|
3062
3116
|
*/
|
|
3063
3117
|
fetchInstance(): Promise<APIInstance>;
|
|
@@ -3257,4 +3311,4 @@ declare class Client extends EventEmitter {
|
|
|
3257
3311
|
static get Routes(): typeof Routes;
|
|
3258
3312
|
}
|
|
3259
3313
|
|
|
3260
|
-
export {
|
|
3314
|
+
export { INSTANCE_DISCOVERY_PATH as $, AllowedMentions as A, Base as B, CacheController as C, DEFAULT_CACHE_LIMITS as D, type DiscoveryOrigin as E, Events as F, type FetchMessagesOptions as G, type FetchPinnedMessagesOptions as H, type FetchedUserWithProfile as I, Guild as J, GuildBan as K, GuildChannel as L, type GuildCountsUpdatePayload as M, GuildEmoji as N, type GuildEmojisUpdatePayload as O, GuildManager as P, GuildMember as Q, GuildMemberManager as R, GuildMemberRoleManager as S, type GuildMemberSearchHit as T, type GuildMemberSearchPayload as U, type GuildMembersChunkPayload as V, type GuildRoleDeletePayload as W, GuildRoleManager as X, type GuildRoleUpdatePayload as Y, GuildSticker as Z, type GuildStickersUpdatePayload as _, type AllowedMentionsOptions as a, type WebhooksUpdatePayload as a$, Invite as a0, type InviteChannelSnapshot as a1, type InviteDeletePayload as a2, type InviteGuildSnapshot as a3, LinkChannel as a4, Message as a5, type MessageAttachment as a6, type MessageCall as a7, MessageCollector as a8, type MessageCollectorEndReason as a9, type PermissionOverwriteEditOptions as aA, PermissionOverwriteManager as aB, type PinnedMessagesPage as aC, type PresenceActivity as aD, type PresenceUpdateBulkPayload as aE, type PresenceUpdatePayload as aF, ReactionCollector as aG, type ReactionCollectorEndReason as aH, type ReactionCollectorOptions as aI, type ReactionEmojiPayload as aJ, type ReplyOptions as aK, type ResolvedCacheLimits as aL, type ResolvedInstance as aM, Role as aN, type RoleResolvable as aO, type TextBasedChannel as aP, TextChannel as aQ, type TypingStartPayload as aR, type UploadFileForSend as aS, User as aT, UserManager as aU, type VanityURLPayload as aV, VoiceChannel as aW, Webhook as aX, type WebhookEditOptions as aY, type WebhookMessageEditOptions as aZ, type WebhookSendOptions as a_, type MessageCollectorOptions as aa, type MessageDeleteBulkPayload as ab, type MessageEditOptions as ac, type MessageEmbed as ad, type MessageEmbedAuthor as ae, type MessageEmbedField as af, type MessageEmbedFooter as ag, type MessageEmbedMedia as ah, MessageManager as ai, type MessagePrepareInput as aj, MessageReaction as ak, type MessageReactionAddManyEntry as al, type MessageReactionAddManyPayload as am, MessageReactionManager as an, type MessageReactionPayload as ao, type MessageReactionRemoveAllPayload as ap, type MessageReactionRemoveEmojiPayload as aq, type MessageReference as ar, type MessageReplyTarget as as, type MessageSendOptions as at, type MessageSnapshot as au, MessageSticker as av, PartialGuildMember as aw, PartialMessage as ax, type PartialUserGuildPayload as ay, PermissionOverwrite as az, AnnouncementChannel as b, instanceDiscoveryUrl as b0, inviteUrl as b1, normalizeApiOrigin as b2, normalizeCacheLimit as b3, parseInstanceDiscovery as b4, resolveCacheLimits as b5, resolveInstanceEndpoints as b6, type AuditLogChange as c, type AuditLogEntryPayload as d, type AuditLogFetchPayload as e, type BulkFetchMessagesChannelResult as f, type BulkFetchMessagesOptions as g, type BulkFetchMessagesResult as h, type CacheSizeLimits as i, type CacheStats as j, CategoryChannel as k, Channel as l, ChannelManager as m, type ChannelMemberCountsUpdatePayload as n, type ChannelPinsUpdatePayload as o, type ChannelRecipientPayload as p, Client as q, type ClientEventListener as r, type ClientEventMethods as s, type ClientEventName as t, type ClientEvents as u, type ClientOptions as v, ClientUser as w, type CollectedReaction as x, DEFAULT_INSTANCE_ENDPOINTS as y, DMChannel as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChannelType, OverwriteType, APIMessage, APIChannel, APIMessageSearchResponse } from '@fluxerjs/types';
|
|
2
2
|
import { PermissionResolvable } from '@fluxerjs/util';
|
|
3
3
|
|
|
4
4
|
/** Attachment upload / message attachment SDK options. */
|
|
@@ -106,6 +106,11 @@ interface ChannelPermissionOverwriteOptions {
|
|
|
106
106
|
}
|
|
107
107
|
/** Options for {@link GuildChannel.edit}. */
|
|
108
108
|
interface ChannelEditOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Convert between a guild text channel ({@link ChannelType.GuildText}) and an announcement
|
|
111
|
+
* channel ({@link ChannelType.GuildAnnouncement}). Any other conversion is rejected.
|
|
112
|
+
*/
|
|
113
|
+
type?: ChannelType.GuildText | ChannelType.GuildAnnouncement;
|
|
109
114
|
name?: string | null;
|
|
110
115
|
topic?: string | null;
|
|
111
116
|
url?: string | null;
|
|
@@ -122,6 +127,8 @@ interface ChannelEditOptions {
|
|
|
122
127
|
permissionOverwrites?: ChannelPermissionOverwriteOptions[];
|
|
123
128
|
/** Group DM icon hash (base64 image). */
|
|
124
129
|
icon?: string | null;
|
|
130
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
131
|
+
reason?: string;
|
|
125
132
|
}
|
|
126
133
|
/** Options for {@link Guild.createChannel}. */
|
|
127
134
|
interface GuildChannelCreateOptions {
|
|
@@ -244,6 +251,8 @@ interface RoleCreateOptions {
|
|
|
244
251
|
permissions?: string | PermissionResolvable;
|
|
245
252
|
/** Role color as 24-bit RGB. */
|
|
246
253
|
color?: number;
|
|
254
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
255
|
+
reason?: string;
|
|
247
256
|
}
|
|
248
257
|
/**
|
|
249
258
|
* CamelCase options for editing a guild role.
|
|
@@ -263,6 +272,8 @@ interface RoleEditOptions {
|
|
|
263
272
|
mentionable?: boolean;
|
|
264
273
|
/** Hoisted position (visual separator group). */
|
|
265
274
|
hoistPosition?: number | null;
|
|
275
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
276
|
+
reason?: string;
|
|
266
277
|
}
|
|
267
278
|
|
|
268
279
|
/** Guild member search / edit SDK options. */
|
|
@@ -301,6 +312,8 @@ interface GuildMemberEditOptions {
|
|
|
301
312
|
timeoutReason?: string | null;
|
|
302
313
|
channelId?: string | null;
|
|
303
314
|
connectionId?: string | null;
|
|
315
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
316
|
+
reason?: string;
|
|
304
317
|
}
|
|
305
318
|
/** Convert {@link GuildMemberEditOptions} to the member PATCH wire body. */
|
|
306
319
|
declare function toMemberEditBody(options: GuildMemberEditOptions): Record<string, unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChannelType, OverwriteType, APIMessage, APIChannel, APIMessageSearchResponse } from '@fluxerjs/types';
|
|
2
2
|
import { PermissionResolvable } from '@fluxerjs/util';
|
|
3
3
|
|
|
4
4
|
/** Attachment upload / message attachment SDK options. */
|
|
@@ -106,6 +106,11 @@ interface ChannelPermissionOverwriteOptions {
|
|
|
106
106
|
}
|
|
107
107
|
/** Options for {@link GuildChannel.edit}. */
|
|
108
108
|
interface ChannelEditOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Convert between a guild text channel ({@link ChannelType.GuildText}) and an announcement
|
|
111
|
+
* channel ({@link ChannelType.GuildAnnouncement}). Any other conversion is rejected.
|
|
112
|
+
*/
|
|
113
|
+
type?: ChannelType.GuildText | ChannelType.GuildAnnouncement;
|
|
109
114
|
name?: string | null;
|
|
110
115
|
topic?: string | null;
|
|
111
116
|
url?: string | null;
|
|
@@ -122,6 +127,8 @@ interface ChannelEditOptions {
|
|
|
122
127
|
permissionOverwrites?: ChannelPermissionOverwriteOptions[];
|
|
123
128
|
/** Group DM icon hash (base64 image). */
|
|
124
129
|
icon?: string | null;
|
|
130
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
131
|
+
reason?: string;
|
|
125
132
|
}
|
|
126
133
|
/** Options for {@link Guild.createChannel}. */
|
|
127
134
|
interface GuildChannelCreateOptions {
|
|
@@ -244,6 +251,8 @@ interface RoleCreateOptions {
|
|
|
244
251
|
permissions?: string | PermissionResolvable;
|
|
245
252
|
/** Role color as 24-bit RGB. */
|
|
246
253
|
color?: number;
|
|
254
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
255
|
+
reason?: string;
|
|
247
256
|
}
|
|
248
257
|
/**
|
|
249
258
|
* CamelCase options for editing a guild role.
|
|
@@ -263,6 +272,8 @@ interface RoleEditOptions {
|
|
|
263
272
|
mentionable?: boolean;
|
|
264
273
|
/** Hoisted position (visual separator group). */
|
|
265
274
|
hoistPosition?: number | null;
|
|
275
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
276
|
+
reason?: string;
|
|
266
277
|
}
|
|
267
278
|
|
|
268
279
|
/** Guild member search / edit SDK options. */
|
|
@@ -301,6 +312,8 @@ interface GuildMemberEditOptions {
|
|
|
301
312
|
timeoutReason?: string | null;
|
|
302
313
|
channelId?: string | null;
|
|
303
314
|
connectionId?: string | null;
|
|
315
|
+
/** Audit log reason (`X-Audit-Log-Reason`). Not sent in the JSON body. */
|
|
316
|
+
reason?: string;
|
|
304
317
|
}
|
|
305
318
|
/** Convert {@link GuildMemberEditOptions} to the member PATCH wire body. */
|
|
306
319
|
declare function toMemberEditBody(options: GuildMemberEditOptions): Record<string, unknown>;
|
package/dist/client.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { c as AuditLogChange, d as AuditLogEntryPayload, i as CacheSizeLimits, n as ChannelMemberCountsUpdatePayload, o as ChannelPinsUpdatePayload, p as ChannelRecipientPayload, q as Client, r as ClientEventListener, s as ClientEventMethods, t as ClientEventName, u as ClientEvents, v as ClientOptions, F as Events, M as GuildCountsUpdatePayload, O as GuildEmojisUpdatePayload, V as GuildMembersChunkPayload, W as GuildRoleDeletePayload, Y as GuildRoleUpdatePayload, _ as GuildStickersUpdatePayload, a2 as InviteDeletePayload, ab as MessageDeleteBulkPayload, al as MessageReactionAddManyEntry, am as MessageReactionAddManyPayload, ao as MessageReactionPayload, ap as MessageReactionRemoveAllPayload, aq as MessageReactionRemoveEmojiPayload, aD as PresenceActivity, aE as PresenceUpdateBulkPayload, aF as PresenceUpdatePayload, aJ as ReactionEmojiPayload, aR as TypingStartPayload, a$ as WebhooksUpdatePayload } from './SubpathMessage-DW9TgPNl.mjs';
|
|
2
2
|
import '@fluxerjs/types';
|
|
3
3
|
import '@fluxerjs/collection';
|
|
4
4
|
import '@fluxerjs/util';
|
|
5
5
|
import 'node:events';
|
|
6
6
|
import '@fluxerjs/rest';
|
|
7
7
|
import '@fluxerjs/ws';
|
|
8
|
-
import './Sudo-
|
|
8
|
+
import './Sudo-DwxTf-jj.mjs';
|
|
9
9
|
import '@fluxerjs/builders';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { c as AuditLogChange, d as AuditLogEntryPayload, i as CacheSizeLimits, n as ChannelMemberCountsUpdatePayload, o as ChannelPinsUpdatePayload, p as ChannelRecipientPayload, q as Client, r as ClientEventListener, s as ClientEventMethods, t as ClientEventName, u as ClientEvents, v as ClientOptions, F as Events, M as GuildCountsUpdatePayload, O as GuildEmojisUpdatePayload, V as GuildMembersChunkPayload, W as GuildRoleDeletePayload, Y as GuildRoleUpdatePayload, _ as GuildStickersUpdatePayload, a2 as InviteDeletePayload, ab as MessageDeleteBulkPayload, al as MessageReactionAddManyEntry, am as MessageReactionAddManyPayload, ao as MessageReactionPayload, ap as MessageReactionRemoveAllPayload, aq as MessageReactionRemoveEmojiPayload, aD as PresenceActivity, aE as PresenceUpdateBulkPayload, aF as PresenceUpdatePayload, aJ as ReactionEmojiPayload, aR as TypingStartPayload, a$ as WebhooksUpdatePayload } from './SubpathMessage-DHo7ltTz.js';
|
|
2
2
|
import '@fluxerjs/types';
|
|
3
3
|
import '@fluxerjs/collection';
|
|
4
4
|
import '@fluxerjs/util';
|
|
5
5
|
import 'node:events';
|
|
6
6
|
import '@fluxerjs/rest';
|
|
7
7
|
import '@fluxerjs/ws';
|
|
8
|
-
import './Sudo-
|
|
8
|
+
import './Sudo-DwxTf-jj.js';
|
|
9
9
|
import '@fluxerjs/builders';
|