mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
Rename emailOrToken -> tokenOrEmail
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -112,7 +112,7 @@ class Client extends EventEmitter {
|
|||||||
* much better to use a bot account rather than a user account.
|
* much better to use a bot account rather than a user account.
|
||||||
* Bot accounts have higher rate limits and have access to some features user accounts don't have. User bots
|
* Bot accounts have higher rate limits and have access to some features user accounts don't have. User bots
|
||||||
* that are making a lot of API requests can even be banned.</warn>
|
* that are making a lot of API requests can even be banned.</warn>
|
||||||
* @param {string} emailOrToken The email or token used for the account. If it is an email, a password _must_ be
|
* @param {string} tokenOrEmail The token or email used for the account. If it is an email, a password _must_ be
|
||||||
* provided.
|
* provided.
|
||||||
* @param {string} [password] The password for the account, only needed if an email was provided.
|
* @param {string} [password] The password for the account, only needed if an email was provided.
|
||||||
* @returns {Promise<string>}
|
* @returns {Promise<string>}
|
||||||
@@ -126,9 +126,9 @@ class Client extends EventEmitter {
|
|||||||
* const password = 'supersecret123';
|
* const password = 'supersecret123';
|
||||||
* client.login(email, password);
|
* client.login(email, password);
|
||||||
*/
|
*/
|
||||||
login(emailOrToken, password) {
|
login(tokenOrEmail, password = null) {
|
||||||
if (password) return this.rest.methods.loginEmailPassword(emailOrToken, password);
|
if (password) return this.rest.methods.loginEmailPassword(tokenOrEmail, password);
|
||||||
return this.rest.methods.loginToken(emailOrToken);
|
return this.rest.methods.loginToken(tokenOrEmail);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user