fix random

This commit is contained in:
Flummi
2022-01-02 14:37:44 +01:00
parent d781290430
commit 0a983b140e
2 changed files with 36 additions and 20 deletions

View File

@ -14,12 +14,12 @@ export default async bot => {
for(let i = 0; i < args.length; i++) {
if(args[i].charAt(0) === "!")
rows = rows.where("username", "not like", args[i].slice(1));
rows = rows.where("username", "not ilike", args[i].slice(1));
else
rows = rows.where("username", "like", args[i]);
rows = rows.where("username", "ilike", args[i]);
}
rows = await rows.orderByRaw("rand()").limit(1);
rows = await rows.orderByRaw("random()").limit(1);
if(rows.length === 0)
return e.reply("nothing found, f0cker");