aboutsummaryrefslogtreecommitdiff
path: root/src/tasks
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-25 17:05:24 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-25 17:05:24 -0400
commit59ea06a2f010ad7503e4f7b7a1894485d37a416e (patch)
tree78a20be7fb7aad6e77b906a641e7755ec4baee55 /src/tasks
parent994de0471e7032e8c1fc7d7621ecae880746a3f1 (diff)
downloadtanzanite-59ea06a2f010ad7503e4f7b7a1894485d37a416e.tar.gz
tanzanite-59ea06a2f010ad7503e4f7b7a1894485d37a416e.tar.bz2
tanzanite-59ea06a2f010ad7503e4f7b7a1894485d37a416e.zip
feat: add slash command usage
Diffstat (limited to 'src/tasks')
-rw-r--r--src/tasks/updateStats.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tasks/updateStats.ts b/src/tasks/updateStats.ts
index 15ebe96..f27841f 100644
--- a/src/tasks/updateStats.ts
+++ b/src/tasks/updateStats.ts
@@ -12,11 +12,13 @@ export default class UpdateStatsTask extends BushTask {
const row =
(await Stat.findByPk(client.config.environment)) ?? (await Stat.create({ environment: client.config.environment }));
row.commandsUsed = client.stats.commandsUsed;
+ row.slashCommandsUsed = client.stats.slashCommandsUsed;
await row.save();
}
- public static async init(): Promise<bigint> {
- return ((await Stat.findByPk(client.config.environment)) ?? (await Stat.create({ environment: client.config.environment })))
- .commandsUsed;
+ public static async init(): Promise<{ commandsUsed: bigint; slashCommandsUsed: bigint }> {
+ const temp =
+ (await Stat.findByPk(client.config.environment)) ?? (await Stat.create({ environment: client.config.environment }));
+ return { commandsUsed: temp.commandsUsed, slashCommandsUsed: temp.slashCommandsUsed };
}
}