Fix Gelbooru

This commit is contained in:
Daniel Odendahl Jr
2017-07-25 21:57:21 +00:00
parent 0168941119
commit 81d788b34b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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}
`);
}
};
+1 -1
View File
@@ -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}
`);
}