Add getRecommendedShards and automatic shard count in ShardingManager (#796)

* draft stuff

fix docstring for Client#token

Reorganise resolver

make env better for shards, clean up docs

Fix Gus' log messages

7

meh just gateway/bot not v7 :(

final changes, ready for mergin!

build docs

make default totalShards 'auto', fix docs for totalShards type

clean up docs more

run docs

* make consistancy real

* Update and rename getRecommendedShards.js to GetRecommendedShards.js

* Update GetRecommendedShards.js

* Update index.js

* Update RESTMethods.js

* Update Shard.js

* Update GetRecommendedShards.js

* Update ShardingManager.js

* run docs
This commit is contained in:
Gus Caplan
2016-10-13 22:26:10 -05:00
committed by Schuyler Cebulskie
parent 492f706035
commit 853a3dfa04
8 changed files with 90 additions and 26 deletions

View File

@@ -14,7 +14,7 @@ class RESTMethods {
this.rest = restManager;
}
loginToken(token) {
loginToken(token = this.rest.client.token) {
token = token.replace('Bot ', '');
return new Promise((resolve, reject) => {
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
@@ -49,6 +49,10 @@ class RESTMethods {
});
}
getBotGateway() {
return this.rest.makeRequest('get', Constants.Endpoints.botGateway, true);
}
sendMessage(channel, content, { tts, nonce, disableEveryone, split } = {}, file = null) {
return new Promise((resolve, reject) => {
if (typeof content !== 'undefined') content = this.rest.client.resolver.resolveString(content);