From 1e5f0b7bc448ca8baad64d82d303bdb685056b5a Mon Sep 17 00:00:00 2001 From: plane000 Date: Sun, 28 Oct 2018 20:17:58 +0000 Subject: [PATCH] Initialization sequence changed slightly --- index.js | 2 +- src/index.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index d2eb20a..7aaa68f 100644 --- a/index.js +++ b/index.js @@ -3,4 +3,4 @@ require('babel-register')({ presets: [ 'env' ] }); -require('./src/index'); +require('./src/index').init(); diff --git a/src/index.js b/src/index.js index 8d716e6..ccb212f 100644 --- a/src/index.js +++ b/src/index.js @@ -5,8 +5,9 @@ import {Config} from './config'; import {Database} from './database/database'; import {Events} from './events'; -init(); -async function init() { +let client; + +export async function init() { Logger.init(); Logger.SetLevel(Logger.VERBOSE_LOGS); @@ -15,7 +16,7 @@ async function init() { await Database.init(); - const client = new Discord.Client(); + client = new Discord.Client(); const eventHandler = new Events(); await eventHandler.init(client);