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
+1 -1
View File
@@ -35,7 +35,7 @@ module.exports = class WikipediaCommand extends commando.Command {
.setTitle(name)
.setURL("https://en.wikipedia.org/wiki/" + thingToSearch)
.setAuthor("Wikipedia", "https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1122px-Wikipedia-logo-v2.svg.png")
.setDescription(description + "[Read the Rest Here](https://en.wikipedia.org/wiki/" + thingToSearch + ")");
.setDescription(description + " [Read the Rest Here](https://en.wikipedia.org/wiki/" + thingToSearch + ")");
message.channel.sendEmbed(embed).catch(console.error);
}
}).catch(function (err) {
+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.'));
}