fix record
This commit is contained in:
parent
8b62120542
commit
511893765b
|
@ -10,18 +10,21 @@ module.exports = (lib) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(e.channel.names && e.user.nick !== lib.bot.me.nick) {
|
lib.bot.names(e.channel.getName(), e.network, (names) => {
|
||||||
var userCount = Object.keys(e.channel.names).length;
|
e.channel.names = names;
|
||||||
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(e.channel.names && e.user.nick !== lib.bot.me.nick) {
|
||||||
if(!rows.length) {
|
var userCount = Object.keys(e.channel.names).length;
|
||||||
lib.sql.query('insert into `f0ck`.`vars` (`key`,`value`,`channel`,`network`) values ("highest_user_count",?,?,?)', [userCount, e.channel.getName(), e.network]);
|
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) => {
|
||||||
e.reply('New user record for ' + e.channel.getName() + ': ' + userCount);
|
if(!rows.length) {
|
||||||
}
|
lib.sql.query('insert into `f0ck`.`vars` (`key`,`value`,`channel`,`network`) values ("highest_user_count",?,?,?)', [userCount, e.channel.getName(), e.network]);
|
||||||
else if(parseInt(rows[0].value) < userCount) {
|
e.reply('New user record for ' + e.channel.getName() + ': ' + userCount);
|
||||||
lib.sql.query('update `f0ck`.`vars` set `value` = ? where `key` = "highest_user_count" AND `channel` = ? AND `network` = ? limit 1', [userCount, e.channel.getName(), e.network]);
|
}
|
||||||
e.reply('New user record for ' + e.channel.getName() + ': ' + userCount);
|
else if(parseInt(rows[0].value) < userCount) {
|
||||||
}
|
lib.sql.query('update `f0ck`.`vars` set `value` = ? where `key` = "highest_user_count" AND `channel` = ? AND `network` = ? limit 1', [userCount, e.channel.getName(), e.network]);
|
||||||
});
|
e.reply('New user record for ' + e.channel.getName() + ': ' + userCount);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user