From 58b49fb9d81eb2ab609f9a4fc77d4e2706f87e18 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Fri, 23 Jul 2021 17:21:50 -0600 Subject: [PATCH] add database global --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index db4736b..5a13734 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,7 @@ const logger = require("npmlog"); logger.level = "verbose"; const fs = require("fs"); const {resolve} = require("path"); +const sqlite3 = require("sqlite3"); const config = require("../config.json"); const apikeys = require("../apikeys.json"); @@ -18,6 +19,8 @@ const bot = new Eris(config.token, { const commands = new Eris.Collection(); +const database = new sqlite3.Database(resolve(__dirname, "..", "database.db")); + function registerCommand(cmdObj) { if (cmdObj instanceof Command) { commands.set(cmdObj.name, cmdObj); @@ -39,6 +42,7 @@ global.hf = { registerCommand, events, timer, + database, }; for (const file of fs.readdirSync(resolve(__dirname, "modules"))) {