2019-09-13 20:02:41 +00:00
|
|
|
const handler = require("../utils/handler.js");
|
|
|
|
const collections = require("../utils/collections.js");
|
|
|
|
|
|
|
|
exports.run = async (message) => {
|
2019-11-13 00:09:06 +00:00
|
|
|
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.`);
|
2020-03-10 22:24:57 +00:00
|
|
|
for (const command of collections.commands) {
|
2019-09-13 20:02:41 +00:00
|
|
|
await handler.unload(command);
|
2020-03-10 22:24:57 +00:00
|
|
|
}
|
2019-09-13 20:02:41 +00:00
|
|
|
process.exit(1);
|
|
|
|
};
|
|
|
|
|
2020-07-06 20:19:30 +00:00
|
|
|
exports.aliases = ["reboot"];
|
|
|
|
exports.category = 8;
|
2019-12-02 20:47:22 +00:00
|
|
|
exports.help = "Restarts me";
|