mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
smarter sharding™ (#732)
This commit is contained in:
@@ -27,6 +27,14 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
this.options = mergeDefault(Constants.DefaultOptions, options);
|
||||
|
||||
if (!this.options.shard_id && process.env.hasOwnProperty('SHARD_ID')) {
|
||||
this.options.shard_id = process.env.SHARD_ID;
|
||||
}
|
||||
|
||||
if (!this.options.shard_count && process.env.hasOwnProperty('SHARD_COUNT')) {
|
||||
this.options.shard_count = process.env.SHARD_COUNT;
|
||||
}
|
||||
|
||||
/**
|
||||
* The REST manager of the client
|
||||
* @type {RESTManager}
|
||||
|
||||
Reference in New Issue
Block a user