From 4a4223fb65b2bf438400e40f8b58d5685e7e69a2 Mon Sep 17 00:00:00 2001 From: Flummi Date: Thu, 18 Aug 2016 15:43:18 +0200 Subject: [PATCH] trigger test --- src/trigger/del.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/trigger/del.js diff --git a/src/trigger/del.js b/src/trigger/del.js new file mode 100644 index 0000000..c6dfdc6 --- /dev/null +++ b/src/trigger/del.js @@ -0,0 +1,22 @@ +module.exports = (bot) => { + var del = (e, args) => { + 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"); + }); + }; + + bot.addCmd({ + name: 'spec', + level: 100, + func: spec, + desc: 'delete f0rk' + }); +}; \ No newline at end of file