Let's fix these bugs!

This commit is contained in:
Daniel Odendahl Jr
2017-03-21 19:28:44 +00:00
parent 0d0eeaf914
commit e53ce2632f
2 changed files with 5 additions and 2 deletions
+3 -2
View File
@@ -27,11 +27,12 @@ module.exports = class YodaCommand extends commando.Command {
.set({ 'X-Mashape-Key': config.mashapekey, 'Accept': 'text/plain' })
.query({ sentence: turnToYoda })
.then(function (response) {
if(response.body === undefined) {
if(response === 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.'));
console.log(response);
message.channel.send(response).catch(error => message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.'));
}
}).catch(function (err) {
message.channel.send(":x: Error! Unknown Error. Try again later!");