This commit is contained in:
Daniel Odendahl Jr
2017-09-05 00:30:28 +00:00
parent a1915c78ae
commit cda61f1545
4 changed files with 59 additions and 3 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ module.exports = class XKCDCommand extends Command {
return msg.embed(embed);
}
const choice = parseInt(type, 10);
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Invalid number.');
if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Could not find any results.');
const { body } = await snekfetch
.get(`https://xkcd.com/${choice}/info.0.json`);
const embed = new MessageEmbed()