diff options
Diffstat (limited to 'src/commands/moderation/warn.ts')
-rw-r--r-- | src/commands/moderation/warn.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 33ac2a3..a9469cf 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -61,7 +61,8 @@ export default class WarnCommand extends BushCommand { ): Promise<unknown> { const member = message.guild!.members.cache.get(user.id) as BushGuildMember; const useForce = force && message.author.isOwner(); - const canModerateResponse = util.moderationPermissionCheck(message.member!, member, 'warn', true, useForce); + if (!message.member) throw new Error(`message.member is null`); + const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'warn', true, useForce); const victimBoldTag = `**${member.user.tag}**`; if (canModerateResponse !== true) { |