The commands will not work if the user has higher privileges than bot itself (like Admins/Server owners), for these users you have to edit nickname and assign role manually.Language values can be the name in English ( French), the native language name ( Français), the ISO code of the language ( fr), or even a country flag emoji ( ??).Messages by bots and webhooks are ignored, unless they are whitelisted.This uses the Google Translate Ajax API to make calls to such methods as detect and translate. Get instructions for this command within Discord by writing: -translate help user Googletrans is a free and unlimited python library that implemented Google Translate API.If this does not work due to permission issues, you can manually give the user the auto-translate role.Īutomatically translate user to a specific language:īanning a user will disable them from interacting with the bot and their messages become untranslatable. In this example, where L would be located, there are just numbers listed.Learn how to manage permissions or automatically translate messages for specific users in your Discord server.Īutomatically translate user to the channel's default language: So I thought maybe setting the model would help, but it still broke down my translation result by letter, with the only difference being it listed a line after each letter for the model used. When that also didn't work, I thought it might be an issue with the translation model. So I attempted to isolate that problem by removing that section and simply changing the phase to be translated as "Hello". entrans = ntentĪt first I assumed that the problem was with the way the Discord message was formatted. The code for this also slices off the !trans tag at the beginning of the string. Initial attempt was to translate the discord message. Instead of getting back a translated result, I get what appears to be a breakdown of the characters that make up the input. Orignial: I've been attempting to set up an addition to my discord bot to translate messages beginning with the phrase !trans from English to Japanese using Google's Translation API. So I think it might be the reason it’s returning a weird result. In the API examples I noticed a line I didn’t include. I can’t test It until I get off work though. Translation:translated_text: "H"Įdit: This did not work. Changing language to Spanish (ISO code: es) still gives an error. Breaking the language barrier for thousands of Discord users through powerful translation commands, automatic translation of users and channels, customizable and easy management system. Translation:translated_text: "\343\201\223\343\202\223\343\201\253\343\201\241\343\201\257"Įdit 2: I thought it might have to do with the fact that Japanese does not use the roman alphabet. The most powerful bot to translate discord messages, supports 100 languages, automatic, multi translations and TTS Voice. My guess is it has something to do with non-roman characters. I'm now trying to figure out how to get it converted back to the actual characters.Įdit 3: Added an await asyncio.sleep(3) line and that seems to have fixed it if I use English to Spanish as it correctly translates "Hello" to "Hola" Still getting a strange line for English to Japanese though. I now believe that it's returning the string as UTF-8 byte sequences. Edit4: Further review, it works if I send text in JP and translate it to EN.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |