Pet Image Error Handling Improvement

This commit is contained in:
Daniel Odendahl Jr
2017-04-15 03:07:45 +00:00
parent ec367c4ac9
commit 1cb782c44c
+1 -1
View File
@@ -34,7 +34,7 @@ module.exports = class NeopetCommand extends Command {
});
const $ = cheerio.load(response.text);
const link = $('textarea').first().text();
if (!link) return message.say(':x: Error! Pet not found!');
if (!link.includes('cp')) return message.say(':x: Error! Pet not found!');
return message.say(link);
}
catch (err) {