add guild sharding support (#393)

* add guild sharding support

* squash if statements
This commit is contained in:
Brian Tanner
2016-05-31 13:19:15 -04:00
committed by abalabahaha
parent a073010197
commit 00e3708e78
4 changed files with 30 additions and 6 deletions

View File

@@ -77,6 +77,13 @@ var Client = (function (_EventEmitter) {
this.options.largeThreshold = options.largeThreshold || 250;
this.options.maxCachedMessages = options.maxCachedMessages || 1000;
this.options.guildCreateTimeout = options.guildCreateTimeout || 1000;
this.options.shardId = options.shardId || 0;
this.options.shardCount = options.shardCount || 0;
if (typeof options.shardCount === "number" && typeof options.shardId === "number" && options.shardCount > 0) {
this.options.shard = [options.shardId, options.shardCount];
}
/**
* Internal Client that the Client wraps around.
* @readonly