mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(GuildMember): Use editMe() conditionally for setNickname() helper (#11113)
fix(GuildMember): use `editMe()` conditionally Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -459,7 +459,9 @@ class GuildMember extends Base {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
async setNickname(nick, reason) {
|
async setNickname(nick, reason) {
|
||||||
return this.edit({ nick, reason });
|
return this.user.id === this.client.user.id
|
||||||
|
? this.guild.members.editMe({ nick, reason })
|
||||||
|
: this.edit({ nick, reason });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user