feat: setUsername with password
This commit is contained in:
parent
7a8198841f
commit
deab0d3440
@ -147,15 +147,16 @@ class ClientUser extends User {
|
||||
* <info>Changing usernames in Discord is heavily rate limited, with only 2 requests
|
||||
* every hour. Use this sparingly!</info>
|
||||
* @param {string} username The new username
|
||||
* @param {string} password Current Password
|
||||
* @returns {Promise<ClientUser>}
|
||||
* @example
|
||||
* // Set username
|
||||
* client.user.setUsername('discordjs')
|
||||
* client.user.setUsername('discordjs', 'passw@rd')
|
||||
* .then(user => console.log(`My new username is ${user.username}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
setUsername(username) {
|
||||
return this.edit({ username });
|
||||
setUsername(username, password) {
|
||||
return this.edit({ username, password });
|
||||
}
|
||||
|
||||
/**
|
||||
|
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@ -860,7 +860,7 @@ export class ClientUser extends User {
|
||||
public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise<this>;
|
||||
public setPresence(data: PresenceData): ClientPresence;
|
||||
public setStatus(status: PresenceStatusData, shardId?: number | number[]): ClientPresence;
|
||||
public setUsername(username: string): Promise<this>;
|
||||
public setUsername(username: string, password: string): Promise<this>;
|
||||
public purchasedFlags: PurchasedFlags;
|
||||
public premiumUsageFlags: PremiumUsageFlags;
|
||||
public phone: string | null;
|
||||
|
Loading…
Reference in New Issue
Block a user