aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/ban.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation/ban.ts')
-rw-r--r--src/commands/moderation/ban.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index 3a86244..7f1a67c 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -93,7 +93,8 @@ export default class BanCommand extends BushCommand {
if (!message.guild) return message.util.reply(`${util.emojis.error} This command cannot be used in dms.`);
const member = message.guild!.members.cache.get(user.id) as BushGuildMember;
const useForce = force && message.author.isOwner();
- const canModerateResponse = util.moderationPermissionCheck(message.member!, member, 'ban', true, useForce);
+ if (!message.member) throw new Error(`message.member is null`);
+ const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'ban', true, useForce);
if (canModerateResponse !== true) {
return message.util.reply(canModerateResponse);