From 2833c54c75035f1e8efa4b2eca89203a1b326afa Mon Sep 17 00:00:00 2001 From: smyalygames Date: Fri, 17 Feb 2023 01:04:44 +0000 Subject: [PATCH] feat(arabot): remove temp ban if ban command is run --- src/commands/mod/ban/ban.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/mod/ban/ban.ts b/src/commands/mod/ban/ban.ts index be47c19..3a4cdb7 100644 --- a/src/commands/mod/ban/ban.ts +++ b/src/commands/mod/ban/ban.ts @@ -29,6 +29,7 @@ import { EmbedBuilder } from 'discord.js'; import IDs from '#utils/ids'; import { addBan, checkBan } from '#utils/database/ban'; import { addEmptyUser, updateUser, userExists } from '#utils/database/dbExistingUser'; +import { checkTempBan, removeTempBan } from '#utils/database/tempBan'; export class BanCommand extends Command { public constructor(context: Command.Context, options: Command.Options) { @@ -188,6 +189,10 @@ export class BanCommand extends Command { // Add ban to database await addBan(userId, modId, reason); + if (await checkTempBan(userId)) { + await removeTempBan(userId); + } + info.message = `${user} has been banned.`; info.success = true;