mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
fix: Client#shards not being set properly
This commit is contained in:
@@ -53,6 +53,10 @@ class Client extends BaseClient {
|
|||||||
this.options.totalShardCount = this.options.shardCount;
|
this.options.totalShardCount = this.options.shardCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!this.options.shards && this.options.shardCount) {
|
||||||
|
this.options.shards = [];
|
||||||
|
for (let i = 0; i < this.options.shardCount; ++i) this.options.shards.push(i);
|
||||||
|
}
|
||||||
|
|
||||||
this._validateOptions();
|
this._validateOptions();
|
||||||
|
|
||||||
@@ -227,6 +231,10 @@ class Client extends BaseClient {
|
|||||||
this.emit(Events.DEBUG, `Using recommended shard count ${res.shards}`);
|
this.emit(Events.DEBUG, `Using recommended shard count ${res.shards}`);
|
||||||
this.options.shardCount = res.shards;
|
this.options.shardCount = res.shards;
|
||||||
this.options.totalShardCount = res.shards;
|
this.options.totalShardCount = res.shards;
|
||||||
|
if (!this.options.shards || !this.options.shards.length) {
|
||||||
|
this.options.shards = [];
|
||||||
|
for (let i = 0; i < this.options.shardCount; ++i) this.options.shards.push(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.emit(Events.DEBUG, `Using gateway ${gateway}`);
|
this.emit(Events.DEBUG, `Using gateway ${gateway}`);
|
||||||
this.ws.connect(gateway);
|
this.ws.connect(gateway);
|
||||||
|
|||||||
Reference in New Issue
Block a user