From b5e143a31cf5edfedc9a5069359527189b3025f7 Mon Sep 17 00:00:00 2001 From: Bsian Date: Tue, 29 Oct 2019 17:22:06 +0000 Subject: [PATCH] Don't try and specify time if not locking --- src/class/Util.ts | 11 +++++++---- src/commands/createaccount.ts | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index 7911e18..dae9f58 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -168,10 +168,13 @@ export default class Util { let date: Date; let processed = true; if (reason) logInput.reason = reason; - if (duration) { - date = new Date(now + duration); - processed = false; - } else date = null; + if (type === 2) { + if (duration) { + date = new Date(now + duration); + processed = false; + } else date = null; + } + const expiration = { date, processed }; logInput.expiration = expiration; diff --git a/src/commands/createaccount.ts b/src/commands/createaccount.ts index d630bb8..6142ee2 100644 --- a/src/commands/createaccount.ts +++ b/src/commands/createaccount.ts @@ -44,6 +44,8 @@ export default class CreateAccount extends Command { const etcPasswd = `${acctName},${args[0]},,`; await this.client.util.createAccount(passHash, etcPasswd, args[2], args[0], args[1], message.author.id); + await this.client.util.createModerationLog(args[0], message.member, 0); + /* const log = await new this.client.db.Moderation({ username: args[2], userID: args[0], logID: uuid(), moderatorID: message.author.id, reason: 'User requested account creation', type: 0, date: new Date(), }); @@ -59,6 +61,7 @@ export default class CreateAccount extends Command { embed.setTimestamp(); // @ts-ignore this.client.createMessage('580950455581147146', { embed }); + */ this.client.util.transport.sendMail({ to: args[1],