mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
update per issue 69 on the h&c github (#963)
* update per issue 69 on the h&c github * clean up things that don't exist anymore
This commit is contained in:
@@ -16,22 +16,13 @@ class RESTMethods {
|
||||
this.rest = restManager;
|
||||
}
|
||||
|
||||
loginToken(token = this.rest.client.token) {
|
||||
login(token = this.rest.client.token) {
|
||||
return new Promise((resolve, reject) => {
|
||||
token = token.replace(/^Bot\s*/i, '');
|
||||
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
|
||||
});
|
||||
}
|
||||
|
||||
loginEmailPassword(email, password) {
|
||||
this.rest.client.emit('warn', 'Client launched using email and password - should use token instead');
|
||||
this.rest.client.email = email;
|
||||
this.rest.client.password = password;
|
||||
return this.rest.makeRequest('post', Constants.Endpoints.login, false, { email, password }).then(data =>
|
||||
this.loginToken(data.token)
|
||||
);
|
||||
}
|
||||
|
||||
logout() {
|
||||
return this.rest.makeRequest('post', Constants.Endpoints.logout, true, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user