diff --git a/src/events/join.js b/src/events/join.js index d0328b1..39d0398 100644 --- a/src/events/join.js +++ b/src/events/join.js @@ -10,9 +10,9 @@ module.exports = (lib) => { }); } }); - lib.bot.names(e.channel.getName(), e.network, (names) => { - e.channel.names = names; - if(e.channel.names && e.user.nick !== lib.bot.me.nick) { + if(e.channel.names && e.user.nick !== lib.bot.me.nick) { + lib.bot.names(e.channel.getName(), e.network, (names) => { + e.channel.names = names; var userCount = Object.keys(e.channel.names).length; lib.sql.query('select value from `f0ck`.`vars` where `key` = "highest_user_count" AND `channel` = ? AND `network` = ? limit 1', [e.channel.getName(), e.network], (err, rows) => { if(!rows.length) { @@ -24,7 +24,7 @@ module.exports = (lib) => { e.reply('New user record for ' + e.channel.getName() + ': ' + userCount); } }); - } - }); + }); + } }); }; \ No newline at end of file