This commit is contained in:
Flummi
2023-04-28 07:04:06 +02:00
parent 44df4deea3
commit 8b6f68f2e9
11 changed files with 508 additions and 94 deletions

View File

@ -33,19 +33,10 @@ export default async bot => {
order by random()
`;
console.log(`select id, mime, username, size
from "items"
where
${ args.map(a => a.charAt(0) === "!"
? `username not ilike ${a.slice(1)}`
: `username ilike ${a}`
).join(' and ')}
order by random()`);
if(rows.length === 0)
return e.reply("nothing found, f0cker");
return await e.reply("nothing found, f0cker");
return e.reply(`f0ckrnd: ${cfg.main.url.full}/${rows[0].id} by: ${rows[0].username} (${rows[0].mime}, ~${lib.formatSize(rows[0].size)})`);
return await e.reply(`f0ckrnd: ${cfg.main.url.full}/${rows[0].id} by: ${rows[0].username} (${rows[0].mime}, ~${lib.formatSize(rows[0].size)})`);
}
}];
};