Files
xiao/commands/util/shutdown.js
T
Daniel Odendahl Jr fb4bb67821 Shutdown Command
2017-09-23 03:41:18 +00:00

31 lines
725 B
JavaScript

const Command = require('../../structures/Command');
module.exports = class ShutdownCommand extends Command {
constructor(client) {
super(client, {
name: 'shutdown',
aliases: ['restart', 'power-off'],
group: 'util',
memberName: 'shutdown',
description: 'Shuts down the current shard, or all shards.',
guarded: true,
ownerOnly: true,
args: [
{
key: 'all',
prompt: 'Would you like to shutdown all shards?',
type: 'boolean',
default: false
}
]
});
}
async run(msg, { all }) {
await msg.say(`Shutting down ${all ? 'all shards' : 'this shard'}...`);
if (all) await this.client.shard.broadcastEval('process.exit(0)');
else process.exit(0);
return null;
}
};