fix(ShardClientUtil#id): erroneously reporting as an array

This commit is contained in:
Isabella
2019-01-15 01:45:29 -06:00
committed by GitHub
parent 28db527370
commit 8230255c68
2 changed files with 3 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ class Client extends BaseClient {
this.options.totalShardCount = this.options.shardCount;
}
}
if (!this.options.shards && this.options.shardCount) {
if (typeof this.options.shards === 'undefined' && this.options.shardCount) {
this.options.shards = [];
for (let i = 0; i < this.options.shardCount; ++i) this.options.shards.push(i);
}
@@ -233,7 +233,7 @@ class Client extends BaseClient {
this.emit(Events.DEBUG, `Using recommended shard count ${res.shards}`);
this.options.shardCount = res.shards;
this.options.totalShardCount = res.shards;
if (!this.options.shards || !this.options.shards.length) {
if (typeof this.options.shards === 'undefined' || !this.options.shards.length) {
this.options.shards = [];
for (let i = 0; i < this.options.shardCount; ++i) this.options.shards.push(i);
}