From 5e0a6f18695877b418bb4f78b60939e28630b2a9 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 23 Sep 2017 20:19:43 +0000 Subject: [PATCH] Beep --- commands/search/safebooru.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/search/safebooru.js b/commands/search/safebooru.js index 734bbf04..9908c7ac 100644 --- a/commands/search/safebooru.js +++ b/commands/search/safebooru.js @@ -33,7 +33,7 @@ module.exports = class SafebooruCommand extends Command { }); const parsed = xml2js(text, { compact: true }).posts; if (parsed._attributes.count === '0' || !parsed.post.length) return msg.say('Could not find any results.'); - const posts = msg.channel.nsfw ? parsed.post : parsed.post.filter(post => post.rating === 's'); + const posts = msg.channel.nsfw ? parsed.post : parsed.post.filter(post => post._attributes.rating === 's'); return msg.say(stripIndents` ${query ? `Results for ${query}:` : 'Random Image:'} https:${posts[Math.floor(Math.random() * posts.length)]._attributes.file_url}