Skip to content

Commit f4ce449

Browse files
committed
Fix max_concurrency (#7)
1 parent 59b3496 commit f4ce449

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Client.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ class Client extends EventEmitter {
359359
async connect() {
360360
try {
361361
const data = await (this.options.maxShards === "auto" ? this.getBotGateway() : this.getGateway());
362+
this.shards.maxConcurrency = this.options.maxShards === "auto" ? data.session_start_limit.max_concurrency : 1;
363+
this._client.options.useMaxConcurrency = this._client.options.useMaxConcurrency && this.shards.maxConcurrency !== 1;
362364
if(!data.url || (this.options.maxShards === "auto" && !data.shards)) {
363365
throw new Error("Invalid response from gateway REST call");
364366
}

0 commit comments

Comments
 (0)