Skip to content

Commit 94d0042

Browse files
Brainicismtaahamahdi
authored andcommitted
Fix max_concurrency (#7)
1 parent 152a3fb commit 94d0042

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
@@ -421,6 +421,8 @@ class Client extends EventEmitter {
421421
async connect() {
422422
try {
423423
const data = await (this.options.maxShards === "auto" ? this.getBotGateway() : this.getGateway());
424+
this.shards.maxConcurrency = this.options.maxShards === "auto" ? data.session_start_limit.max_concurrency : 1;
425+
this._client.options.useMaxConcurrency = this._client.options.useMaxConcurrency && this.shards.maxConcurrency !== 1;
424426
if(!data.url || (this.options.maxShards === "auto" && !data.shards)) {
425427
throw new Error("Invalid response from gateway REST call");
426428
}

0 commit comments

Comments
 (0)