muh
This commit is contained in:
parent
c530db8959
commit
0dd192bdb6
|
@ -5,20 +5,16 @@ module.exports = (lib) => {
|
||||||
level: 0,
|
level: 0,
|
||||||
active: 1,
|
active: 1,
|
||||||
func: (e) => {
|
func: (e) => {
|
||||||
let args = e.message.split(" ");
|
let args = lib.sql.escape(e.message).split(" ");
|
||||||
args.shift();
|
args.shift();
|
||||||
args.shift();
|
args.shift();
|
||||||
|
|
||||||
let query = "select `id`,`username` from `f0ck`.`items` order by rand() ";
|
let query = "select `id`,`username` from `f0ck`.`items` order by rand() ";
|
||||||
|
if(args.length > 0)
|
||||||
if(args.length > 0) {
|
query += "where `username` = '" + args.join("' || `username` = '");
|
||||||
query += "where `username` = ? ".repeat(args.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
query += "limit 1";
|
query += "limit 1";
|
||||||
|
|
||||||
console.log(query);
|
lib.sql.query(query, (err, rows, fields) => {
|
||||||
lib.sql.query(query, args, (err, rows, fields) => {
|
|
||||||
if(!err)
|
if(!err)
|
||||||
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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user