From b8c9a66163ab1424ebfcfc313e7381d56aa9a553 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 18 May 2017 02:56:19 +0000 Subject: [PATCH] Fix rule34 and gelbooru --- commands/nsfw/gelbooru.js | 2 +- commands/nsfw/rule34.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/nsfw/gelbooru.js b/commands/nsfw/gelbooru.js index f6afc88b..f16936f9 100644 --- a/commands/nsfw/gelbooru.js +++ b/commands/nsfw/gelbooru.js @@ -37,7 +37,7 @@ module.exports = class GelbooruCommand extends Command { limit: 1 }); const { posts } = await xml(text); - if (!posts.count) throw new Error('No Results.'); + if (posts.count === 0) throw new Error('No Results.'); return msg.say(`Result for ${query}:`, { files: [`https:${posts.post[0].$.file_url}`] }) .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) { diff --git a/commands/nsfw/rule34.js b/commands/nsfw/rule34.js index e8b2c5c6..1983d79b 100644 --- a/commands/nsfw/rule34.js +++ b/commands/nsfw/rule34.js @@ -37,7 +37,7 @@ module.exports = class Rule34Command extends Command { limit: 1 }); const { posts } = await xml(text); - if (!posts.count) throw new Error('No Results.'); + if (posts.count === 0) throw new Error('No Results.'); return msg.say(`Result for ${query}:`, { files: [`https:${posts.post[0].$.file_url}`] }) .catch(err => msg.say(`${err.name}: ${err.message}`)); } catch (err) {