mrmBot-Matrix/commands/general/restart.js

22 lines
733 B
JavaScript
Raw Normal View History

const handler = require("../../utils/handler.js");
const collections = require("../../utils/collections.js");
const Command = require("../../classes/command.js");
class RestartCommand extends Command {
async run() {
if (this.message.author.id !== process.env.OWNER) return "Only the bot owner can restart me!";
await this.client.createMessage(this.message.channel.id, Object.assign({
content: "esmBot is restarting."
}, this.reference));
for (const command of collections.commands) {
await handler.unload(command);
}
2021-07-05 04:15:27 +00:00
this.ipc.restartAllClusters();
//this.ipc.broadcast("restart");
}
static description = "Restarts me";
static aliases = ["reboot"];
}
module.exports = RestartCommand;