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);