const fs = require('fs');

module.exports = bot => {
    bot.on('ready', () => {
        if (bot.loadCommands) {
            let meme;
            require(`${__baseDir}/modules/commandLoader`).init().then(() => {
                logger.info(`Loaded ${bot.commands.length} ${bot.commands.length === 1 ? 'command' : 'commands'}.`);
                return localeManager.loadLocales();
            }).then(() => bot.db.tableList().run()).then(res => {
                meme = res;
                if (res.indexOf('guild_settings') === -1) {
                    logger.info('Setting up "guild_settings" table in database.');
                    return bot.db.tableCreate('guild_settings').run();
                } else {
                    return null;
                }
            }).then(() => {
                if (meme.indexOf('user_settings') === -1) {
                    logger.info('Setting up "user_settings" table in database.');
                    return bot.db.tableCreate('user_settings').run();
                } else {
                    return null;
                }
            }).then(() => {
                bot.loadCommands = false;
                bot.allowCommandUse = true;

                let altPrefixes = JSON.parse(fs.readFileSync(`${__baseDir}/data/prefixes.json`));
                logger.info(`${bot.user.username} is connected to Discord and ready to use.`);
                logger.info(`Main prefix is '${bot.config.mainPrefix}', can also use @mention.`);
                logger.info(`${altPrefixes.length > 0 ? `Alternative prefixes: '${altPrefixes.join("', ")}'` : 'No alternative prefixes.'}`);
            }).catch(err => {
                logger.error(`Experienced error while loading commands:\n${bot.config.debug ? err.stack : err}`);
            });
        } else {
            logger.info('Reconnected to Discord from disconnection.');
        }

        bot.editStatus('online', {name: `${bot.config.gameName || `${bot.config.mainPrefix}help for commands!`} | ${bot.guilds.size} ${bot.guilds.size === 1 ? 'server' : 'servers'}`, type: bot.config.gameURL ? 1 : 0, url: `${bot.config.gameURL || null}`});
    });
};
@@ -140,16 +140,173 @@
         
+localeManager.loadLocales().then(() =%3E %7B%0A                logger.info(%60Loaded $%7BObject.keys(localeManager.locales).length%7D locales.%60);%0A                return 
 require(
@@ -349,16 +349,32 @@
 ).init()
+;%0A            %7D)
 .then(()
@@ -522,63 +522,8 @@
 turn
- localeManager.loadLocales();%0A            %7D).then(() =%3E
  bot
@@ -543,16 +543,31 @@
 ().run()
+;%0A            %7D
 ).then(r

Fix 8ball error complaining about undefined when loading responses