Browse Source

count command usage in db

master
ry 2 months ago
parent
commit
16fd7d9c27
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      DiscordEvents/message.js

+ 2
- 1
DiscordEvents/message.js View File

@@ -110,8 +110,9 @@ module.exports = {
timestamps.set(msg.author.id, now);
setTimeout(() => timestamps.delete(msg.author.id), cooldownAmount);

cmd.command(ctx).then(() => {
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))
await ctx.db.backend.add(`usage.${cmd.name}`, 1)
}).catch((err) => {
if (!cmd.name.includes('e926') || !cmd.name.includes('e621')) {
trello


Loading…
Cancel
Save