1
0
Fork 0

rm comments and change archtypes

refactor/models
Matthew 2019-11-21 21:22:07 -05:00
parent b623654412
commit 84a22a6a76
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
2 changed files with 5 additions and 45 deletions

View File

@ -1,7 +1,7 @@
import moment from 'moment'; import moment from 'moment';
import { Message } from 'eris'; import { Message } from 'eris';
import { Client } from '..'; import { Client } from '..';
import { Command, RichEmbed } from '../class'; import { Command } from '../class';
export default class Lock extends Command { export default class Lock extends Command {
constructor(client: Client) { constructor(client: Client) {
@ -27,19 +27,11 @@ export default class Lock extends Command {
const lockLength = args[1].match(/[a-z]+|[^a-z]+/gi); const lockLength = args[1].match(/[a-z]+|[^a-z]+/gi);
// @ts-ignore // @ts-ignore
const momentMilliseconds = moment.duration(Number(lockLength[0]), lockLength[1]).asMilliseconds(); const momentMilliseconds = moment.duration(Number(lockLength[0]), lockLength[1]).asMilliseconds();
/*
expiry.setMilliseconds(momentMilliseconds);
let processed: boolean = false;
if (!momentMilliseconds) processed = true;
*/
this.client.signale.debug(lockLength);
this.client.signale.debug(expiry);
this.client.signale.debug(momentMilliseconds);
const reason = momentMilliseconds ? args.slice(2).join(' ') : args.slice(1).join(' '); const reason = momentMilliseconds ? args.slice(2).join(' ') : args.slice(1).join(' ');
await this.client.util.createModerationLog(account.userID, message.member, 2, reason, momentMilliseconds); await this.client.util.createModerationLog(account.userID, message.member, 2, reason, momentMilliseconds);
edit.edit(`***${this.client.stores.emojis.success} Account ${account.username} has been locked by Supervisor ${message.author.username}#${message.author.discriminator}.***`); edit.edit(`***${this.client.stores.emojis.success} Account ${account.username} has been locked by Moderator ${message.author.username}#${message.author.discriminator}.***`);
message.delete();
this.client.util.transport.sendMail({ this.client.util.transport.sendMail({
to: account.emailAddress, to: account.emailAddress,

View File

@ -1,7 +1,6 @@
import uuid from 'uuid/v4';
import { Message } from 'eris'; import { Message } from 'eris';
import { Client } from '..'; import { Client } from '..';
import { Command, RichEmbed } from '../class'; import { Command } from '../class';
export default class Unlock extends Command { export default class Unlock extends Command {
constructor(client: Client) { constructor(client: Client) {
@ -24,38 +23,7 @@ export default class Unlock extends Command {
await account.updateOne({ locked: false }); await account.updateOne({ locked: false });
await this.client.util.createModerationLog(account.userID, message.member, 3, args.slice(1).join(' ')); await this.client.util.createModerationLog(account.userID, message.member, 3, args.slice(1).join(' '));
/* edit.edit(`***${this.client.stores.emojis.success} Account ${account.username} has been unlocked by Moderator ${message.author.username}#${message.author.discriminator}.***`);
const moderation = new this.client.db.Moderation({
username: account.username,
userID: account.userID,
logID: uuid(),
moderatorID: message.author.id,
reason: args.slice(1).join(' '),
type: 3,
date: new Date(),
});
await moderation.save();
*/
edit.edit(`***${this.client.stores.emojis.success} Account ${account.username} has been unlocked by Supervisor ${message.author.username}#${message.author.discriminator}.***`);
/*
const embed = new RichEmbed();
embed.setTitle('Account Infraction | Unlock');
embed.setColor(15158332);
embed.addField('User', `${account.username} | <@${account.userID}>`, true);
embed.addField('Supervisor', `<@${message.author.id}>`, true);
if (args.slice(1).join(' ').length > 0) embed.addField('Reason', args.slice(1).join(' '), true);
embed.setFooter(this.client.user.username, this.client.user.avatarURL);
embed.setTimestamp();
message.delete();
this.client.getDMChannel(account.userID).then((user) => {
// @ts-ignore
user.createMessage({ embed }).catch();
});
// @ts-ignore
this.client.createMessage('580950455581147146', { embed });
*/
} catch (error) { } catch (error) {
await this.client.util.handleError(error, message, this); await this.client.util.handleError(error, message, this);
} }