From a5de82b1ed931dcc1a72a7df83452af2dc7a9660 Mon Sep 17 00:00:00 2001 From: Flummi Date: Wed, 22 Mar 2017 14:18:08 +0100 Subject: [PATCH] added mime and size --- src/trigger/f0ckrand.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/trigger/f0ckrand.js b/src/trigger/f0ckrand.js index 764d972..c6dd746 100644 --- a/src/trigger/f0ckrand.js +++ b/src/trigger/f0ckrand.js @@ -23,10 +23,10 @@ module.exports = (lib) => { params.inc = new Array(params.inc.length).fill('username LIKE ?'); params.exc = new Array(params.inc.length == 0 ? params.exc.length : 0).fill('username NOT LIKE ?'); let where = params.inc.concat(params.exc).join(' || '); - let query = `SELECT id, username FROM f0ck.items ${where.length > 0 ? `WHERE ${where}` : ''} ORDER BY rand() LIMIT 1`; + let query = `SELECT id, username, mime, size FROM f0ck.items ${where.length > 0 ? `WHERE ${where}` : ''} ORDER BY rand() LIMIT 1`; 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'); + e.reply(!err && rows.length > 0 ? `f0ckrnd: ${lib.cfg.main.url}/${rows[0].id} by: ${rows[0].username} (${rows[0].mime}, ~${lib.formatSize(rows[0].size)})` : 'nothing found, f0cker'); }); }, desc: 'Random-f0ck'