aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/Level.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-17 10:25:46 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-17 10:25:46 -0400
commitd1724227abfb8f0fcd9e573f7e9772cf0be8257a (patch)
tree52c9dbae1fbbbd3c777d9c16ab643c477141ae21 /src/lib/models/Level.ts
parent53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3 (diff)
downloadtanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.gz
tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.bz2
tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.zip
honestly no idea what I did at this point
Diffstat (limited to 'src/lib/models/Level.ts')
-rw-r--r--src/lib/models/Level.ts19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/models/Level.ts b/src/lib/models/Level.ts
index b834992..755b1c6 100644
--- a/src/lib/models/Level.ts
+++ b/src/lib/models/Level.ts
@@ -3,12 +3,14 @@ import { DataTypes, Sequelize } from 'sequelize';
import { BaseModel } from './BaseModel';
export interface LevelModel {
- id: Snowflake;
+ user: Snowflake;
+ guild: Snowflake;
xp: number;
}
export interface LevelModelCreationAttributes {
- id: Snowflake;
+ user: Snowflake;
+ guild: Snowflake;
xp?: number;
}
@@ -16,7 +18,11 @@ export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> {
/**
* The user's id.
*/
- public id: Snowflake;
+ public user: Snowflake;
+ /**
+ * The guild where the user is gaining xp.
+ */
+ public guild: Snowflake;
/**
* The user's xp.
*/
@@ -28,9 +34,12 @@ export class Level extends BaseModel<LevelModel, LevelModelCreationAttributes> {
static initModel(sequelize: Sequelize): void {
Level.init(
{
- id: {
+ user: {
+ type: DataTypes.STRING,
+ allowNull: false
+ },
+ guild: {
type: DataTypes.STRING,
- primaryKey: true,
allowNull: false
},
xp: {