From 706fb20aa9714a79e9a5b8f907225ddc3c913ae1 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 26 Oct 2019 13:07:05 -0400 Subject: [PATCH] final finishes on checkLock func --- src/functions/checkLock.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/functions/checkLock.ts b/src/functions/checkLock.ts index da83f11..791d561 100644 --- a/src/functions/checkLock.ts +++ b/src/functions/checkLock.ts @@ -1,4 +1,5 @@ -import Client from '../Client'; +import uuid from 'uuid/v4'; +import { Client } from '..'; import { RichEmbed } from '../class'; export default function checkLock(client: Client) { @@ -12,8 +13,19 @@ export default function checkLock(client: Client) { const account = await client.db.Account.findOne({ username: moderation.username }); if (!account) return; await client.util.exec(`unlock ${account.username}`); + await moderation.update({ 'expiration.processed': true }); + const mod = new client.db.Moderation({ + username: account.username, + userID: account.userID, + logID: uuid(), + moderatorID: client.user.id, + reason: 'Auto', + type: 3, + date: new Date(), + }); + await mod.save(); const embed = new RichEmbed(); - embed.setTitle('Cloud Infraction | Unlock'); + embed.setTitle('Account Infraction | Unlock'); embed.setColor(3066993); embed.addField('User', `${account.username} | <@${account.userID}>`, true); embed.addField('Supervisor', 'SYSTEM', true);