Merge branch 'f0ckdev' into 'master'
Flummi = doof See merge request !96
This commit is contained in:
commit
8ec9ea7b2a
|
@ -12,19 +12,21 @@ module.exports = (lib) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
for(let i = 0; i < args.length; i++) {
|
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` ";
|
let query = "select `id`,`username` from `f0ck`.`items` ";
|
||||||
//if(args.length > 0)
|
|
||||||
// query += "where `username` like '" + args.join("' || `username` like '");
|
|
||||||
|
|
||||||
if(args.length > 0)
|
if(args.length > 0)
|
||||||
query += "where ";
|
query += "where ";
|
||||||
if(params.in.length > 0)
|
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)
|
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";
|
query += " order by rand() limit 1";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user