diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-25 17:05:24 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-25 17:05:24 -0400 |
commit | 59ea06a2f010ad7503e4f7b7a1894485d37a416e (patch) | |
tree | 78a20be7fb7aad6e77b906a641e7755ec4baee55 /src/lib/models/shared/Stat.ts | |
parent | 994de0471e7032e8c1fc7d7621ecae880746a3f1 (diff) | |
download | tanzanite-59ea06a2f010ad7503e4f7b7a1894485d37a416e.tar.gz tanzanite-59ea06a2f010ad7503e4f7b7a1894485d37a416e.tar.bz2 tanzanite-59ea06a2f010ad7503e4f7b7a1894485d37a416e.zip |
feat: add slash command usage
Diffstat (limited to 'src/lib/models/shared/Stat.ts')
-rw-r--r-- | src/lib/models/shared/Stat.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/models/shared/Stat.ts b/src/lib/models/shared/Stat.ts index d138620..8e2e0b3 100644 --- a/src/lib/models/shared/Stat.ts +++ b/src/lib/models/shared/Stat.ts @@ -7,11 +7,13 @@ type Environment = 'production' | 'development' | 'beta'; export interface StatModel { environment: Environment; commandsUsed: bigint; + slashCommandsUsed: bigint; } export interface StatModelCreationAttributes { environment: Environment; commandsUsed?: bigint; + slashCommandsUsed?: bigint; } /** @@ -29,6 +31,11 @@ export class Stat extends BaseModel<StatModel, StatModelCreationAttributes> impl public declare commandsUsed: bigint; /** + * The number of slash commands used + */ + public declare slashCommandsUsed: bigint; + + /** * Initializes the model. * @param sequelize The sequelize instance. */ @@ -46,6 +53,17 @@ export class Stat extends BaseModel<StatModel, StatModelCreationAttributes> impl }, allowNull: false, defaultValue: `${0n}` + }, + slashCommandsUsed: { + type: DataTypes.TEXT, + get: function (): bigint { + return BigInt(this.getDataValue('slashCommandsUsed')); + }, + set: function (val: bigint) { + return this.setDataValue('slashCommandsUsed', <any>`${val}`); + }, + allowNull: false, + defaultValue: `${0n}` } }, { sequelize } |