issue#2 clear tmp dir

This commit is contained in:
Flummi 2021-12-09 17:01:57 +01:00
parent 72b4fec29e
commit cb44b27bdc

View File

@ -67,7 +67,6 @@ export default async bot => {
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)
@ -82,10 +81,17 @@ export default async bot => {
const tags = await cleanTags();
e.reply(tags + " tags removed");
break;
case "clearTmp":
await Promise.all((await fs.readdir("./tmp")).filter(d => d !== ".empty").map(async d => fs.unlink(`./tmp/${d}`)));
e.reply("cleared lol");
break;
case "status":
const tmpc = await countf0cks();
e.reply(`tagged: ${tmpc.tagged}; untagged: ${tmpc.untagged}; sfw: ${tmpc.sfw}; nsfw: ${tmpc.nsfw}; total: ${tmpc.total}`);
break;
case "help":
e.reply("cmds: stats, limit, thumb, cache, uptime, restart, cleanTags, clearTmp, status");
break;
default:
return;
}