@wolfstar/plugin-gateway 0.11.0 → 0.12.0-next-20261006120125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -2
- package/dist/esm/index.d.ts +330 -137
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4423 -4132
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -813,6 +813,38 @@ interface Cache<Value extends StructureMixin<object>, Raw extends RawAPIType<Val
|
|
|
813
813
|
*/
|
|
814
814
|
set(key: string, value: Value): Awaitable<this>;
|
|
815
815
|
}
|
|
816
|
+
/**
|
|
817
|
+
* The cache of the manager of one channel or thread: the keyed methods of the {@link Cache} it reads, taking the ID
|
|
818
|
+
* of the entity alone instead of the key built by `resolveKey`, like the caches of discord.js's channel managers.
|
|
819
|
+
*
|
|
820
|
+
* @typeParam Value The structure the cache hands out.
|
|
821
|
+
*/
|
|
822
|
+
interface ScopedCache<Value extends StructureMixin<object>> {
|
|
823
|
+
/**
|
|
824
|
+
* Whether every method answers synchronously, never with a promise.
|
|
825
|
+
*/
|
|
826
|
+
readonly synchronous: boolean;
|
|
827
|
+
/**
|
|
828
|
+
* Deletes an item from the cache.
|
|
829
|
+
*/
|
|
830
|
+
delete(id: string): Awaitable<boolean>;
|
|
831
|
+
/**
|
|
832
|
+
* Retrieves an item from the cache.
|
|
833
|
+
*/
|
|
834
|
+
get(id: string): Awaitable<Value | undefined>;
|
|
835
|
+
/**
|
|
836
|
+
* Checks if an item exists in the cache.
|
|
837
|
+
*/
|
|
838
|
+
has(id: string): Awaitable<boolean>;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Scopes a {@link Cache} keyed by more than an ID to the entries of one parent.
|
|
842
|
+
*
|
|
843
|
+
* @param cache The cache.
|
|
844
|
+
* @param resolveKey Builds the key of the cache from the ID of an entity.
|
|
845
|
+
* @internal
|
|
846
|
+
*/
|
|
847
|
+
declare function scopeCache<Value extends StructureMixin<object>>(cache: Cache<Value>, resolveKey: (id: string) => string): ScopedCache<Value>;
|
|
816
848
|
/**
|
|
817
849
|
* The options of the cache of one entity, set per entity through the client's `cacheOptions` option.
|
|
818
850
|
*/
|
|
@@ -1047,6 +1079,35 @@ export interface AddOptions {
|
|
|
1047
1079
|
*/
|
|
1048
1080
|
extras?: unknown[];
|
|
1049
1081
|
}
|
|
1082
|
+
/**
|
|
1083
|
+
* The arguments of a method of a manager the client holds for every guild: they start with the guild's ID, which a
|
|
1084
|
+
* manager built for one guild (`guild.members`, `client.guilds.members(guildId)`) fills in.
|
|
1085
|
+
*
|
|
1086
|
+
* @typeParam InGuild Whether the manager was built for one guild.
|
|
1087
|
+
* @typeParam Args The arguments after the guild's ID.
|
|
1088
|
+
*/
|
|
1089
|
+
export type GuildArgs<InGuild extends boolean, Args extends readonly unknown[]> = InGuild extends true ? Args : [guildId: string, ...Args];
|
|
1090
|
+
/**
|
|
1091
|
+
* Types the arguments of a method declared with {@link GuildArgs}, which always start with the guild's ID once
|
|
1092
|
+
* {@link fillGuildId} filled it in.
|
|
1093
|
+
*
|
|
1094
|
+
* @param args The arguments of the method.
|
|
1095
|
+
* @internal
|
|
1096
|
+
*/
|
|
1097
|
+
export declare function withGuildId<Args extends readonly unknown[]>(args: readonly unknown[]): [guildId: string, ...Args];
|
|
1098
|
+
/**
|
|
1099
|
+
* Makes methods of a manager the client holds for every guild fill in the guild's ID: on an instance built for one
|
|
1100
|
+
* guild, they call the client's manager, which holds the state and the cache, with that ID first.
|
|
1101
|
+
*
|
|
1102
|
+
* @param target The class of the manager.
|
|
1103
|
+
* @param getManager Gets the client's manager.
|
|
1104
|
+
* @param methods The names of the methods taking the guild's ID first.
|
|
1105
|
+
* @internal
|
|
1106
|
+
*/
|
|
1107
|
+
export declare function fillGuildId<Manager extends {
|
|
1108
|
+
client: GatewayClient;
|
|
1109
|
+
guildId: string | undefined;
|
|
1110
|
+
}>(target: abstract new (...args: any[]) => Manager, getManager: (client: GatewayClient) => object, methods: readonly string[]): void;
|
|
1050
1111
|
/**
|
|
1051
1112
|
* Manages the API methods of a data model with a mutable cache of instances: the `CachedManager` of the discord.js
|
|
1052
1113
|
* RFC #11426.
|
|
@@ -1056,13 +1117,16 @@ export interface AddOptions {
|
|
|
1056
1117
|
* `cacheConstructor` (`CollectionCache` by default) and shared by every manager of the same entity.
|
|
1057
1118
|
*
|
|
1058
1119
|
* Caches keyed by more than an ID take the key built by `resolveKey`:
|
|
1059
|
-
* `client.members.cache.get(client.members.resolveKey(guildId, userId))`.
|
|
1120
|
+
* `client.members.cache.get(client.members.resolveKey(guildId, userId))`. The managers of a guild, a channel or a
|
|
1121
|
+
* thread take the ID alone: `guild.members.cache.get(userId)`.
|
|
1060
1122
|
*
|
|
1061
1123
|
* @typeParam Name The name of the entity this manager holds.
|
|
1062
1124
|
* @typeParam Value The structure this manager builds.
|
|
1063
1125
|
* @typeParam Args The arguments identifying an entity, e.g. `[id]` or `[guildId, userId]`.
|
|
1126
|
+
* @typeParam FetchArgs The arguments `fetch` and `refresh` take, which differ from `Args` on a manager built for one
|
|
1127
|
+
* guild.
|
|
1064
1128
|
*/
|
|
1065
|
-
export declare abstract class CachedManager<Name extends CacheEntityName, Value extends StructureMixin<object>, Args extends readonly string[]> extends DataManager<Value, Args> {
|
|
1129
|
+
export declare abstract class CachedManager<Name extends CacheEntityName, Value extends StructureMixin<object>, Args extends readonly string[], FetchArgs extends readonly string[] = Args> extends DataManager<Value, Args> {
|
|
1066
1130
|
/**
|
|
1067
1131
|
* The cache of this manager's entity.
|
|
1068
1132
|
*
|
|
@@ -1070,6 +1134,12 @@ export declare abstract class CachedManager<Name extends CacheEntityName, Value
|
|
|
1070
1134
|
* ```typescript
|
|
1071
1135
|
* const user = await client.users.cache.get(userId);
|
|
1072
1136
|
* ```
|
|
1137
|
+
*
|
|
1138
|
+
* @remarks
|
|
1139
|
+
* On a manager built for one guild (`guild.members`), it is the client's cache taking the ID of the entity alone.
|
|
1140
|
+
* `get`, `has`, `set` and `delete` cost the same as on the client's; `getSize` and `clear` scan the keys of every
|
|
1141
|
+
* guild to find the ones of this guild, unlike discord.js's per-guild collections: avoid calling them for every
|
|
1142
|
+
* guild in a loop.
|
|
1073
1143
|
*/
|
|
1074
1144
|
readonly cache: Cache<Value>;
|
|
1075
1145
|
/**
|
|
@@ -1083,7 +1153,14 @@ export declare abstract class CachedManager<Name extends CacheEntityName, Value
|
|
|
1083
1153
|
* @param extras The extra arguments passed to {@link CachedManager._add}.
|
|
1084
1154
|
*/
|
|
1085
1155
|
protected abstract createStructure(data: CacheEntityTypes[Name], ...extras: unknown[]): Value;
|
|
1086
|
-
|
|
1156
|
+
/**
|
|
1157
|
+
* @param client The client.
|
|
1158
|
+
* @param name The name of the entity this manager holds.
|
|
1159
|
+
* @param guildId The guild whose entities {@link CachedManager.cache} is narrowed to, for the managers the client
|
|
1160
|
+
* holds for every guild.
|
|
1161
|
+
*/
|
|
1162
|
+
constructor(client: GatewayClient, name: Name, guildId?: string);
|
|
1163
|
+
private createGuildCache;
|
|
1087
1164
|
/**
|
|
1088
1165
|
* Gets {@link CachedManager.cache} from the client. Managers whose entity spans several caches override it.
|
|
1089
1166
|
*/
|
|
@@ -1182,13 +1259,13 @@ export declare abstract class CachedManager<Name extends CacheEntityName, Value
|
|
|
1182
1259
|
*
|
|
1183
1260
|
* @param args The arguments identifying the entity, optionally followed by {@link FetchOptions}.
|
|
1184
1261
|
*/
|
|
1185
|
-
fetch(...args: [...
|
|
1262
|
+
fetch(...args: [...FetchArgs] | [...FetchArgs, FetchOptions]): Promise<Value>;
|
|
1186
1263
|
/**
|
|
1187
1264
|
* Fetches an entity from the API, bypassing and then updating the cache. Same as `fetch(...args, { force: true })`.
|
|
1188
1265
|
*
|
|
1189
1266
|
* @param args The arguments identifying the entity.
|
|
1190
1267
|
*/
|
|
1191
|
-
refresh(...args:
|
|
1268
|
+
refresh(...args: FetchArgs): Promise<Value>;
|
|
1192
1269
|
/**
|
|
1193
1270
|
* Gets the cache key of raw data.
|
|
1194
1271
|
*
|
|
@@ -1807,9 +1884,18 @@ export declare class ThreadMemberManager extends CachedManager<"threadMembers",
|
|
|
1807
1884
|
*/
|
|
1808
1885
|
export declare class ThreadChannelMemberManager extends BaseManager {
|
|
1809
1886
|
readonly threadId: string;
|
|
1887
|
+
/**
|
|
1888
|
+
* The cached members of the thread, by user ID.
|
|
1889
|
+
*
|
|
1890
|
+
* @example
|
|
1891
|
+
* ```typescript
|
|
1892
|
+
* const member = await thread.members.cache.get(userId);
|
|
1893
|
+
* ```
|
|
1894
|
+
*/
|
|
1895
|
+
readonly cache: ScopedCache<ThreadMember>;
|
|
1810
1896
|
constructor(client: GatewayClient, threadId: string);
|
|
1811
1897
|
/**
|
|
1812
|
-
* Gets a member of the thread from the cache.
|
|
1898
|
+
* Gets a member of the thread from the cache. Same as `cache.get`, always answering a promise.
|
|
1813
1899
|
*/
|
|
1814
1900
|
get(userId: string): Promise<ThreadMember | undefined>;
|
|
1815
1901
|
/**
|
|
@@ -4499,9 +4585,18 @@ export declare class Message<InGuild extends boolean = boolean> extends Message$
|
|
|
4499
4585
|
*/
|
|
4500
4586
|
export declare class ChannelMessageManager extends BaseManager {
|
|
4501
4587
|
readonly channelId: string;
|
|
4588
|
+
/**
|
|
4589
|
+
* The cached messages of the channel, by message ID.
|
|
4590
|
+
*
|
|
4591
|
+
* @example
|
|
4592
|
+
* ```typescript
|
|
4593
|
+
* const message = await channel.messages.cache.get(messageId);
|
|
4594
|
+
* ```
|
|
4595
|
+
*/
|
|
4596
|
+
readonly cache: ScopedCache<Message>;
|
|
4502
4597
|
constructor(client: GatewayClient, channelId: string);
|
|
4503
4598
|
/**
|
|
4504
|
-
* Gets a message of the channel from the cache.
|
|
4599
|
+
* Gets a message of the channel from the cache. Same as `cache.get`, always answering a promise.
|
|
4505
4600
|
*/
|
|
4506
4601
|
get(messageId: string): Promise<Message | undefined>;
|
|
4507
4602
|
/**
|
|
@@ -6262,9 +6357,22 @@ export interface RolePosition {
|
|
|
6262
6357
|
}
|
|
6263
6358
|
/**
|
|
6264
6359
|
* Manages the {@link Role}s known to the client.
|
|
6360
|
+
*
|
|
6361
|
+
* `guild.roles` (or `client.guilds.roles(guildId)`) is this manager built for one guild, like discord.js's:
|
|
6362
|
+
* `cache` takes the role's ID alone, and the methods lose their `guildId` argument.
|
|
6363
|
+
*
|
|
6364
|
+
* @typeParam InGuild Whether the manager was built for one guild.
|
|
6265
6365
|
*/
|
|
6266
|
-
export declare class RoleManager extends CachedManager<"roles", Role, [guildId: string, roleId: string]
|
|
6267
|
-
|
|
6366
|
+
export declare class RoleManager<InGuild extends boolean = false> extends CachedManager<"roles", Role, [guildId: string, roleId: string], GuildArgs<InGuild, [roleId: string]>> {
|
|
6367
|
+
/**
|
|
6368
|
+
* The ID of the guild this manager was built for, `undefined` on `client.roles`.
|
|
6369
|
+
*/
|
|
6370
|
+
readonly guildId: InGuild extends true ? string : undefined;
|
|
6371
|
+
/**
|
|
6372
|
+
* @param client The client.
|
|
6373
|
+
* @param guildId The guild to build the manager for.
|
|
6374
|
+
*/
|
|
6375
|
+
constructor(client: GatewayClient, guildId?: string);
|
|
6268
6376
|
protected createStructure(data: CacheEntityTypes["roles"]): Role;
|
|
6269
6377
|
keyOf(data: CacheEntityTypes["roles"]): string;
|
|
6270
6378
|
_hydrate(data: CacheEntityTypes["roles"]): Awaitable<Role>;
|
|
@@ -6275,21 +6383,21 @@ export declare class RoleManager extends CachedManager<"roles", Role, [guildId:
|
|
|
6275
6383
|
* @param guildId The ID of the guild.
|
|
6276
6384
|
* @returns The roles, highest first.
|
|
6277
6385
|
*/
|
|
6278
|
-
fetchAll(
|
|
6386
|
+
fetchAll(...args: GuildArgs<InGuild, []>): Promise<Role[]>;
|
|
6279
6387
|
/**
|
|
6280
6388
|
* Fetches how many members each role of a guild has, `@everyone` excluded.
|
|
6281
6389
|
*
|
|
6282
6390
|
* @param guildId The ID of the guild.
|
|
6283
6391
|
* @returns The member count of every role, by role ID.
|
|
6284
6392
|
*/
|
|
6285
|
-
fetchMemberCounts(
|
|
6393
|
+
fetchMemberCounts(...args: GuildArgs<InGuild, []>): Promise<Map<string, number>>;
|
|
6286
6394
|
/**
|
|
6287
6395
|
* Creates a role.
|
|
6288
6396
|
*
|
|
6289
6397
|
* @param guildId The ID of the guild.
|
|
6290
6398
|
* @param options The role's fields.
|
|
6291
6399
|
*/
|
|
6292
|
-
create(
|
|
6400
|
+
create(...args: GuildArgs<InGuild, [options?: RoleEditOptions]>): Promise<Role>;
|
|
6293
6401
|
/**
|
|
6294
6402
|
* Edits a role.
|
|
6295
6403
|
*
|
|
@@ -6297,7 +6405,7 @@ export declare class RoleManager extends CachedManager<"roles", Role, [guildId:
|
|
|
6297
6405
|
* @param roleId The ID of the role.
|
|
6298
6406
|
* @param options The fields to edit.
|
|
6299
6407
|
*/
|
|
6300
|
-
edit(
|
|
6408
|
+
edit(...args: GuildArgs<InGuild, [roleId: string, options: RoleEditOptions]>): Promise<Role>;
|
|
6301
6409
|
/**
|
|
6302
6410
|
* Deletes a role.
|
|
6303
6411
|
*
|
|
@@ -6305,7 +6413,7 @@ export declare class RoleManager extends CachedManager<"roles", Role, [guildId:
|
|
|
6305
6413
|
* @param roleId The ID of the role.
|
|
6306
6414
|
* @param reason The reason for the audit log.
|
|
6307
6415
|
*/
|
|
6308
|
-
delete(
|
|
6416
|
+
delete(...args: GuildArgs<InGuild, [roleId: string, reason?: string]>): Promise<void>;
|
|
6309
6417
|
/**
|
|
6310
6418
|
* Moves a role among the roles of its guild, like discord.js's `RoleManager#setPosition`.
|
|
6311
6419
|
*
|
|
@@ -6316,7 +6424,7 @@ export declare class RoleManager extends CachedManager<"roles", Role, [guildId:
|
|
|
6316
6424
|
* @param options Whether the position is relative and the reason for the audit log, or the reason alone.
|
|
6317
6425
|
* @returns Every role of the guild, highest first.
|
|
6318
6426
|
*/
|
|
6319
|
-
setPosition(
|
|
6427
|
+
setPosition(...args: GuildArgs<InGuild, [roleId: string, position: number, options?: SetPositionOptions | string]>): Promise<Role[]>;
|
|
6320
6428
|
/**
|
|
6321
6429
|
* Moves several roles at once.
|
|
6322
6430
|
*
|
|
@@ -6325,7 +6433,7 @@ export declare class RoleManager extends CachedManager<"roles", Role, [guildId:
|
|
|
6325
6433
|
* @param reason The reason for the audit log.
|
|
6326
6434
|
* @returns Every role of the guild, highest first.
|
|
6327
6435
|
*/
|
|
6328
|
-
setPositions(
|
|
6436
|
+
setPositions(...args: GuildArgs<InGuild, [positions: readonly RolePosition[], reason?: string]>): Promise<Role[]>;
|
|
6329
6437
|
/**
|
|
6330
6438
|
* Compares the positions of two roles.
|
|
6331
6439
|
*
|
|
@@ -6337,26 +6445,26 @@ export declare class RoleManager extends CachedManager<"roles", Role, [guildId:
|
|
|
6337
6445
|
*
|
|
6338
6446
|
* @param guildId The ID of the guild.
|
|
6339
6447
|
*/
|
|
6340
|
-
everyone(
|
|
6448
|
+
everyone(...args: GuildArgs<InGuild, []>): Promise<Role>;
|
|
6341
6449
|
/**
|
|
6342
6450
|
* Fetches the highest role of a guild.
|
|
6343
6451
|
*
|
|
6344
6452
|
* @param guildId The ID of the guild.
|
|
6345
6453
|
*/
|
|
6346
|
-
highest(
|
|
6454
|
+
highest(...args: GuildArgs<InGuild, []>): Promise<Role | null>;
|
|
6347
6455
|
/**
|
|
6348
6456
|
* Fetches the role Discord gives to the server boosters of a guild, if any.
|
|
6349
6457
|
*
|
|
6350
6458
|
* @param guildId The ID of the guild.
|
|
6351
6459
|
*/
|
|
6352
|
-
premiumSubscriberRole(
|
|
6460
|
+
premiumSubscriberRole(...args: GuildArgs<InGuild, []>): Promise<Role | null>;
|
|
6353
6461
|
/**
|
|
6354
6462
|
* Fetches the role Discord manages for a bot in a guild, if any.
|
|
6355
6463
|
*
|
|
6356
6464
|
* @param guildId The ID of the guild.
|
|
6357
6465
|
* @param botId The ID of the bot user.
|
|
6358
6466
|
*/
|
|
6359
|
-
botRoleFor(
|
|
6467
|
+
botRoleFor(...args: GuildArgs<InGuild, [botId: string]>): Promise<Role | null>;
|
|
6360
6468
|
protected fetchRaw(guildId: string, roleId: string): Promise<{
|
|
6361
6469
|
id: import("discord-api-types/globals").Snowflake;
|
|
6362
6470
|
name: string;
|
|
@@ -7272,10 +7380,23 @@ export interface GuildMembersRequestOptions {
|
|
|
7272
7380
|
}
|
|
7273
7381
|
/**
|
|
7274
7382
|
* Manages the {@link GuildMember}s known to the client.
|
|
7383
|
+
*
|
|
7384
|
+
* `guild.members` (or `client.guilds.members(guildId)`) is this manager built for one guild, like discord.js's:
|
|
7385
|
+
* `cache` takes the user's ID alone, and the methods lose their `guildId` argument.
|
|
7386
|
+
*
|
|
7387
|
+
* @typeParam InGuild Whether the manager was built for one guild.
|
|
7275
7388
|
*/
|
|
7276
|
-
export declare class GuildMemberManager extends CachedManager<"members", GuildMember, [guildId: string, userId: string]
|
|
7389
|
+
export declare class GuildMemberManager<InGuild extends boolean = false> extends CachedManager<"members", GuildMember, [guildId: string, userId: string], GuildArgs<InGuild, [userId: string]>> {
|
|
7277
7390
|
#private;
|
|
7278
|
-
|
|
7391
|
+
/**
|
|
7392
|
+
* The ID of the guild this manager was built for, `undefined` on `client.members`.
|
|
7393
|
+
*/
|
|
7394
|
+
readonly guildId: InGuild extends true ? string : undefined;
|
|
7395
|
+
/**
|
|
7396
|
+
* @param client The client.
|
|
7397
|
+
* @param guildId The guild to build the manager for.
|
|
7398
|
+
*/
|
|
7399
|
+
constructor(client: GatewayClient, guildId?: string);
|
|
7279
7400
|
protected createStructure(data: CacheEntityTypes["members"]): GuildMember;
|
|
7280
7401
|
keyOf(data: CacheEntityTypes["members"]): string;
|
|
7281
7402
|
/**
|
|
@@ -7297,39 +7418,42 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7297
7418
|
private readRelation;
|
|
7298
7419
|
resolveKey(guildId: string, userId: string): string;
|
|
7299
7420
|
/**
|
|
7300
|
-
*
|
|
7301
|
-
*
|
|
7421
|
+
* The bot's own member in a guild, from the cache: `null` when it is not cached. Use
|
|
7422
|
+
* {@link GuildMemberManager.fetchMe} to fall back to the API.
|
|
7302
7423
|
*
|
|
7303
|
-
* @
|
|
7304
|
-
*
|
|
7424
|
+
* @remarks
|
|
7425
|
+
* On the manager of a guild it is a getter, like discord.js's `guild.members.me`: the member itself, or a promise
|
|
7426
|
+
* of it with an asynchronous cache (see `GatewayCacheConfig`). On `client.members` it is a function taking the
|
|
7427
|
+
* guild's ID, synchronous when the member cache is.
|
|
7305
7428
|
*/
|
|
7306
|
-
me(guildId: string)
|
|
7429
|
+
readonly me: InGuild extends true ? CacheRead<GuildMember | null> : (guildId: string) => Awaitable<GuildMember | null>;
|
|
7430
|
+
private cachedMe;
|
|
7307
7431
|
/**
|
|
7308
7432
|
* Fetches the bot's own member in a guild, cache first.
|
|
7309
7433
|
*
|
|
7310
7434
|
* @param guildId The ID of the guild.
|
|
7311
7435
|
*/
|
|
7312
|
-
fetchMe(
|
|
7436
|
+
fetchMe(...args: GuildArgs<InGuild, []>): Promise<GuildMember>;
|
|
7313
7437
|
/**
|
|
7314
7438
|
* Lists the members of a guild, in user ID order, and caches them.
|
|
7315
7439
|
*
|
|
7316
7440
|
* @param guildId The ID of the guild.
|
|
7317
7441
|
* @param options How many members to list (up to 1000), and after which user ID.
|
|
7318
7442
|
*/
|
|
7319
|
-
list(
|
|
7443
|
+
list(...args: GuildArgs<InGuild, [options?: {
|
|
7320
7444
|
limit?: number;
|
|
7321
7445
|
after?: string;
|
|
7322
|
-
}): Promise<GuildMember[]>;
|
|
7446
|
+
}]>): Promise<GuildMember[]>;
|
|
7323
7447
|
/**
|
|
7324
7448
|
* Searches the members of a guild whose username or nickname starts with a query, and caches them.
|
|
7325
7449
|
*
|
|
7326
7450
|
* @param guildId The ID of the guild.
|
|
7327
7451
|
* @param options The query, and how many members to return (up to 1000).
|
|
7328
7452
|
*/
|
|
7329
|
-
search(
|
|
7453
|
+
search(...args: GuildArgs<InGuild, [options: {
|
|
7330
7454
|
query: string;
|
|
7331
7455
|
limit?: number;
|
|
7332
|
-
}): Promise<GuildMember[]>;
|
|
7456
|
+
}]>): Promise<GuildMember[]>;
|
|
7333
7457
|
/**
|
|
7334
7458
|
* Requests the members of a guild over the gateway, every one of them by default, and caches them. discord.js:
|
|
7335
7459
|
* `guild.members.fetch()` without a user.
|
|
@@ -7343,7 +7467,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7343
7467
|
* @param options Which members to request.
|
|
7344
7468
|
* @returns The members, once the last chunk is cached.
|
|
7345
7469
|
*/
|
|
7346
|
-
request(
|
|
7470
|
+
request(...args: GuildArgs<InGuild, [options?: GuildMembersRequestOptions]>): Promise<GuildMember[]>;
|
|
7347
7471
|
/**
|
|
7348
7472
|
* Adds a cached chunk of members to the request with its nonce, resolving it with the last chunk.
|
|
7349
7473
|
*
|
|
@@ -7363,7 +7487,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7363
7487
|
* @param userId The ID of the user.
|
|
7364
7488
|
* @param options The access token and the member's initial state.
|
|
7365
7489
|
*/
|
|
7366
|
-
add(
|
|
7490
|
+
add(...args: GuildArgs<InGuild, [userId: string, options: GuildMemberAddOptions]>): Promise<GuildMember>;
|
|
7367
7491
|
/**
|
|
7368
7492
|
* Edits a member.
|
|
7369
7493
|
*
|
|
@@ -7371,14 +7495,14 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7371
7495
|
* @param userId The ID of the member's user.
|
|
7372
7496
|
* @param options The fields to edit.
|
|
7373
7497
|
*/
|
|
7374
|
-
edit(
|
|
7498
|
+
edit(...args: GuildArgs<InGuild, [userId: string, options: GuildMemberEditOptions]>): Promise<GuildMember>;
|
|
7375
7499
|
/**
|
|
7376
7500
|
* Edits the bot's own member.
|
|
7377
7501
|
*
|
|
7378
7502
|
* @param guildId The ID of the guild.
|
|
7379
7503
|
* @param options The fields to edit.
|
|
7380
7504
|
*/
|
|
7381
|
-
editMe(
|
|
7505
|
+
editMe(...args: GuildArgs<InGuild, [options: GuildMemberEditMeOptions]>): Promise<GuildMember>;
|
|
7382
7506
|
/**
|
|
7383
7507
|
* Kicks a member.
|
|
7384
7508
|
*
|
|
@@ -7386,7 +7510,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7386
7510
|
* @param userId The ID of the member's user.
|
|
7387
7511
|
* @param reason The reason for the audit log.
|
|
7388
7512
|
*/
|
|
7389
|
-
kick(
|
|
7513
|
+
kick(...args: GuildArgs<InGuild, [userId: string, reason?: string]>): Promise<void>;
|
|
7390
7514
|
/**
|
|
7391
7515
|
* Bans a user, member or not.
|
|
7392
7516
|
*
|
|
@@ -7394,7 +7518,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7394
7518
|
* @param userId The ID of the user.
|
|
7395
7519
|
* @param options How many seconds of messages to delete, and the reason for the audit log.
|
|
7396
7520
|
*/
|
|
7397
|
-
ban(
|
|
7521
|
+
ban(...args: GuildArgs<InGuild, [userId: string, options?: BanOptions]>): Promise<void>;
|
|
7398
7522
|
/**
|
|
7399
7523
|
* Lifts a user's ban.
|
|
7400
7524
|
*
|
|
@@ -7402,7 +7526,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7402
7526
|
* @param userId The ID of the user.
|
|
7403
7527
|
* @param reason The reason for the audit log.
|
|
7404
7528
|
*/
|
|
7405
|
-
unban(
|
|
7529
|
+
unban(...args: GuildArgs<InGuild, [userId: string, reason?: string]>): Promise<void>;
|
|
7406
7530
|
/**
|
|
7407
7531
|
* Bans up to 200 users at once.
|
|
7408
7532
|
*
|
|
@@ -7411,7 +7535,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7411
7535
|
* @param options How many seconds of messages to delete, and the reason for the audit log.
|
|
7412
7536
|
* @returns The users that were banned, and the ones that could not be.
|
|
7413
7537
|
*/
|
|
7414
|
-
bulkBan(
|
|
7538
|
+
bulkBan(...args: GuildArgs<InGuild, [userIds: readonly string[], options?: BanOptions]>): Promise<{
|
|
7415
7539
|
bannedUsers: string[];
|
|
7416
7540
|
failedUsers: string[];
|
|
7417
7541
|
}>;
|
|
@@ -7422,7 +7546,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7422
7546
|
* @param options The inactivity threshold and the roles to include.
|
|
7423
7547
|
* @returns How many members were (or would be) pruned, `null` when `count` is `false`.
|
|
7424
7548
|
*/
|
|
7425
|
-
prune(
|
|
7549
|
+
prune(...args: GuildArgs<InGuild, [options?: GuildPruneOptions]>): Promise<number | null>;
|
|
7426
7550
|
/**
|
|
7427
7551
|
* Adds a role to a member.
|
|
7428
7552
|
*
|
|
@@ -7431,7 +7555,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7431
7555
|
* @param roleId The ID of the role.
|
|
7432
7556
|
* @param reason The reason for the audit log.
|
|
7433
7557
|
*/
|
|
7434
|
-
addRole(
|
|
7558
|
+
addRole(...args: GuildArgs<InGuild, [userId: string, roleId: string, reason?: string]>): Promise<void>;
|
|
7435
7559
|
/**
|
|
7436
7560
|
* Removes a role from a member.
|
|
7437
7561
|
*
|
|
@@ -7440,7 +7564,7 @@ export declare class GuildMemberManager extends CachedManager<"members", GuildMe
|
|
|
7440
7564
|
* @param roleId The ID of the role.
|
|
7441
7565
|
* @param reason The reason for the audit log.
|
|
7442
7566
|
*/
|
|
7443
|
-
removeRole(
|
|
7567
|
+
removeRole(...args: GuildArgs<InGuild, [userId: string, roleId: string, reason?: string]>): Promise<void>;
|
|
7444
7568
|
protected fetchRaw(guildId: string, userId: string): Promise<{
|
|
7445
7569
|
nick?: string | null;
|
|
7446
7570
|
roles: import("discord-api-types/globals").Snowflake[];
|
|
@@ -8121,6 +8245,128 @@ export declare class GuildInviteManager extends CachedManager<"invites", GuildIn
|
|
|
8121
8245
|
private toCached;
|
|
8122
8246
|
}
|
|
8123
8247
|
//#endregion
|
|
8248
|
+
//#region src/managers/PresenceManager.d.ts
|
|
8249
|
+
/**
|
|
8250
|
+
* Manages the presences of guild members.
|
|
8251
|
+
*
|
|
8252
|
+
* @remarks
|
|
8253
|
+
* Presences only come from the gateway, with the `GuildPresences` intent: there is no API to fetch them, so `fetch`
|
|
8254
|
+
* rejects on a cache miss. Use `cache.get`, which answers `undefined` instead.
|
|
8255
|
+
*
|
|
8256
|
+
* The cache is keyed by guild and user. `guild.presences` (or `client.guilds.presences(guildId)`) reads it by user
|
|
8257
|
+
* ID alone, like discord.js: `guild.presences.cache.get(userId)`.
|
|
8258
|
+
*
|
|
8259
|
+
* `guild.presences` (or `client.guilds.presences(guildId)`) is this manager built for one guild, like discord.js's:
|
|
8260
|
+
* `cache` takes the user's ID alone, and the methods lose their `guildId` argument.
|
|
8261
|
+
*
|
|
8262
|
+
* @typeParam InGuild Whether the manager was built for one guild.
|
|
8263
|
+
*/
|
|
8264
|
+
export declare class PresenceManager<InGuild extends boolean = false> extends CachedManager<"presences", Presence, [guildId: string, userId: string], GuildArgs<InGuild, [userId: string]>> {
|
|
8265
|
+
/**
|
|
8266
|
+
* The ID of the guild this manager was built for, `undefined` on `client.presences`.
|
|
8267
|
+
*/
|
|
8268
|
+
readonly guildId: InGuild extends true ? string : undefined;
|
|
8269
|
+
/**
|
|
8270
|
+
* @param client The client.
|
|
8271
|
+
* @param guildId The guild to build the manager for.
|
|
8272
|
+
*/
|
|
8273
|
+
constructor(client: GatewayClient, guildId?: string);
|
|
8274
|
+
protected createStructure(data: CacheEntityTypes["presences"]): Presence;
|
|
8275
|
+
keyOf(data: CacheEntityTypes["presences"]): string;
|
|
8276
|
+
resolveKey(guildId: string, userId: string): string;
|
|
8277
|
+
_hydrate(data: CacheEntityTypes["presences"]): Awaitable<Presence>;
|
|
8278
|
+
/**
|
|
8279
|
+
* Resolves a {@link PresenceResolvable} to the cached presence of its user in a guild.
|
|
8280
|
+
*
|
|
8281
|
+
* @remarks
|
|
8282
|
+
* A string is a **user ID**, not a cache key: read `guild.presences.cache.get(userId)`, or build the key with
|
|
8283
|
+
* {@link PresenceManager.resolveKey} to read `cache.get` directly. It is a pure cache read, no request is made and
|
|
8284
|
+
* a miss is `null`; presences only come from the gateway.
|
|
8285
|
+
*
|
|
8286
|
+
* The guild comes from a member or a message, else from a thread member's member or thread, and otherwise from
|
|
8287
|
+
* `guildId`. A message sent in a direct message belongs to no guild, so it resolves to `null` unless `guildId` is
|
|
8288
|
+
* given.
|
|
8289
|
+
*
|
|
8290
|
+
* @param presence The presence, something holding a user, or a user ID.
|
|
8291
|
+
* @param guildId The guild to look the presence up in, when the value carries none.
|
|
8292
|
+
* @returns The presence, or `null` if it is not cached or its guild is unknown.
|
|
8293
|
+
*/
|
|
8294
|
+
resolve(presence: PresenceResolvable, guildId?: string): Awaitable<Presence | null>;
|
|
8295
|
+
/**
|
|
8296
|
+
* Resolves a {@link PresenceResolvable} to a user ID.
|
|
8297
|
+
*
|
|
8298
|
+
* @remarks
|
|
8299
|
+
* This is the ID of the presence's user, like discord.js, and not the cache key {@link PresenceManager.resolveKey}
|
|
8300
|
+
* builds from a guild and a user.
|
|
8301
|
+
*
|
|
8302
|
+
* @param presence The presence, something holding a user, or a user ID.
|
|
8303
|
+
* @returns The user ID, or `null` if the value holds none.
|
|
8304
|
+
*/
|
|
8305
|
+
resolveId(presence: PresenceResolvable): string | null;
|
|
8306
|
+
private guildOf;
|
|
8307
|
+
/**
|
|
8308
|
+
* Lists the cached presences of a guild.
|
|
8309
|
+
*
|
|
8310
|
+
* @param guildId The ID of the guild.
|
|
8311
|
+
* @returns The cached entries, `[]` when this entity is not cached.
|
|
8312
|
+
* @throws {TypeError} When the store cannot enumerate its entries.
|
|
8313
|
+
*/
|
|
8314
|
+
listCached(...args: GuildArgs<InGuild, []>): Promise<Presence[]>;
|
|
8315
|
+
protected fetchRaw(guildId: string, userId: string): Promise<CacheEntityTypes["presences"]>;
|
|
8316
|
+
}
|
|
8317
|
+
//#endregion
|
|
8318
|
+
//#region src/managers/VoiceStateManager.d.ts
|
|
8319
|
+
/**
|
|
8320
|
+
* Manages the voice states of the members connected to voice channels.
|
|
8321
|
+
*
|
|
8322
|
+
* @remarks
|
|
8323
|
+
* The cache holds them when the bot has the `GuildVoiceStates` intent. `fetch` falls back to the API, which only
|
|
8324
|
+
* knows the voice states of connected members.
|
|
8325
|
+
*
|
|
8326
|
+
* `guild.voiceStates` (or `client.guilds.voiceStates(guildId)`) is this manager built for one guild, like
|
|
8327
|
+
* discord.js's: `cache` takes the user's ID alone, and the methods lose their `guildId` argument.
|
|
8328
|
+
*
|
|
8329
|
+
* @typeParam InGuild Whether the manager was built for one guild.
|
|
8330
|
+
*/
|
|
8331
|
+
export declare class VoiceStateManager<InGuild extends boolean = false> extends CachedManager<"voiceStates", VoiceState, [guildId: string, userId: string], GuildArgs<InGuild, [userId: string]>> {
|
|
8332
|
+
/**
|
|
8333
|
+
* The ID of the guild this manager was built for, `undefined` on `client.voiceStates`.
|
|
8334
|
+
*/
|
|
8335
|
+
readonly guildId: InGuild extends true ? string : undefined;
|
|
8336
|
+
/**
|
|
8337
|
+
* @param client The client.
|
|
8338
|
+
* @param guildId The guild to build the manager for.
|
|
8339
|
+
*/
|
|
8340
|
+
constructor(client: GatewayClient, guildId?: string);
|
|
8341
|
+
protected createStructure(data: CacheEntityTypes["voiceStates"]): VoiceState;
|
|
8342
|
+
keyOf(data: CacheEntityTypes["voiceStates"]): string;
|
|
8343
|
+
resolveKey(guildId: string, userId: string): string;
|
|
8344
|
+
_hydrate(data: CacheEntityTypes["voiceStates"]): Awaitable<VoiceState>;
|
|
8345
|
+
/**
|
|
8346
|
+
* Lists the cached voice states of a guild.
|
|
8347
|
+
*
|
|
8348
|
+
* @param guildId The ID of the guild.
|
|
8349
|
+
* @returns The cached entries, `[]` when this entity is not cached.
|
|
8350
|
+
* @throws {TypeError} When the store cannot enumerate its entries.
|
|
8351
|
+
*/
|
|
8352
|
+
listCached(...args: GuildArgs<InGuild, []>): Promise<VoiceState[]>;
|
|
8353
|
+
protected fetchRaw(guildId: string, userId: string): Promise<{
|
|
8354
|
+
channel_id: import("discord-api-types/globals").Snowflake | null;
|
|
8355
|
+
user_id: import("discord-api-types/globals").Snowflake;
|
|
8356
|
+
member?: import("discord-api-types/v10").APIGuildMember;
|
|
8357
|
+
session_id: string;
|
|
8358
|
+
deaf: boolean;
|
|
8359
|
+
mute: boolean;
|
|
8360
|
+
self_deaf: boolean;
|
|
8361
|
+
self_mute: boolean;
|
|
8362
|
+
self_stream?: boolean;
|
|
8363
|
+
self_video: boolean;
|
|
8364
|
+
suppress: boolean;
|
|
8365
|
+
request_to_speak_timestamp: string | null;
|
|
8366
|
+
guild_id: string;
|
|
8367
|
+
}>;
|
|
8368
|
+
}
|
|
8369
|
+
//#endregion
|
|
8124
8370
|
//#region src/managers/GuildManager.d.ts
|
|
8125
8371
|
/**
|
|
8126
8372
|
* Until when to pause invites and direct messages in a guild, at most 24 hours ahead; `null` resumes them.
|
|
@@ -8385,6 +8631,30 @@ export declare class GuildManager extends CachedManager<"guilds", Guild, [guildI
|
|
|
8385
8631
|
* @param guildId The ID of the guild.
|
|
8386
8632
|
*/
|
|
8387
8633
|
invites(guildId: string): GuildInviteManager;
|
|
8634
|
+
/**
|
|
8635
|
+
* Gets the manager of a guild's presences.
|
|
8636
|
+
*
|
|
8637
|
+
* @param guildId The ID of the guild.
|
|
8638
|
+
*/
|
|
8639
|
+
presences(guildId: string): PresenceManager<true>;
|
|
8640
|
+
/**
|
|
8641
|
+
* Gets the manager of a guild's members.
|
|
8642
|
+
*
|
|
8643
|
+
* @param guildId The ID of the guild.
|
|
8644
|
+
*/
|
|
8645
|
+
members(guildId: string): GuildMemberManager<true>;
|
|
8646
|
+
/**
|
|
8647
|
+
* Gets the manager of a guild's roles.
|
|
8648
|
+
*
|
|
8649
|
+
* @param guildId The ID of the guild.
|
|
8650
|
+
*/
|
|
8651
|
+
roles(guildId: string): RoleManager<true>;
|
|
8652
|
+
/**
|
|
8653
|
+
* Gets the manager of a guild's voice states.
|
|
8654
|
+
*
|
|
8655
|
+
* @param guildId The ID of the guild.
|
|
8656
|
+
*/
|
|
8657
|
+
voiceStates(guildId: string): VoiceStateManager<true>;
|
|
8388
8658
|
/**
|
|
8389
8659
|
* Lists the guilds the bot is in, as the partial guilds the API returns, paginated by guild ID.
|
|
8390
8660
|
*
|
|
@@ -8954,6 +9224,22 @@ export declare class Guild extends AnonymousGuild<CacheEntityTypes["guilds"]> {
|
|
|
8954
9224
|
* The invites of the guild.
|
|
8955
9225
|
*/
|
|
8956
9226
|
get invites(): GuildInviteManager;
|
|
9227
|
+
/**
|
|
9228
|
+
* The presences of the guild: `guild.presences.cache.get(userId)`.
|
|
9229
|
+
*/
|
|
9230
|
+
get presences(): PresenceManager<true>;
|
|
9231
|
+
/**
|
|
9232
|
+
* The members of the guild: `guild.members.cache.get(userId)`.
|
|
9233
|
+
*/
|
|
9234
|
+
get members(): GuildMemberManager<true>;
|
|
9235
|
+
/**
|
|
9236
|
+
* The roles of the guild: `guild.roles.cache.get(roleId)`.
|
|
9237
|
+
*/
|
|
9238
|
+
get roles(): RoleManager<true>;
|
|
9239
|
+
/**
|
|
9240
|
+
* The voice states of the guild: `guild.voiceStates.cache.get(userId)`.
|
|
9241
|
+
*/
|
|
9242
|
+
get voiceStates(): VoiceStateManager<true>;
|
|
8957
9243
|
/**
|
|
8958
9244
|
* Gets the URL of the guild's discovery splash image, or `null` if it has none.
|
|
8959
9245
|
* @param options The image options.
|
|
@@ -10041,99 +10327,6 @@ export declare class ChannelManager extends CachedManager<"channels", AnyChannel
|
|
|
10041
10327
|
protected fetchRaw(channelId: string): Promise<import("discord-api-types/v10").APIChannel>;
|
|
10042
10328
|
}
|
|
10043
10329
|
//#endregion
|
|
10044
|
-
//#region src/managers/VoiceStateManager.d.ts
|
|
10045
|
-
/**
|
|
10046
|
-
* Manages the voice states of the members connected to voice channels.
|
|
10047
|
-
*
|
|
10048
|
-
* @remarks
|
|
10049
|
-
* The cache holds them when the bot has the `GuildVoiceStates` intent. `fetch` falls back to the API, which only
|
|
10050
|
-
* knows the voice states of connected members.
|
|
10051
|
-
*/
|
|
10052
|
-
export declare class VoiceStateManager extends CachedManager<"voiceStates", VoiceState, [guildId: string, userId: string]> {
|
|
10053
|
-
constructor(client: GatewayClient);
|
|
10054
|
-
protected createStructure(data: CacheEntityTypes["voiceStates"]): VoiceState;
|
|
10055
|
-
keyOf(data: CacheEntityTypes["voiceStates"]): string;
|
|
10056
|
-
resolveKey(guildId: string, userId: string): string;
|
|
10057
|
-
_hydrate(data: CacheEntityTypes["voiceStates"]): Awaitable<VoiceState>;
|
|
10058
|
-
/**
|
|
10059
|
-
* Lists the cached voice states of a guild.
|
|
10060
|
-
*
|
|
10061
|
-
* @param guildId The ID of the guild.
|
|
10062
|
-
* @returns The cached entries, `[]` when this entity is not cached.
|
|
10063
|
-
* @throws {TypeError} When the store cannot enumerate its entries.
|
|
10064
|
-
*/
|
|
10065
|
-
listCached(guildId: string): Promise<VoiceState[]>;
|
|
10066
|
-
protected fetchRaw(guildId: string, userId: string): Promise<{
|
|
10067
|
-
channel_id: import("discord-api-types/globals").Snowflake | null;
|
|
10068
|
-
user_id: import("discord-api-types/globals").Snowflake;
|
|
10069
|
-
member?: import("discord-api-types/v10").APIGuildMember;
|
|
10070
|
-
session_id: string;
|
|
10071
|
-
deaf: boolean;
|
|
10072
|
-
mute: boolean;
|
|
10073
|
-
self_deaf: boolean;
|
|
10074
|
-
self_mute: boolean;
|
|
10075
|
-
self_stream?: boolean;
|
|
10076
|
-
self_video: boolean;
|
|
10077
|
-
suppress: boolean;
|
|
10078
|
-
request_to_speak_timestamp: string | null;
|
|
10079
|
-
guild_id: string;
|
|
10080
|
-
}>;
|
|
10081
|
-
}
|
|
10082
|
-
//#endregion
|
|
10083
|
-
//#region src/managers/PresenceManager.d.ts
|
|
10084
|
-
/**
|
|
10085
|
-
* Manages the presences of guild members.
|
|
10086
|
-
*
|
|
10087
|
-
* @remarks
|
|
10088
|
-
* Presences only come from the gateway, with the `GuildPresences` intent: there is no API to fetch them, so `fetch`
|
|
10089
|
-
* rejects on a cache miss. Use `cache.get`, which answers `undefined` instead.
|
|
10090
|
-
*/
|
|
10091
|
-
export declare class PresenceManager extends CachedManager<"presences", Presence, [guildId: string, userId: string]> {
|
|
10092
|
-
constructor(client: GatewayClient);
|
|
10093
|
-
protected createStructure(data: CacheEntityTypes["presences"]): Presence;
|
|
10094
|
-
keyOf(data: CacheEntityTypes["presences"]): string;
|
|
10095
|
-
resolveKey(guildId: string, userId: string): string;
|
|
10096
|
-
_hydrate(data: CacheEntityTypes["presences"]): Awaitable<Presence>;
|
|
10097
|
-
/**
|
|
10098
|
-
* Resolves a {@link PresenceResolvable} to the cached presence of its user in a guild.
|
|
10099
|
-
*
|
|
10100
|
-
* @remarks
|
|
10101
|
-
* A string is a **user ID**, not a cache key: build the key with {@link PresenceManager.resolveKey} to read
|
|
10102
|
-
* `cache.get` directly. It is a pure cache read, no request is made and a miss is `null`; presences only come from
|
|
10103
|
-
* the gateway.
|
|
10104
|
-
*
|
|
10105
|
-
* The guild comes from a member or a message, else from a thread member's member or thread, and otherwise from
|
|
10106
|
-
* `guildId`. A message sent in a direct message belongs to no guild, so it resolves to `null` unless `guildId` is
|
|
10107
|
-
* given.
|
|
10108
|
-
*
|
|
10109
|
-
* @param presence The presence, something holding a user, or a user ID.
|
|
10110
|
-
* @param guildId The guild to look the presence up in, when the value carries none.
|
|
10111
|
-
* @returns The presence, or `null` if it is not cached or its guild is unknown.
|
|
10112
|
-
*/
|
|
10113
|
-
resolve(presence: PresenceResolvable, guildId?: string): Awaitable<Presence | null>;
|
|
10114
|
-
/**
|
|
10115
|
-
* Resolves a {@link PresenceResolvable} to a user ID.
|
|
10116
|
-
*
|
|
10117
|
-
* @remarks
|
|
10118
|
-
* This is the ID of the presence's user, like discord.js, and not the cache key {@link PresenceManager.resolveKey}
|
|
10119
|
-
* builds from a guild and a user.
|
|
10120
|
-
*
|
|
10121
|
-
* @param presence The presence, something holding a user, or a user ID.
|
|
10122
|
-
* @returns The user ID, or `null` if the value holds none.
|
|
10123
|
-
*/
|
|
10124
|
-
resolveId(presence: PresenceResolvable): string | null;
|
|
10125
|
-
private guildOf;
|
|
10126
|
-
/**
|
|
10127
|
-
* Lists the cached presences of a guild.
|
|
10128
|
-
*
|
|
10129
|
-
* @param guildId The ID of the guild.
|
|
10130
|
-
* @returns The cached entries, `[]` when this entity is not cached.
|
|
10131
|
-
* @throws {TypeError} When the store cannot enumerate its entries.
|
|
10132
|
-
*/
|
|
10133
|
-
listCached(guildId: string): Promise<Presence[]>;
|
|
10134
|
-
protected fetchRaw(guildId: string, userId: string): Promise<CacheEntityTypes["presences"]>;
|
|
10135
|
-
}
|
|
10136
|
-
//#endregion
|
|
10137
10330
|
//#region src/managers/UserManager.d.ts
|
|
10138
10331
|
/**
|
|
10139
10332
|
* The options to open a direct message channel with.
|
|
@@ -12660,5 +12853,5 @@ export interface TransformedResolvedData {
|
|
|
12660
12853
|
*/
|
|
12661
12854
|
export declare function transformResolved({ client, guildId }: SupportingResolvedData, { users, members, roles, channels }: ResolvableData): Awaitable<TransformedResolvedData>;
|
|
12662
12855
|
//#endregion
|
|
12663
|
-
export { type AllowedPartial, type AnnouncementChannelResolvable, type ApplicationCommandDataResolvable, type ApplicationCommandPermissionIdResolvable, type ApplicationCommandResolvable, type ApplicationResolvable, type AttachmentPayload, type AttachmentResolvable, type AutoModerationRuleResolvable, type BaseMessageOptions, BitField, type BitFieldResolvable, type BufferResolvable, type Cache, type CacheConstructor, type CacheConstructorOptions, type CacheEntityOptions, type CacheRead, type CacheReadOf, type CategoryChannelResolvable, type ChannelResolvable, type ColorResolvable, type CommandOptionDataTypeResolvable, type ComponentEmojiResolvable, type DateResolvable, type EmojiResolvable, type EntitlementResolvable, type ForwardOptions, type GatewayCacheConfig, type GatewayClientMessageDefaults, type GuildAuditLogsResolvable, type GuildBanResolvable, type GuildBasedChannel, type GuildChannelResolvable, type GuildInvitableChannel, type GuildInvitableChannelResolvable, type GuildInviteResolvable, type GuildResolvable, type GuildScheduledEventResolvable, type GuildSearchMessagesOptions, type GuildSearchMessagesResult, type GuildTemplateResolvable, type GuildTextBasedChannel, type GuildTextChannelResolvable, type GuildVoiceChannelResolvable, type HexColorString, type If, type InviteResolvable, type JSONEncodable, type MessageActionRowComponentResolvable, type MessageCreateOptions, type MessageEditOptions, type MessageMentionOptions, type MessagePayloadContext, type MessagePayloadOptions, type MessagePayloadResolvable, type MessageReactionResolvable, type MessageResolvable, type MessageTarget, type NonThreadGuildBasedChannel, type OverwriteResolvable, type Partialize, type PermissionOverwriteResolvable, PermissionsBitField, type PollCreateData, type PresenceResolvable, type RawAPIType, type ReplyOptions, type ResolvedMessagePayload, type RoleColorsEditResolvable, type RoleColorsResolvable, type RoleResolvable, type RoleResolvables, type SKUResolvable, type SoundboardSoundResolvable, type StageChannelResolvable, type StageInstanceResolvable, type StickerResolvable, type StructureCreator, type SubscriptionResolvable, type TextBasedChannel, type TextBasedChannelResolvable, type TextChannelResolvable, type ThreadChannel, type ThreadChannelResolvable, type ThreadMemberResolvable, type UserResolvable, type VoiceBasedChannel, type VoiceChannelResolvable, type WebhookMessageCreateOptions, type WebhookMessageEditOptions, type WebhookMessageOptions, type WebhookThreadOptions, type cacheRead, type cachedChannel, type cachedGuild, type cachedMember, type cachedMessage, type cachedPresence, type cachedRole, type cachedUser, type cachedVoiceState, type isPromiseLike, type peekCache, type pickCached, type readCached, type refreshRelations, type syncOnly, type whenAll, type whenCachedMap };
|
|
12856
|
+
export { type AllowedPartial, type AnnouncementChannelResolvable, type ApplicationCommandDataResolvable, type ApplicationCommandPermissionIdResolvable, type ApplicationCommandResolvable, type ApplicationResolvable, type AttachmentPayload, type AttachmentResolvable, type AutoModerationRuleResolvable, type BaseMessageOptions, BitField, type BitFieldResolvable, type BufferResolvable, type Cache, type CacheConstructor, type CacheConstructorOptions, type CacheEntityOptions, type CacheRead, type CacheReadOf, type CategoryChannelResolvable, type ChannelResolvable, type ColorResolvable, type CommandOptionDataTypeResolvable, type ComponentEmojiResolvable, type DateResolvable, type EmojiResolvable, type EntitlementResolvable, type ForwardOptions, type GatewayCacheConfig, type GatewayClientMessageDefaults, type GuildAuditLogsResolvable, type GuildBanResolvable, type GuildBasedChannel, type GuildChannelResolvable, type GuildInvitableChannel, type GuildInvitableChannelResolvable, type GuildInviteResolvable, type GuildResolvable, type GuildScheduledEventResolvable, type GuildSearchMessagesOptions, type GuildSearchMessagesResult, type GuildTemplateResolvable, type GuildTextBasedChannel, type GuildTextChannelResolvable, type GuildVoiceChannelResolvable, type HexColorString, type If, type InviteResolvable, type JSONEncodable, type MessageActionRowComponentResolvable, type MessageCreateOptions, type MessageEditOptions, type MessageMentionOptions, type MessagePayloadContext, type MessagePayloadOptions, type MessagePayloadResolvable, type MessageReactionResolvable, type MessageResolvable, type MessageTarget, type NonThreadGuildBasedChannel, type OverwriteResolvable, type Partialize, type PermissionOverwriteResolvable, PermissionsBitField, type PollCreateData, type PresenceResolvable, type RawAPIType, type ReplyOptions, type ResolvedMessagePayload, type RoleColorsEditResolvable, type RoleColorsResolvable, type RoleResolvable, type RoleResolvables, type SKUResolvable, type ScopedCache, type SoundboardSoundResolvable, type StageChannelResolvable, type StageInstanceResolvable, type StickerResolvable, type StructureCreator, type SubscriptionResolvable, type TextBasedChannel, type TextBasedChannelResolvable, type TextChannelResolvable, type ThreadChannel, type ThreadChannelResolvable, type ThreadMemberResolvable, type UserResolvable, type VoiceBasedChannel, type VoiceChannelResolvable, type WebhookMessageCreateOptions, type WebhookMessageEditOptions, type WebhookMessageOptions, type WebhookThreadOptions, type cacheRead, type cachedChannel, type cachedGuild, type cachedMember, type cachedMessage, type cachedPresence, type cachedRole, type cachedUser, type cachedVoiceState, type isPromiseLike, type peekCache, type pickCached, type readCached, type refreshRelations, type scopeCache, type syncOnly, type whenAll, type whenCachedMap };
|
|
12664
12857
|
//# sourceMappingURL=index.d.ts.map
|