Skip to content

Commit

Permalink
refactor: use tenary
Browse files Browse the repository at this point in the history
  • Loading branch information
NotSugden committed Aug 1, 2021
1 parent 2ee3dd0 commit 5158e07
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/managers/GuildMemberManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,11 @@ class GuildMemberManager extends CachedManager {
}

const endpoint = this.client.api.guilds(this.guild.id).prune;
let pruned;
if (dry) {
({ pruned } = await endpoint.get({ query, reason }));
} else {
({ pruned } = await endpoint.post({
data: { ...query, compute_prune_count },
reason,
}));
}

const { pruned } = await (dry
? endpoint.get({ query, reason })
: endpoint.post({ data: { ...query, compute_prune_count }, reason }));

return pruned;
}

Expand Down

0 comments on commit 5158e07

Please sign in to comment.