Add 'Bot' prefix to token (#510)

* Add 'Bot' prefix to token

* Add option for token prefix

* Maybe this is what abal meant?

* Change option name

* Check if token already starts with prefix
This commit is contained in:
Hugo Holmqvist
2016-08-14 21:38:04 +03:00
committed by abal
parent 1963bcfa10
commit ce198ef005
3 changed files with 10 additions and 2 deletions

View File

@@ -521,10 +521,12 @@ export default class InternalClient {
this.email = email;
this.password = password;
var self = this;
return this.getGateway()
.then(url => {
this.createWS(url);
return token;
self.token = self.client.options.bot && !self.token.startsWith("Bot ") ? `Bot ${self.token}` : self.token;
self.createWS(url);
return self.token;
});
}