mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(Shard): shard-specific broadcastEval/fetchClientValues + shard Id util (#4991)
This commit is contained in:
committed by
GitHub
parent
643f96c79b
commit
2a6c363a8a
9
typings/index.d.ts
vendored
9
typings/index.d.ts
vendored
@@ -1352,12 +1352,16 @@ declare module 'discord.js' {
|
||||
public mode: ShardingManagerMode;
|
||||
public parentPort: any | null;
|
||||
public broadcastEval(script: string): Promise<any[]>;
|
||||
public broadcastEval(script: string, shard: number): Promise<any>;
|
||||
public broadcastEval<T>(fn: (client: Client) => T): Promise<T[]>;
|
||||
public broadcastEval<T>(fn: (client: Client) => T, shard: number): Promise<T>;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||
public respawnAll(shardDelay?: number, respawnDelay?: number, spawnTimeout?: number): Promise<void>;
|
||||
public send(message: any): Promise<void>;
|
||||
|
||||
public static singleton(client: Client, mode: ShardingManagerMode): ShardClientUtil;
|
||||
public static shardIDForGuildID(guildID: Snowflake, shardCount: number): number;
|
||||
}
|
||||
|
||||
export class ShardingManager extends EventEmitter {
|
||||
@@ -1373,6 +1377,8 @@ declare module 'discord.js' {
|
||||
execArgv?: string[];
|
||||
},
|
||||
);
|
||||
private _performOnShards(method: string, args: any[]): Promise<any[]>;
|
||||
private _performOnShards(method: string, args: any[], shard: number): Promise<any>;
|
||||
|
||||
public file: string;
|
||||
public respawn: boolean;
|
||||
@@ -1382,8 +1388,10 @@ declare module 'discord.js' {
|
||||
public totalShards: number | 'auto';
|
||||
public broadcast(message: any): Promise<Shard[]>;
|
||||
public broadcastEval(script: string): Promise<any[]>;
|
||||
public broadcastEval(script: string, shard: number): Promise<any>;
|
||||
public createShard(id: number): Shard;
|
||||
public fetchClientValues(prop: string): Promise<any[]>;
|
||||
public fetchClientValues(prop: string, shard: number): Promise<any>;
|
||||
public respawnAll(
|
||||
shardDelay?: number,
|
||||
respawnDelay?: number,
|
||||
@@ -1399,6 +1407,7 @@ declare module 'discord.js' {
|
||||
export class SnowflakeUtil {
|
||||
public static deconstruct(snowflake: Snowflake): DeconstructedSnowflake;
|
||||
public static generate(timestamp?: number | Date): Snowflake;
|
||||
public static readonly EPOCH: number;
|
||||
}
|
||||
|
||||
export class Speaking extends BitField<SpeakingString> {
|
||||
|
||||
Reference in New Issue
Block a user