From 17ae60b5c5bc29b66417996aa501a0aaa2348567 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Tue, 22 Nov 2022 21:45:55 +1100 Subject: [PATCH] move MPDB.sync() to init() --- src/client.ts | 2 ++ src/models/MPServer.ts | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 1923592..b9a6e33 100644 --- a/src/client.ts +++ b/src/client.ts @@ -3,6 +3,7 @@ import fs from 'node:fs'; import { Database } from './database'; import timeNames from './timeNames'; import { Punishment, formatTimeOpt, createTableOpt, punOpt } from './typings/interfaces'; +import MPDB from './models/MPServer'; export class TClient extends Client { invites: Map; commands: Discord.Collection; @@ -66,6 +67,7 @@ export class TClient extends Client { this.setMaxListeners(80) } async init(){ + MPDB.sync(); this.login(this.tokens.token_toast); this.punishments.initLoad(); this.bannedWords.initLoad(); diff --git a/src/models/MPServer.ts b/src/models/MPServer.ts index 711c7ac..eb1ba2c 100644 --- a/src/models/MPServer.ts +++ b/src/models/MPServer.ts @@ -32,5 +32,4 @@ MPDB.init({ allowNull: false } }, { sequelize: db, modelName: 'urls', timestamps: false }); -MPDB.sync(); export default MPDB \ No newline at end of file