+deletetrigger

This commit is contained in:
Flummi 2016-08-18 13:54:47 +02:00
parent 06c9ab5411
commit ff63ac7aaa

View File

@ -118,7 +118,7 @@ bot.on('message', (e) => {
}
else if(orig.match(/^\!load user$/)) {
loadUser((cb) => {
e.reply(admins);
//e.reply(admins);
});
}
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+")");
});
}
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) => {