mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user