aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/Guild.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/models/Guild.ts')
-rw-r--r--src/lib/models/Guild.ts19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/models/Guild.ts b/src/lib/models/Guild.ts
index 3e6c6bf..e4e317f 100644
--- a/src/lib/models/Guild.ts
+++ b/src/lib/models/Guild.ts
@@ -1,4 +1,5 @@
-import { Optional } from 'sequelize';
+import { DataTypes, Optional, Sequelize } from 'sequelize';
+import { BotClient } from '../extensions/BotClient';
import { BaseModel } from './BaseModel';
export interface GuildModel {
@@ -12,4 +13,20 @@ export class Guild
implements GuildModel {
id: string;
prefix: string;
+ static initModel(seqeulize: Sequelize, client: BotClient): void {
+ Guild.init(
+ {
+ id: {
+ type: DataTypes.STRING,
+ primaryKey: true
+ },
+ prefix: {
+ type: DataTypes.STRING,
+ allowNull: false,
+ defaultValue: client.config.prefix
+ }
+ },
+ { sequelize: seqeulize }
+ );
+ }
}