mirror of
https://github.com/discordjs/discord.js.git
synced 2024-07-08 02:01:19 +12:00
fix(GuildMemberManager): Fix data type check for add()
method (#10338)
fix(GuildMemberManager): fix data type check Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
parent
9c76bbea17
commit
ab8bf0f4d2
|
@ -128,8 +128,9 @@ class GuildMemberManager extends CachedManager {
|
|||
resolvedOptions.roles = resolvedRoles;
|
||||
}
|
||||
const data = await this.client.rest.put(Routes.guildMember(this.guild.id, userId), { body: resolvedOptions });
|
||||
// Data is an empty Uint8Array if the member is already part of the guild.
|
||||
return data instanceof Uint8Array
|
||||
|
||||
// Data is an empty array buffer if the member is already part of the guild.
|
||||
return data instanceof ArrayBuffer
|
||||
? options.fetchWhenExisting === false
|
||||
? null
|
||||
: this.fetch(userId)
|
||||
|
|
Loading…
Reference in a new issue