aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-06 21:31:29 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-06 21:31:29 -0400
commitbb061c938f4a967ed890f27c3ad56a63d6d6fec3 (patch)
tree10f808f2a7784235c5b19c0686f366128b6782c1 /src/lib
parentc9dbc3b7fa073889adf74a0ed47f1d5f0ad53362 (diff)
downloadtanzanite-bb061c938f4a967ed890f27c3ad56a63d6d6fec3.tar.gz
tanzanite-bb061c938f4a967ed890f27c3ad56a63d6d6fec3.tar.bz2
tanzanite-bb061c938f4a967ed890f27c3ad56a63d6d6fec3.zip
make stats persistant, fix automod logs, pm2 bs
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/extensions/discord-akairo/BushClient.ts4
-rw-r--r--src/lib/models/Stat.ts2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts
index d488525..a1966e2 100644
--- a/src/lib/extensions/discord-akairo/BushClient.ts
+++ b/src/lib/extensions/discord-akairo/BushClient.ts
@@ -32,6 +32,7 @@ import { permissionTypeCaster } from '../../../arguments/permission';
import { roleWithDurationTypeCaster } from '../../../arguments/roleWithDuation';
import { snowflakeTypeCaster } from '../../../arguments/snowflake';
import UpdateCacheTask from '../../../tasks/updateCache';
+import UpdateStatsTask from '../../../tasks/updateStats';
import { ActivePunishment } from '../../models/ActivePunishment';
import { Global } from '../../models/Global';
import { Guild as GuildModel } from '../../models/Guild';
@@ -285,7 +286,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
this.util = new BushClientUtil(this);
this.db = new Sequelize({
- database: this.config.isDevelopment ? 'bushbot-dev' : 'bushbot',
+ database: this.config.isDevelopment ? 'bushbot-dev' : this.config.isBeta ? 'bushbot-beta' : 'bushbot',
username: this.config.db.username,
password: this.config.db.password,
dialect: 'postgres',
@@ -347,6 +348,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re
await this.dbPreInit();
await UpdateCacheTask.init(this);
void this.console.success('startup', `Successfully created <<cache>>.`, false);
+ this.stats.commandsUsed = await UpdateStatsTask.init();
this.taskHandler.startAll!();
}
diff --git a/src/lib/models/Stat.ts b/src/lib/models/Stat.ts
index 9391ad4..0059898 100644
--- a/src/lib/models/Stat.ts
+++ b/src/lib/models/Stat.ts
@@ -9,7 +9,7 @@ export interface StatModel {
export interface StatModelCreationAttributes {
environment: 'production' | 'development' | 'beta';
- commandsUsed: bigint;
+ commandsUsed?: bigint;
}
export class Stat extends BaseModel<StatModel, StatModelCreationAttributes> implements StatModel {