autotagger

This commit is contained in:
Flummi
2021-12-23 06:07:19 +01:00
parent 2c80c58f59
commit 885d729a76
3 changed files with 45 additions and 7 deletions

View File

@ -1,3 +1,4 @@
import fetch from "flumm-fetch-cookies";
import { promises as fs } from "fs";
import { exec } from "child_process";
import cfg from "../config.mjs";
@ -92,6 +93,16 @@ export default async bot => {
const tmpc = await countf0cks();
e.reply(`tagged: ${tmpc.tagged}; untagged: ${tmpc.untagged}; sfw: ${tmpc.sfw}; nsfw: ${tmpc.nsfw}; total: ${tmpc.total}`);
break;
case "autotagger":
const body = { headers: { Authorization: `Basic ${cfg.tagger.btoa}` } };
const res = await (await fetch(`${cfg.tagger.endpoint}/usage`, body)).json();
if(res) {
const processed = res.result.monthly_processed;
const limit = res.result.monthly_limit;
return e.reply(`autotagger: usage/limit: ${processed}/${limit}`);
}
return;
break;
case "help":
e.reply("cmds: stats, limit, thumb, cache, uptime, restart, cleanTags, clearTmp, status");
break;