diff --git a/commands/text-edit/yoda.js b/commands/text-edit/yoda.js index 93b42aa5..20a7e618 100644 --- a/commands/text-edit/yoda.js +++ b/commands/text-edit/yoda.js @@ -26,10 +26,14 @@ module.exports = class YodaCommand extends Command { async run(msg, args) { const { sentence } = args; - const { text } = await snekfetch - .get('https://yoda.p.mashape.com/yoda') - .query({ sentence }) - .set({ 'X-Mashape-Key': MASHAPE_KEY }); - return msg.say(text); + try { + const { text } = await snekfetch + .get('https://yoda.p.mashape.com/yoda') + .query({ sentence }) + .set({ 'X-Mashape-Key': MASHAPE_KEY }); + return msg.say(text); + } catch (err) { + return msg.say(`Oh no, Yoda's being a jerk and not working again: \`${err.message}\`. Try again later!`); + } } }; diff --git a/package.json b/package.json index 87c71cc6..73e6d15b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "30.7.1", + "version": "30.7.2", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {