diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-17 12:31:09 -0400 |
commit | d40527d0a2d9f209905750258f71bedff1cdf089 (patch) | |
tree | e017fd844c2135bfc85228d00ef2617d24ce0a3f /src/commands/moderation/ban.ts | |
parent | d431ad00754f3f250103deedea495b9bcee73fc0 (diff) | |
download | tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.gz tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.tar.bz2 tanzanite-d40527d0a2d9f209905750258f71bedff1cdf089.zip |
turned on ts strict option
Diffstat (limited to 'src/commands/moderation/ban.ts')
-rw-r--r-- | src/commands/moderation/ban.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts index bda0e2b..e32bf18 100644 --- a/src/commands/moderation/ban.ts +++ b/src/commands/moderation/ban.ts @@ -90,15 +90,15 @@ export default class BanCommand extends BushCommand { force }: { user: User; reason?: { duration: number; contentWithoutTime: string }; days?: number; force: boolean } ): Promise<unknown> { - const member = message.guild.members.cache.get(user.id) as BushGuildMember; + 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); + const canModerateResponse = util.moderationPermissionCheck(message.member!, member, 'ban', true, useForce); if (canModerateResponse !== true) { return message.util.reply(canModerateResponse); } - if (!Number.isInteger(days) || days < 0 || days > 7) { + if (!Number.isInteger(days) || days! < 0 || days! > 7) { return message.util.reply(`${util.emojis.error} The delete days must be an integer between 0 and 7.`); } @@ -109,12 +109,12 @@ export default class BanCommand extends BushCommand { ? await Argument.cast('duration', client.commandHandler.resolver, message as BushMessage, reason) : reason.duration; } - const parsedReason = reason.contentWithoutTime; + const parsedReason = reason?.contentWithoutTime ?? ''; const responseCode = await member.bushBan({ reason: parsedReason, moderator: message.author, - duration: time, + duration: time! ?? 0, deleteDays: days ?? 0 }); |