fetch admins from sql
This commit is contained in:
parent
297d1c73ff
commit
6bea0bfd30
20
src/main.js
20
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']);
|
||||
|
Loading…
Reference in New Issue
Block a user