count command usage in db
This commit is contained in:
parent
5eb34f8a86
commit
16fd7d9c27
1 changed files with 2 additions and 1 deletions
|
@ -110,8 +110,9 @@ module.exports = {
|
||||||
timestamps.set(msg.author.id, now);
|
timestamps.set(msg.author.id, now);
|
||||||
setTimeout(() => timestamps.delete(msg.author.id), cooldownAmount);
|
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))
|
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) => {
|
}).catch((err) => {
|
||||||
if (!cmd.name.includes('e926') || !cmd.name.includes('e621')) {
|
if (!cmd.name.includes('e926') || !cmd.name.includes('e621')) {
|
||||||
trello
|
trello
|
||||||
|
|
Loading…
Reference in a new issue