diff --git a/commands/random/nitro.js b/commands/random/nitro.js index 7b86e5e3..793dd935 100644 --- a/commands/random/nitro.js +++ b/commands/random/nitro.js @@ -22,7 +22,7 @@ module.exports = class NitroCommand extends commando.Command { .setThumbnail('https://pbs.twimg.com/profile_images/814184180649197568/y2eZcVMq.jpg') .setColor(0x748BD9) .setURL('https://discordapp.com/nitro') - .setDescription('This Message can only be viewed by members with Discord Nitro.\n\n[More Information](https://discordapp.com/nitro)'); + .setDescription('This Message can only be viewed by members with Discord Nitro.\n\n\n[More Information](https://discordapp.com/nitro)'); return message.embed(embed); } }; diff --git a/commands/textedit/morse.js b/commands/textedit/morse.js index 270d4f7b..538c062c 100644 --- a/commands/textedit/morse.js +++ b/commands/textedit/morse.js @@ -10,22 +10,18 @@ module.exports = class MorseCommand extends commando.Command { ], group: 'textedit', memberName: 'morse', - description: 'Translates text to and from morse code. (;morse encode This is Morse Code.)', - examples: [';morse encode This is Morse Code.', ';morse decode .... . .-.. .-.. --- --..-- ....... .-- --- .-. .-.. -.. .-.-.-'], + description: 'Translates text to morse code. (;morse This is Morse Code.)', + examples: [';morse This is Morse Code.'], args: [{ - key: 'method', - prompt: 'Would you like to encode or decode the text?', + key: 'text', + prompt: 'What text would you like to convert to morse?', type: 'string', - validate: method => { - if (method.toLowerCase() === 'encode' || method.toLowerCase() === 'decode') { + validate: content => { + if (morse.encode(content).length < 1900) { return true; } - return 'Please enter either `encode` or `decode`.'; + return 'Your text to encode is too long.'; } - }, { - key: 'text', - prompt: 'What text would you like to convert to/from morse?', - type: 'string' }] }); } @@ -35,13 +31,8 @@ module.exports = class MorseCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } console.log(`[Command] ${message.content}`); - const methodToUse = args.method.toLowerCase(); const toMorse = args.text; - if (methodToUse === 'encode') { - return message.say(morse.encode(toMorse)).catch(error => message.say(':x: Error! Something went wrong! Perhaps you entered incorrect text?')); - } - else if (methodToUse === 'decode') { - return message.say(morse.decode(toMorse)).catch(error => message.say(':x: Error! Something went wrong! Perhaps you entered incorrect text?')); - } + const morseEncoded = morse.encode(toMorse); + return message.say(morseEncoded); } }; diff --git a/commands/textedit/translate.js b/commands/textedit/translate.js index b2f16258..df5b5436 100644 --- a/commands/textedit/translate.js +++ b/commands/textedit/translate.js @@ -162,6 +162,7 @@ module.exports = class TranslateCommand extends commando.Command { return message.embed(embed); } catch (err) { + console.error(err); return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/textedit/yoda.js b/commands/textedit/yoda.js index 788ca4df..30d0e8b0 100644 --- a/commands/textedit/yoda.js +++ b/commands/textedit/yoda.js @@ -37,6 +37,7 @@ module.exports = class YodaCommand extends commando.Command { return message.say(response.text); } catch (err) { + console.error(err); return message.say(':x: Error! Something went wrong!'); } }