feat(Sharding): change waitForReady to spawnTimeout (#3080)

This means that you'll not only be able to choose between having a timeout or not, but also to set the amount of milliseconds as you wish.
This commit is contained in:
Antonio Román
2019-04-21 13:34:09 +02:00
committed by SpaceEEC
parent abd9d36816
commit 01c708bc75
4 changed files with 29 additions and 24 deletions

10
typings/index.d.ts vendored
View File

@@ -921,9 +921,9 @@ declare module 'discord.js' {
public eval<T>(fn: (client: Client) => T): Promise<T[]>;
public fetchClientValue(prop: string): Promise<any>;
public kill(): void;
public respawn(delay?: number, waitForReady?: boolean): Promise<ChildProcess>;
public respawn(delay?: number, spawnTimeout?: number): Promise<ChildProcess>;
public send(message: any): Promise<Shard>;
public spawn(waitForReady?: boolean): Promise<ChildProcess>;
public spawn(spawnTimeout?: number): Promise<ChildProcess>;
public on(event: 'death', listener: (child: ChildProcess) => void): this;
public on(event: 'disconnect' | 'ready' | 'reconnecting', listener: () => void): this;
@@ -953,7 +953,7 @@ declare module 'discord.js' {
public broadcastEval(script: string): Promise<any[]>;
public broadcastEval<T>(fn: (client: Client) => T): Promise<T[]>;
public fetchClientValues(prop: string): Promise<any[]>;
public respawnAll(shardDelay?: number, respawnDelay?: number, waitForReady?: boolean): Promise<void>;
public respawnAll(shardDelay?: number, respawnDelay?: number, spawnTimeout?: number): Promise<void>;
public send(message: any): Promise<void>;
public static singleton(client: Client, mode: ShardingManagerMode): ShardClientUtil;
@@ -979,8 +979,8 @@ declare module 'discord.js' {
public broadcastEval(script: string): Promise<any[]>;
public createShard(id: number): Shard;
public fetchClientValues(prop: string): Promise<any[]>;
public respawnAll(shardDelay?: number, respawnDelay?: number, waitForReady?: boolean): Promise<Collection<number, Shard>>;
public spawn(amount?: number | 'auto', delay?: number, waitForReady?: boolean): Promise<Collection<number, Shard>>;
public respawnAll(shardDelay?: number, respawnDelay?: number, spawnTimeout?: number): Promise<Collection<number, Shard>>;
public spawn(amount?: number | 'auto', delay?: number, spawnTimeout?: number): Promise<Collection<number, Shard>>;
public on(event: 'shardCreate', listener: (shard: Shard) => void): this;