Make Yoda Errors Cooler

This commit is contained in:
Daniel Odendahl Jr
2017-08-30 12:39:53 +00:00
parent fac48bdda9
commit 69af4e712f
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -31,9 +31,10 @@ module.exports = class YodaCommand extends Command {
.get('https://yoda.p.mashape.com/yoda')
.query({ sentence })
.set({ 'X-Mashape-Key': MASHAPE_KEY });
if (!text) return msg.say('Empty, this message is. Try again later, you must.');
return msg.say(text);
} catch (err) {
return msg.say(`Oh no, Yoda's being a jerk and not working again: \`${err.message}\`. Try again later!`);
return msg.say(`Being a jerk again, Yoda is: \`${err.message}\`. Try again later, you must.`);
}
}
};