From 59ea06a2f010ad7503e4f7b7a1894485d37a416e Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 25 May 2022 17:05:24 -0400 Subject: feat: add slash command usage --- src/tasks/updateStats.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tasks') 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 { - 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 }; } } -- cgit