Fix Errors

This commit is contained in:
Daniel Odendahl Jr
2017-05-18 02:19:04 +00:00
parent f799cfdb68
commit 604af52eab
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = class GelbooruCommand extends Command {
limit: 1
});
const { posts } = await xml(text);
if (!posts) 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 -1
View File
@@ -37,7 +37,7 @@ module.exports = class Rule34Command extends Command {
limit: 1
});
const { posts } = await xml(text);
if (!posts) 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) {