Fix Error Messages

This commit is contained in:
Daniel Odendahl Jr
2017-05-16 12:17:52 +00:00
parent a140a30fcc
commit 897978ef73
46 changed files with 53 additions and 53 deletions
+3 -3
View File
@@ -32,16 +32,16 @@ module.exports = class XKCDCommand extends Command {
const current = await snekfetch
.get('https://xkcd.com/info.0.json');
if (type === 'today') return msg.say({ files: [current.body.img] })
.catch(err => msg.say(err));
.catch(() => msg.say('An Error Occurred while sending the image.'));
else {
const random = Math.floor(Math.random() * current.body.num) + 1;
const { body } = await snekfetch
.get(`https://xkcd.com/${random}/info.0.json`);
return msg.say({ files: [body.img] })
.catch(err => msg.say(err));
.catch(() => msg.say('An Error Occurred while sending the image.'));
}
} catch (err) {
return msg.say(err);
return msg.say('An Error Occurred.');
}
}
};