mrmBot-Matrix/commands/general/restart.js

21 lines
571 B
JavaScript
Raw Normal View History

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;
}
export default RestartCommand;