Load db from env var

master
Talon 2022-11-30 22:38:55 +00:00
parent e1f5f81338
commit 1f06ae0301
1 changed files with 3 additions and 2 deletions

View File

@ -13,8 +13,9 @@ let commandHandlers = new Map();
const bot = new Discord.Client(); const bot = new Discord.Client();
async function initDB() { async function initDB() {
console.log(__dirname);
api.db = await open({ api.db = await open({
filename: 'database/tardis.db', filename: process.env["DB_FILE"],
driver: sqlite3.Database driver: sqlite3.Database
}); });
} }
@ -118,4 +119,4 @@ api.announcementEngine = api.ttsEngines[process.env.ANNOUNCEMENT_ENGINE];
registerModules(); registerModules();
})() })()
bot.login(process.env.TOKEN); bot.login(process.env.TOKEN);
bot.on('message', handleMessage); bot.on('message', handleMessage);