From aa36f5bcd445ca09283fc3d95f5141993befa775 Mon Sep 17 00:00:00 2001 From: Flummi Date: Wed, 22 Mar 2017 00:53:18 +0100 Subject: [PATCH] debuggsen --- src/trigger/f0ckrand.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/trigger/f0ckrand.js b/src/trigger/f0ckrand.js index f905498..f7da2c8 100644 --- a/src/trigger/f0ckrand.js +++ b/src/trigger/f0ckrand.js @@ -1,13 +1,11 @@ module.exports = (lib) => { - lib.trigger.add({ - name: 'f0ckrand', - call: /^gib f0ck/i, - level: 0, - active: 1, - func: (e) => { - let args = lib.sql.escape(e.message).split(" "); - args.shift(); - args.shift(); + lib.trigger.add({ + name: 'f0ckrand', + call: /^gib f0ck/i, + level: 0, + active: 1, + func: (e) => { + let args = lib.sql.escape(e.message).split(" ").splice(2); let query = "select `id`,`username` from `f0ck`.`items` "; if(args.length > 0) @@ -17,11 +15,11 @@ module.exports = (lib) => { console.log( query ); lib.sql.query(query, (err, rows, fields) => { if(!err && rows.length > 0) - e.reply("f0ckrnd: "+lib.cfg.main.url+"/"+rows[0].id+" by: "+rows[0].username); + e.reply(`f0ckrnd: ${lib.cfg.main.url}/${rows[0].id} by: ${rows[0].username}`); else e.reply("nothing found, f0cker"); }); - }, - desc: 'Random-f0ck' - }); + }, + desc: 'Random-f0ck' + }); }; \ No newline at end of file