Merge branch 'f0ckdev' into 'master'

Flummi = doof

See merge request !96
This commit is contained in:
Flummi 2017-03-22 00:48:46 +00:00
commit 8ec9ea7b2a

View File

@ -12,19 +12,21 @@ module.exports = (lib) => {
};
for(let i = 0; i < args.length; i++) {
params[(args[0].charAt(0) === "!"?"not":"in")].push(args[0]);
let name = args[0];
if(name.charAt(0) === "!")
params.not.push(name.slice(1));
else
params.in.push(name);
}
let query = "select `id`,`username` from `f0ck`.`items` ";
//if(args.length > 0)
// query += "where `username` like '" + args.join("' || `username` like '");
if(args.length > 0)
query += "where ";
if(params.in.length > 0)
query += "`username` like '" + args.join("' || `username` like '");
query += "`username` like '" + params.in.join("' || `username` like '");
if(params.not.length > 0)
query += "`username` not like '" + args.join("' || `username` not like '");
query += "`username` not like '" + params.not.join("' || `username` not like '");
query += " order by rand() limit 1";