webamp/experiments/skin-database/discord-bot/commands/stats.js
Jordan Eldredge 90b7a1e4f7 Pull discord-bot into skin-database
Also make the cli for the skin-database the canonical way to tweet

This opens the door for moving the state of which tweets have been
approved/denied/tweeted into the MongoDB database and not S3
2019-06-07 21:10:19 -07:00

25 lines
650 B
JavaScript

const { getCache } = require("../info");
const { getStats } = require("../../s3");
async function handler(message) {
const info = getCache();
let classic = 0;
const { tweeted, approved, rejected } = await getStats();
Object.values(info).forEach(skin => {
if (skin.type === "CLASSIC") {
classic++;
}
});
await message.channel.send(`Unique Skins: ${classic.toLocaleString()}
Tweeted: ${tweeted.toLocaleString()}
Rejected: ${rejected.toLocaleString()}
Approved: ${approved.toLocaleString()}
`);
}
module.exports = {
command: "stats",
handler,
usage: "",
description: "Give some statistics about the skin archive"
};