Possible Fix for Yoda?

This commit is contained in:
Daniel Odendahl Jr
2017-03-21 19:25:01 +00:00
parent d49fe32bf6
commit 0d0eeaf914
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -27,8 +27,9 @@ module.exports = class YodaCommand extends commando.Command {
.set({ 'X-Mashape-Key': config.mashapekey, 'Accept': 'text/plain' })
.query({ sentence: turnToYoda })
.then(function (response) {
if(response === undefined) {
if(response.body === undefined) {
message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.');
console.log(response.body);
} else {
message.channel.send(response.body).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'));
}