mrmBot-Matrix/commands/restart.js

15 lines
555 B
JavaScript
Raw Normal View History

2019-09-13 20:02:41 +00:00
const handler = require("../utils/handler.js");
const collections = require("../utils/collections.js");
exports.run = async (message) => {
if (message.author.id !== process.env.OWNER) return `${message.author.mention}, only the bot owner can restart me!`;
2019-09-13 20:02:41 +00:00
await message.channel.createMessage(`${message.author.mention}, esmBot is restarting.`);
collections.commands.forEach(async (command) => {
await handler.unload(command);
});
process.exit(1);
};
2020-02-19 22:46:50 +00:00
exports.aliases = ["reboot", "stop"];
exports.category = 7;
exports.help = "Restarts me";