From c93ab34e89396c42f4d9d09022637666294e57b0 Mon Sep 17 00:00:00 2001 From: dragonfire535 Date: Fri, 3 Mar 2017 17:17:11 -0500 Subject: [PATCH] Translate Length Limit --- commands/botinfo/info.js | 2 +- commands/textedit/languages.json | 1 + commands/textedit/translate.js | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/botinfo/info.js b/commands/botinfo/info.js index cf864cb4..3b6b421d 100644 --- a/commands/botinfo/info.js +++ b/commands/botinfo/info.js @@ -59,7 +59,7 @@ class InfoCommand extends commando.Command { .addField('Lib', "[discord.js](https://discord.js.org/#/) (master)", true) .addField('Packages', - "[Commando](https://github.com/Gawdl3y/discord.js-commando) (0.9.0), [cleverbot-node](https://github.com/fojas/cleverbot-node) (0.3.3), [pirate-speak](https://github.com/mikewesthad/pirate-speak) (1.0.1), [JIMP](https://github.com/oliver-moran/jimp) (0.2.27), [google-translate-api](https://github.com/matheuss/google-translate-api) (2.2.2), [urban](https://github.com/mvrilo/urban) (0.3.1), [zalgoize](https://github.com/clux/zalgolize) (1.2.4)") + "[Commando](https://github.com/Gawdl3y/discord.js-commando) (0.9.0), [cleverbot-node](https://github.com/fojas/cleverbot-node) (0.3.5), [pirate-speak](https://github.com/mikewesthad/pirate-speak) (1.0.1), [JIMP](https://github.com/oliver-moran/jimp) (0.2.27), [google-translate-api](https://github.com/matheuss/google-translate-api) (2.2.2), [urban](https://github.com/mvrilo/urban) (0.3.1), [zalgoize](https://github.com/clux/zalgolize) (1.2.4)") .addField('Other Credit', "[Cleverbot API](https://www.cleverbot.com/api/)") .addField('My Server', diff --git a/commands/textedit/languages.json b/commands/textedit/languages.json index 5c20aadf..2057850a 100644 --- a/commands/textedit/languages.json +++ b/commands/textedit/languages.json @@ -1,5 +1,6 @@ { "entries": { + "auto": "Automatic", "af": "Afrikaans", "sq": "Albanian", "ar": "Arabic", diff --git a/commands/textedit/translate.js b/commands/textedit/translate.js index 79c922e3..54de8f07 100644 --- a/commands/textedit/translate.js +++ b/commands/textedit/translate.js @@ -28,6 +28,8 @@ class TranslateCommand extends commando.Command { } else if(languages.entries[languageto]) { if(messagecontent === "") { message.channel.sendMessage(":x: Error! Nothing to translate!"); + } else if(messagecontent.length > 200) { + message.channel.sendMessage(":x: Error! Please keep translations below 200 characters!"); } else { translate(messagecontent, {to: languageto}).then(res => { let languagefrom = res.from.language.iso;