mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Possible Fix for Yoda?
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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.'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user