diff --git a/commands/urban.js b/commands/urban.js index 813cb4e..c3b801a 100644 --- a/commands/urban.js +++ b/commands/urban.js @@ -6,10 +6,14 @@ module.exports = { usage: '', trusted: 0, async execute (bot, username, sender, prefix, args, config, hash, ownerhash, selector) { - const definitions = await urban.define(args.join(' ')) + try { + const definitions = await urban.define(args.join(' ')) - for (const definition of definitions) { - bot.tellraw(selector, [{ text: '[', color: 'dark_red' }, { text: 'Urban', color: 'red' }, { text: '] ', color: 'dark_red' }, { text: definition.word, color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition, color: 'white' }]) + for (const definition of definitions) { + bot.tellraw(selector, [{ text: '[', color: 'dark_red' }, { text: 'Urban', color: 'red' }, { text: '] ', color: 'dark_red' }, { text: definition.word, color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition, color: 'white' }]) + } + } catch (e) { + bot.tellraw(selector, { text: e.toString(), color: 'red' }) } } }