2023-03-15 14:09:09 +00:00
|
|
|
import Command from "../../classes/command.js";
|
|
|
|
|
|
|
|
class RestartCommand extends Command {
|
|
|
|
async run() {
|
|
|
|
const owners = process.env.OWNER.split(",");
|
2023-03-15 14:12:35 +00:00
|
|
|
if (!owners.includes(this.author)) {
|
2023-03-15 14:09:09 +00:00
|
|
|
this.success = false;
|
|
|
|
return "Only the bot owner can restart me!";
|
|
|
|
}
|
|
|
|
await this.channel.createMessage(Object.assign({
|
2023-03-15 14:12:35 +00:00
|
|
|
content: "mrmBot is restarting."
|
2023-03-15 14:09:09 +00:00
|
|
|
}, this.reference));
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static description = "Restarts me";
|
|
|
|
static aliases = ["reboot"];
|
|
|
|
static adminOnly = true;
|
|
|
|
}
|
|
|
|
|
2021-08-19 14:19:14 +00:00
|
|
|
export default RestartCommand;
|