modified: src/main.js

This commit is contained in:
Flummi 2016-08-18 13:47:05 +00:00
parent 06c9ab5411
commit 9c37911247

View File

@ -118,7 +118,7 @@ bot.on('message', (e) => {
} }
else if(orig.match(/^\!load user$/)) { else if(orig.match(/^\!load user$/)) {
loadUser((cb) => { loadUser((cb) => {
e.reply(admins); //e.reply(admins);
}); });
} }
else if(orig.match(/^\!level$/)) { else if(orig.match(/^\!level$/)) {
@ -127,6 +127,19 @@ bot.on('message', (e) => {
e.reply("level from "+e.user.getNick()+": "+cb.level+" (Channel: "+cb.channel+" DB: "+cb.db+")"); e.reply("level from "+e.user.getNick()+": "+cb.level+" (Channel: "+cb.channel+" DB: "+cb.db+")");
}); });
} }
else if(orig.match(/^\!del (\d+)$/i)) {
var tmp_channel = bot.getChannel(e.channel.getName(), e.network).names;
getUserlevel(e, e.user.getNick(), tmp_channel, (cb) => {
if(cb.level >= 100) {
var id = orig.split(' ')[1];
sql.query("delete from `f0ck`.`items` where `id` = ?", id).on('end', () => {
e.reply("f0ck "+id+" deleted");
});
}
else
e.reply("no permission");
});
}
}); });
var getUser = (u, n) => { var getUser = (u, n) => {