mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Let's fix these bugs!
This commit is contained in:
@@ -27,11 +27,12 @@ module.exports = class YodaCommand extends commando.Command {
|
|||||||
.set({ 'X-Mashape-Key': config.mashapekey, 'Accept': 'text/plain' })
|
.set({ 'X-Mashape-Key': config.mashapekey, 'Accept': 'text/plain' })
|
||||||
.query({ sentence: turnToYoda })
|
.query({ sentence: turnToYoda })
|
||||||
.then(function (response) {
|
.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.');
|
message.channel.send(':x: Error! Something went wrong! Keep it simple to avoid this error.');
|
||||||
console.log(response.body);
|
console.log(response.body);
|
||||||
} else {
|
} 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) {
|
}).catch(function (err) {
|
||||||
message.channel.send(":x: Error! Unknown Error. Try again later!");
|
message.channel.send(":x: Error! Unknown Error. Try again later!");
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ client.on('guildCreate', guild => {
|
|||||||
.then(function (parsedBody) {
|
.then(function (parsedBody) {
|
||||||
console.log('[Discord Bots] Successfully posted to Discord Bots.');
|
console.log('[Discord Bots] Successfully posted to Discord Bots.');
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
|
console.log(err);
|
||||||
console.log("[Discord Bots] Failed to post to Discord Bots.");
|
console.log("[Discord Bots] Failed to post to Discord Bots.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -118,6 +119,7 @@ client.on('guildDelete', guild => {
|
|||||||
.then(function (parsedBody) {
|
.then(function (parsedBody) {
|
||||||
console.log('[Discord Bots] Successfully posted to Discord Bots.');
|
console.log('[Discord Bots] Successfully posted to Discord Bots.');
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
|
console.log(err);
|
||||||
console.log("[Discord Bots] Failed to post to Discord Bots.");
|
console.log("[Discord Bots] Failed to post to Discord Bots.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user