mirror of
https://github.com/discordjs/discord.js.git
synced 2026-09-18 01:07:26 +00: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:
co-authored by
kodiakhq[bot]
parent
beed098bf2
commit
2d740d5279
@@ -459,7 +459,9 @@ class GuildMember extends Base {
|
||||
* .catch(console.error);
|
||||
*/
|
||||
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