added channel records

This commit is contained in:
Flummi
2016-09-16 00:44:42 +00:00
parent edd5031a3e
commit 4920ce213c
2 changed files with 34 additions and 10 deletions

18
src/trigger/record.js Normal file
View File

@ -0,0 +1,18 @@
module.exports = (lib) => {
lib.trigger.add({
name: 'record',
call: /^\!record$/i,
level: 0,
active: 1,
func: (e) => {
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) {
e.reply('Channel record for ' + e.channel.getName() + ': ' + rows[0].value);
}
else
e.reply('No channel record yet.');
});
},
desc: 'get current channel record'
});
};