2019-10-14 23:35:30 -04:00
|
|
|
import fs from 'fs-extra';
|
|
|
|
import { Message } from 'eris';
|
2019-10-15 20:34:13 -04:00
|
|
|
import { Client, Util } from '..';
|
|
|
|
import { Command } from '../class';
|
2019-10-14 23:35:30 -04:00
|
|
|
|
|
|
|
export default class Lock extends Command {
|
2019-10-15 19:10:37 -04:00
|
|
|
util: Util = new Util(this.client)
|
|
|
|
|
2019-10-14 23:35:30 -04:00
|
|
|
constructor(client: Client) {
|
|
|
|
super(client);
|
|
|
|
this.name = 'lock';
|
|
|
|
this.description = 'Locks an account.';
|
|
|
|
this.permissions = { roles: ['608095934399643649', '521312697896271873'] };
|
2019-10-15 18:38:49 -04:00
|
|
|
this.enabled = true;
|
2019-10-14 23:35:30 -04:00
|
|
|
}
|
|
|
|
|
2019-10-15 18:38:49 -04:00
|
|
|
public async run(message: Message, args: string[]) { // eslint-disable-line
|
2019-10-15 19:10:37 -04:00
|
|
|
try {
|
|
|
|
const account = await this.client.db.Account.findOne({ $or: [{ account: args[0] }, { userID: args[0].replace(/[<@!>]/gi, '') }] });
|
|
|
|
if (!account) return message.channel.createMessage(`***${this.client.stores.emojis.error} Cannot find user.***`);
|
|
|
|
const edit = await message.channel.createMessage(`***${this.client.stores.emojis.loading} Locking account...***`);
|
|
|
|
} catch (error) {
|
|
|
|
return this.util.handleError(error, message, this);
|
|
|
|
}
|
2019-10-14 23:35:30 -04:00
|
|
|
}
|
|
|
|
}
|