Add Error Catching to Yoda

This commit is contained in:
dragonfire535
2017-03-11 19:50:00 -05:00
parent 3df4748108
commit d1e256301c
+1 -1
View File
@@ -37,7 +37,7 @@ class YodaCommand extends commando.Command {
message.channel.sendMessage(':x: Error! Something went wrong! Keep it simple to avoid this error.');
} else {
let translated = response.split('-').join(" ");
message.channel.sendMessage(translated);
message.channel.sendMessage(translated).catch(error => message.channel.sendMessage(':x: Error! Something went wrong! Keep it simple to avoid this error.'));
}
}).catch(function (err) {
message.channel.sendMessage(":x: Error!");