james7132 / Hourai

The world's most advanced security and moderation bot for Discord.
https://hourai.gg
GNU General Public License v3.0
46 stars 16 forks source link

Add translator #18

Open Moobiful opened 7 years ago

Moobiful commented 7 years ago

~translate "[stringInput]" to [outputLanguage] Would take the input string through Google Translate's API, auto detect the language, and translate it to the target language. Hourai would then display the result and ping the calling user

User: ~translate "おはようございます" to ENG

Hourai: @User "おはようございます" translates to "Good morning"

~translate [integer] to [outputLanguage] Would take the inputted integer and parse the number of messages above it for any characters not in the specified target language, then take the foreign characters through the API and translate it into the target language. The translated output will be placed back into the original string, replacing the foreign characters originally given. If no integer is stated, the value defaults to 10

UserA: Hey guys, what's your favorite spell card?

UserB: I have a lot of them. UserB: My favorite is probably 恋符「マスタースパーク」 though.

UserC: ~translate 5 to ENG

Hourai: @UserC

User B - Today at 16:38
My favorite is probably Love Sign "Master Spark" though.

https://cloud.google.com/translate/

james5922 commented 7 years ago

Would this work?

https://www.microsoft.com/en-us/translator/faq.aspx Apparently it's free up to 2 million characters a month.