diff options
Diffstat (limited to 'src/commands/moderation/warn.ts')
-rw-r--r-- | src/commands/moderation/warn.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 44f4f5a..b4bf74d 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -60,6 +60,7 @@ export default class WarnCommand extends BushCommand { { user, reason, force }: { user: BushUser; reason: string; force: boolean } ): Promise<unknown> { const member = message.guild!.members.cache.get(user.id) as BushGuildMember; + if (!member) return message.util.reply(`${util.emojis.error} I cannot warn users that are not in the server.`); const useForce = force && message.author.isOwner(); if (!message.member) throw new Error(`message.member is null`); const canModerateResponse = await util.moderationPermissionCheck(message.member, member, 'warn', true, useForce); |