Fix Util.js : fetchRecommendedShards() (#1532)

* Fix Util.js : fetchRecommendedShards()

I'm not sure who thought this was a good idea, but by removing gateway, it broke fetchRecommendedShards() in Util.js as it uses ${Constants.Endpoints.gateway.bot}.

* Update Constants.js

* Update Constants.js

* Update Util.js

* Update Constants.js
This commit is contained in:
PhoenixShay
2017-05-28 16:54:56 -04:00
committed by Crawl
parent 555317043e
commit 22e8237bf1
2 changed files with 2 additions and 1 deletions

View File

@@ -134,6 +134,7 @@ exports.Endpoints = {
};
},
invite: code => `https://discord.gg/${code}`,
botGateway: '/gateway/bot',
};

View File

@@ -55,7 +55,7 @@ class Util {
static fetchRecommendedShards(token, guildsPerShard = 1000) {
return new Promise((resolve, reject) => {
if (!token) throw new Error('A token must be provided.');
snekfetch.get(`${ConstantsHttp.host}/api/v${ConstantsHttp.version}${Constants.Endpoints.gateway.bot}`)
snekfetch.get(`${ConstantsHttp.host}/api/v${ConstantsHttp.version}${Constants.Endpoints.botGateway}`)
.set('Authorization', `Bot ${token.replace(/^Bot\s*/i, '')}`)
.end((err, res) => {
if (err) reject(err);