Fix Commands

This commit is contained in:
Daniel Odendahl Jr
2017-05-18 03:05:34 +00:00
parent 6c289cdb63
commit 996aa397de
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = class GelbooruCommand extends Command {
limit: 1
});
const { posts } = await xml(text);
if (posts.count === 0) throw new Error('No Results.');
if (!posts.$.count) 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) {
+1 -2
View File
@@ -37,8 +37,7 @@ module.exports = class Rule34Command extends Command {
limit: 1
});
const { posts } = await xml(text);
console.log(posts);
if (posts.count === 0) throw new Error('No Results.');
if (!posts.$.count) 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) {