diff --git a/src/main.js b/src/main.js index 9a761be..f493001 100644 --- a/src/main.js +++ b/src/main.js @@ -13,6 +13,7 @@ var swig = require('swig'); var templates = {}; var debug = false; +var admins = []; var sql; var haDC = () => { @@ -124,6 +125,25 @@ var getUser = (u, n) => { return bot.getUser(u, n); }; +var loadUser = (cb) => { + admins = []; + sql.query("select * from `f0ck`.`user`", (err, rows, fields) => { + rows.forEach((e,i,a) => { + admins.push(e.nick); + admins[e.nick].push({ + id: e.id, + nick: e.nick, + vhost: e.vhost, + level: e.level, + server: e.server + }); + }); + cb(true); + }).on('error', () => { + cb(false); + });; +} + var dl = (url, dest, cb) => { var request = (url.match(/^https/)?https:http).get(url, (response) => { // type:1=post,type:2=stfu console.log(response.headers['content-type']);