From 8706a7e8a72554c6e03be08c7e8acf021d2d4b0f Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 18 May 2017 03:08:41 +0000 Subject: [PATCH] Fix it again --- commands/nsfw/gelbooru.js | 2 +- commands/nsfw/rule34.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/nsfw/gelbooru.js b/commands/nsfw/gelbooru.js index a0037b5a..a7200059 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 5345f926..cb3d85b2 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) { diff --git a/package.json b/package.json index 6678bfec..4e5e57dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "19.8.0", + "version": "19.8.1", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": {