mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Fix naming conflict with ShardingManager#respawn
This commit is contained in:
@@ -259,7 +259,7 @@ class Shard extends EventEmitter {
|
|||||||
// Shard is requesting a respawn of all shards
|
// Shard is requesting a respawn of all shards
|
||||||
if (message._sRespawnAll) {
|
if (message._sRespawnAll) {
|
||||||
const { shardDelay, respawnDelay, waitForReady } = message._sRespawnAll;
|
const { shardDelay, respawnDelay, waitForReady } = message._sRespawnAll;
|
||||||
this.manager.respawn(shardDelay, respawnDelay, waitForReady).catch(() => {
|
this.manager.respawnAll(shardDelay, respawnDelay, waitForReady).catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class ShardClientUtil {
|
|||||||
* (in milliseconds)
|
* (in milliseconds)
|
||||||
* @param {boolean} [waitForReady=true] Whether to wait for a shard to become ready before continuing to another
|
* @param {boolean} [waitForReady=true] Whether to wait for a shard to become ready before continuing to another
|
||||||
* @returns {Promise<void>} Resolves upon the message being sent
|
* @returns {Promise<void>} Resolves upon the message being sent
|
||||||
* @see {@link ShardingManager#respawn}
|
* @see {@link ShardingManager#respawnAll}
|
||||||
*/
|
*/
|
||||||
respawnAll(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
|
respawnAll(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
|
||||||
return this.send({ _sRespawnAll: { shardDelay, respawnDelay, waitForReady } });
|
return this.send({ _sRespawnAll: { shardDelay, respawnDelay, waitForReady } });
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ class ShardingManager extends EventEmitter {
|
|||||||
* @param {boolean} [waitForReady=true] Whether to wait for a shard to become ready before continuing to another
|
* @param {boolean} [waitForReady=true] Whether to wait for a shard to become ready before continuing to another
|
||||||
* @returns {Promise<Collection<string, Shard>>}
|
* @returns {Promise<Collection<string, Shard>>}
|
||||||
*/
|
*/
|
||||||
async respawn(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
|
async respawnAll(shardDelay = 5000, respawnDelay = 500, waitForReady = true) {
|
||||||
let s = 0;
|
let s = 0;
|
||||||
for (const shard of this.shards) {
|
for (const shard of this.shards) {
|
||||||
const promises = [shard.respawn(respawnDelay, waitForReady)];
|
const promises = [shard.respawn(respawnDelay, waitForReady)];
|
||||||
|
|||||||
Reference in New Issue
Block a user