From a6741d87ec89ef87f049938034a19abb0d105cae Mon Sep 17 00:00:00 2001 From: 404invalid-user Date: Sat, 18 Jan 2025 15:26:56 +0000 Subject: [PATCH] breg and added debug for db --- src/database/index.ts | 6 +++++- src/index.ts | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/database/index.ts b/src/database/index.ts index 4e89084..1f122bf 100644 --- a/src/database/index.ts +++ b/src/database/index.ts @@ -16,7 +16,11 @@ if (!process.env.DB_URI) { process.exit(1); } -const sequelize = new Sequelize(process.env.DB_URI); +const sequelize = new Sequelize(process.env.DB_URI, { + logging: (msg) => { + if (process.env.DEBUG === 'true') console.log(msg) + } +}); const schemas = { BanRole: BanReaction(sequelize), diff --git a/src/index.ts b/src/index.ts index 27f2e8c..04591c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,4 +10,6 @@ async function main(): Promise { await login(); if (process.env.RELOADCMDS !== 'false') await updateSlashCommands(); await start(); -} \ No newline at end of file +} + +main(); \ No newline at end of file