From 81d788b34b92e014b188fc7ffd69979cf924279d Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Tue, 25 Jul 2017 21:57:21 +0000 Subject: [PATCH] Fix Gelbooru --- commands/random-img/gelbooru.js | 4 ++-- commands/random-img/rule34.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/random-img/gelbooru.js b/commands/random-img/gelbooru.js index 5bba2c30..fd023d0f 100644 --- a/commands/random-img/gelbooru.js +++ b/commands/random-img/gelbooru.js @@ -37,8 +37,8 @@ module.exports = class GelbooruCommand extends Command { const { posts } = await xml.parseStringAsync(text); if (posts.$.count === '0') return msg.say('No Results.'); return msg.say(stripIndents` - Result for ${query}: - https:${posts.post[Math.floor(Math.random * posts.post.length)].$.file_url} + ${query ? `Result for ${query}:` : 'Random Image:'} + https:${posts.post[Math.floor(Math.random() * posts.post.length)].$.file_url} `); } }; diff --git a/commands/random-img/rule34.js b/commands/random-img/rule34.js index 9a94a2e4..e17b1c21 100644 --- a/commands/random-img/rule34.js +++ b/commands/random-img/rule34.js @@ -37,7 +37,7 @@ module.exports = class Rule34Command extends Command { const { posts } = await xml.parseStringAsync(text); if (posts.$.count === '0') return msg.say('No Results.'); return msg.say(stripIndents` - Result for ${query}: + ${query ? `Result for ${query}:` : 'Random Image:'} https:${posts.post[Math.floor(Math.random() * posts.post.length)].$.file_url} `); }