added stats command

This commit is contained in:
ry 2020-01-20 00:35:54 +01:00
parent 37a08314ea
commit 23ac36c819
5 changed files with 75 additions and 11 deletions

View file

@ -111,10 +111,10 @@ module.exports = {
setTimeout(() => timestamps.delete(msg.author.id), cooldownAmount);
cmd.command(ctx).then(async () => {
ctx.client.channels.find(c => c.id === vars.logs.usage).send(`${ctx.utils.format.bold(ctx.author.tag)} (${ctx.utils.format.code(ctx.author.id)}) used ${ctx.utils.format.code(cmd.name)} in ${ctx.utils.format.bold(ctx.guild.name)} (${ctx.utils.format.code(ctx.guild.id)}) `).catch(e => console.log(e))
if (!ctx.config.type.beta) ctx.client.channels.find(c => c.id === vars.logs.usage).send(`${ctx.utils.format.bold(ctx.author.tag)} (${ctx.utils.format.code(ctx.author.id)}) used ${ctx.utils.format.code(cmd.name)} in ${ctx.utils.format.bold(ctx.guild.name)} (${ctx.utils.format.code(ctx.guild.id)}) `).catch(e => console.log(e))
await ctx.db.backend.add(`usage.${cmd.name}`, 1)
}).catch((err) => {
if (!cmd.name.includes('e926') || !cmd.name.includes('e621')) {
if (!cmd.name === 'e926' || !cmd.name === 'e621') {
trello
.addCard(
cmd.name + ' | ' + err.message,