This commit is contained in:
Flummi 2017-03-22 03:07:59 +01:00
parent c8f9969ce4
commit a6930add23

View File

@ -26,7 +26,8 @@ module.exports = (lib) => {
let where = params.in.concat(params.not);
let query = `SELECT id, username FROM f0ck.items ${where.length > 0 ? `WHERE ${where.join(' || ')}` : ''} ORDER BY rand() LIMIT 1`;
console.log( query );
e.reply( query );
e.reply( JSON.stringify( vars ) );
lib.sql.query(query, vars, (err, rows) => {
e.reply(!err && rows.length > 0 ? `f0ckrnd: ${lib.cfg.main.url}/${rows[0].id} by: ${rows[0].username}` : 'nothing found, f0cker');
});