1
0
Fork 0

Added restart command

refactor/models
Bsian 2019-11-18 20:14:43 +00:00
parent 0dbb6c698c
commit 701eb132cb
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 23 additions and 0 deletions

23
src/commands/restart.ts Normal file
View File

@ -0,0 +1,23 @@
import { Message } from 'eris';
import { Client } from '..';
import { Command } from '../class';
export default class Restart extends Command {
constructor(client: Client) {
super(client);
this.name = 'restart';
this.description = 'Restart the bot';
this.permissions = { users: ['253600545972027394', '278620217221971968'] };
this.enabled = true;
}
public async run(message: Message, args: string[]) {
try {
if (this.client.updating && args[0] !== '-f') return message.channel.createMessage(`${this.client.stores.emojis.error} ***Update in progress***`);
await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Restarting...***`);
return process.exit(1);
} catch (error) {
return this.client.util.handleError(error, message, this);
}
}
}