v2.1 lol
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { promises as fs } from "fs";
|
||||
import cfg from "../../../config.json";
|
||||
import { exec } from "child_process";
|
||||
import cfg from "../../inc/config.mjs";
|
||||
import sql from "../sql.mjs";
|
||||
import lib from "../lib.mjs";
|
||||
|
||||
@ -27,13 +28,25 @@ export default async bot => {
|
||||
case "thumb":
|
||||
const rows = await sql.query("select id from items");
|
||||
const dir = (await fs.readdir("./public/t")).filter(d => d.endsWith(".png")).map(e => +e.split(".")[0]);
|
||||
|
||||
const tmp = [];
|
||||
for(let row of rows) {
|
||||
for(let row of rows)
|
||||
!dir.includes(row.id) ? tmp.push(row.id) : null;
|
||||
}
|
||||
e.reply(`${tmp.length}, ${rows.length}, ${dir.length}`);
|
||||
break;
|
||||
case "cache":
|
||||
cfg.websrv.cache = !cfg.websrv.cache;
|
||||
return e.reply(`Cache is ${cfg.websrv.cache ? "enabled" : "disabled"}`);
|
||||
break;
|
||||
case "uptime":
|
||||
exec('sudo systemctl status f0ck', (err, stdout) => {
|
||||
if(!err)
|
||||
return e.reply(stdout.split('\n')[2].trim().replace("Active: active (running)", "i'm active"));
|
||||
});
|
||||
break;
|
||||
case "restart":
|
||||
e.reply("hay hay patron, hemen!");
|
||||
exec("sudo systemctl restart f0ck");
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user