mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
Shutdown Command
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user