Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
  • Loading branch information
monbrey and kyranet committed Apr 30, 2021
1 parent 5c252bb commit 424a339
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/managers/GuildMemberManager.js
Expand Up @@ -269,12 +269,7 @@ class GuildMemberManager extends BaseManager {

await this.client.api.guilds(this.guild.id).members(id).delete({ reason });

if (user instanceof GuildMember) return user;
const _user = this.client.users.cache.get(id);
if (_user) {
return this.resolve(_user) ?? _user;
}
return id;
return this.resolve(user) ?? this.client.users.resolve(user) ?? id;
}

/**
Expand All @@ -300,12 +295,7 @@ class GuildMemberManager extends BaseManager {

await this.client.api.guilds(this.guild.id).bans[id].put({ data: options });

if (user instanceof GuildMember) return user;
const _user = this.client.users.resolve(id);
if (_user) {
return this.resolve(_user) ?? _user;
}
return id;
return this.resolve(user) ?? this.client.users.resolve(user) ?? id;
}

/**
Expand Down

0 comments on commit 424a339

Please sign in to comment.