Make token "Bot" removal more lenient

In case of heavy user error. :)
This commit is contained in:
Schuyler Cebulskie
2016-10-14 02:14:00 -04:00
parent e4636243b2
commit 8f0e2e0c56
3 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ module.exports = function getRecommendedShards(token) {
return new Promise((resolve, reject) => {
if (!token) throw new Error('A token must be provided.');
superagent.get(botGateway)
.set('Authorization', `Bot ${token.replace(/^Bot /, '')}`)
.set('Authorization', `Bot ${token.replace(/^Bot\s*/i, '')}`)
.end((err, res) => {
if (err) reject(err);
resolve(res.body.shards);