mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
chore: use generator for range utility (#8825)
* chore: use generator for range utility * chore: update doc examples * chore: fix spelling * chore: fix typo Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -264,11 +264,12 @@ export class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> {
|
||||
if (Array.isArray(this.options.shardIds)) {
|
||||
shardIds = this.options.shardIds;
|
||||
} else {
|
||||
shardIds = range(this.options.shardIds.start, this.options.shardIds.end);
|
||||
const { start, end } = this.options.shardIds;
|
||||
shardIds = [...range({ start, end: end + 1 })];
|
||||
}
|
||||
} else {
|
||||
const data = await this.fetchGatewayInformation();
|
||||
shardIds = range(0, (this.options.shardCount ?? data.shards) - 1);
|
||||
shardIds = [...range(this.options.shardCount ?? data.shards)];
|
||||
}
|
||||
|
||||
this.shardIds = shardIds;
|
||||
|
||||
Reference in New Issue
Block a user