aboutsummaryrefslogtreecommitdiff
path: root/src/tasks/feature
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-08-21 03:08:19 +0000
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-08-21 03:08:19 +0000
commit878bed986193c98ecde99b647b99015bcfec962e (patch)
treeed787e8705b7257b1c794caf4c5dbe5f4347959b /src/tasks/feature
parentb81f9e8b73cb520ad5ae916c3e571ea55f4ca489 (diff)
downloadtanzanite-878bed986193c98ecde99b647b99015bcfec962e.tar.gz
tanzanite-878bed986193c98ecde99b647b99015bcfec962e.tar.bz2
tanzanite-878bed986193c98ecde99b647b99015bcfec962e.zip
Automatically format code
Diffstat (limited to 'src/tasks/feature')
-rw-r--r--src/tasks/feature/updateStats.d.ts12
-rw-r--r--src/tasks/feature/updateStats.js38
2 files changed, 26 insertions, 24 deletions
diff --git a/src/tasks/feature/updateStats.d.ts b/src/tasks/feature/updateStats.d.ts
index 1274267..22e0308 100644
--- a/src/tasks/feature/updateStats.d.ts
+++ b/src/tasks/feature/updateStats.d.ts
@@ -1,10 +1,10 @@
import { BushTask } from '#lib';
import { Client } from 'discord.js';
export default class UpdateStatsTask extends BushTask {
- constructor();
- exec(): Promise<void>;
- static init(client: Client): Promise<{
- commandsUsed: bigint;
- slashCommandsUsed: bigint;
- }>;
+ constructor();
+ exec(): Promise<void>;
+ static init(client: Client): Promise<{
+ commandsUsed: bigint;
+ slashCommandsUsed: bigint;
+ }>;
}
diff --git a/src/tasks/feature/updateStats.js b/src/tasks/feature/updateStats.js
index 18a9a7c..48d431a 100644
--- a/src/tasks/feature/updateStats.js
+++ b/src/tasks/feature/updateStats.js
@@ -1,22 +1,24 @@
import { BushTask, Stat, Time } from '#lib';
import { Client } from 'discord.js';
export default class UpdateStatsTask extends BushTask {
- constructor() {
- super('updateStats', {
- delay: 10 * 60000,
- runOnStart: true
- });
- }
- async exec() {
- const row = (await Stat.findByPk(this.client.config.environment)) ??
- (await Stat.create({ environment: this.client.config.environment }));
- row.commandsUsed = this.client.stats.commandsUsed;
- row.slashCommandsUsed = this.client.stats.slashCommandsUsed;
- await row.save();
- }
- static async init(client) {
- const temp = (await Stat.findByPk(client.config.environment)) ?? (await Stat.create({ environment: client.config.environment }));
- return { commandsUsed: temp.commandsUsed, slashCommandsUsed: temp.slashCommandsUsed };
- }
+ constructor() {
+ super('updateStats', {
+ delay: 10 * 60000,
+ runOnStart: true
+ });
+ }
+ async exec() {
+ const row =
+ (await Stat.findByPk(this.client.config.environment)) ??
+ (await Stat.create({ environment: this.client.config.environment }));
+ row.commandsUsed = this.client.stats.commandsUsed;
+ row.slashCommandsUsed = this.client.stats.slashCommandsUsed;
+ await row.save();
+ }
+ static async init(client) {
+ const temp =
+ (await Stat.findByPk(client.config.environment)) ?? (await Stat.create({ environment: client.config.environment }));
+ return { commandsUsed: temp.commandsUsed, slashCommandsUsed: temp.slashCommandsUsed };
+ }
}
-//# sourceMappingURL=updateStats.js.map \ No newline at end of file
+//# sourceMappingURL=updateStats.js.map