change how restart works - no longer uses systemctl

This commit is contained in:
Ashley 2024-08-23 09:57:03 +00:00
parent 585872cc90
commit a7910e5f78
3 changed files with 12 additions and 6 deletions

View file

@ -1,7 +1,7 @@
import { exec } from "node:child_process"; import { exec } from "node:child_process";
function execute(client, event, args) { function execute(client, event, args) {
exec("systemctl restart possumbot"); process.exit(255);
} }
export default { export default {

View file

@ -22,17 +22,22 @@ function execute(client, event, args) {
var state = (config[module.name] ? "En" : "Dis") + "abled"; var state = (config[module.name] ? "En" : "Dis") + "abled";
var reply = state + " " + module.name + "\n"; var reply = state + " " + module.name;
var replyHTML = `<b>${state}</b> <code>${encode(module.name)}</code><br>`; var replyHTML = `<b>${state}</b> <code>${encode(module.name)}</code>`;
client.cache.set(event.sender.roomId, config); client.cache.set(event.sender.roomId, config);
client.reply(event, reply, replyHTML); client.reply(event, reply, replyHTML);
return; return;
} }
var enabled = client.modules.map(m => "[" + (config[m.name] !== false ? "x" : " ") + "] " + m.name); var modules = client.modules.map(m=>m.name);
var reply = `enabled modules:\n${enabled.join("\n")}`; var enabled = modules.filter(m=>config[m]!==false);
var replyHTML = `enabled modules:<br><code>${enabled.join("</code><br><code>")}</code>`;
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); client.reply(event, reply, replyHTML);
} }

View file

@ -14,6 +14,7 @@ async function onMessage(client, event) {
client.reply(event, c, `<pre><code>${encode(c)}</code></pre>`); client.reply(event, c, `<pre><code>${encode(c)}</code></pre>`);
return; return;
} }
for(const emb of embed.embeds) { for(const emb of embed.embeds) {
var link = document.createElement("a"); var link = document.createElement("a");
link.href = emb.url; link.href = emb.url;