change how restart works - no longer uses systemctl
This commit is contained in:
parent
585872cc90
commit
a7910e5f78
3 changed files with 12 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
import { exec } from "node:child_process";
|
||||
|
||||
function execute(client, event, args) {
|
||||
exec("systemctl restart possumbot");
|
||||
process.exit(255);
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -22,17 +22,22 @@ function execute(client, event, args) {
|
|||
|
||||
var state = (config[module.name] ? "En" : "Dis") + "abled";
|
||||
|
||||
var reply = state + " " + module.name + "\n";
|
||||
var replyHTML = `<b>${state}</b> <code>${encode(module.name)}</code><br>`;
|
||||
var reply = state + " " + module.name;
|
||||
var replyHTML = `<b>${state}</b> <code>${encode(module.name)}</code>`;
|
||||
|
||||
client.cache.set(event.sender.roomId, config);
|
||||
client.reply(event, reply, replyHTML);
|
||||
return;
|
||||
}
|
||||
|
||||
var enabled = client.modules.map(m => "[" + (config[m.name] !== false ? "x" : " ") + "] " + m.name);
|
||||
var reply = `enabled modules:\n${enabled.join("\n")}`;
|
||||
var replyHTML = `enabled modules:<br><code>${enabled.join("</code><br><code>")}</code>`;
|
||||
var modules = client.modules.map(m=>m.name);
|
||||
var enabled = modules.filter(m=>config[m]!==false);
|
||||
|
||||
var reply = `enabled modules:\n${enabled.join(", ")}`;
|
||||
var replyHTML = `enabled modules:<br><code>${enabled.join("</code>, <code>")}</code>`;
|
||||
|
||||
reply += `\navailable modules:\n${modules.join(", ")}`;
|
||||
replyHTML += `<br>available modules:<br><code>${modules.join("</code>, <code>")}</code>`;
|
||||
|
||||
client.reply(event, reply, replyHTML);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ async function onMessage(client, event) {
|
|||
client.reply(event, c, `<pre><code>${encode(c)}</code></pre>`);
|
||||
return;
|
||||
}
|
||||
|
||||
for(const emb of embed.embeds) {
|
||||
var link = document.createElement("a");
|
||||
link.href = emb.url;
|
||||
|
|
Loading…
Reference in a new issue