Skip to content

Commit a59e84c

Browse files
Brainicismtaahamahdi
authored andcommitted
Fix max_concurrency (#7)
1 parent 4592168 commit a59e84c

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

0 commit comments

Comments
 (0)