TgTranslator is a telegram bot that translates messages in groups. Try it for yourself: @TgTranslatorBot
Use it in your project support group, to study language with a tutor, and in many other ways!
This bot has 3 translation modes:
-
Auto. This mode automatically translates all messages that do not match the language of the main group. In addition, the message should be less than the character limit (specified in appsettins.json -> TgTranslator -> CharLimit), should not be a command (for example: /help or .help for Userbots), and the group should not be in timeout.
-
Forwards. Works like Auto, but translates only forwarded messages.
-
Manual. Translates only after replying on message with
!translate
or bot username.
By default, bot has 105 languages supported by Google Translate.
In many group bots you can call menu in group chat. This one works different: the /settings
command works only in private messages. It returns the main menu with Inline buttons which are the list of available settings.
When you select an option, it offers you to choose chat where you send ready command, like @TgTranslatorBot set:mode=auto
.
This may seem a bit complicated, but it creates a lot more flexibility for larger groups. Users won't be interrupted by large message with buttons, and also, you can create prepared configurations for multiple groups.
Menu is higly customizable, so it's not hard to add new options, or even implement it in your own project.
You need to have Docker and PostgreSQL.
- Clone repository and open directory:
git clone https://github.com/Dubzer/TgTranslator.git && cd TgTranslator
- Configure the
appsettings.json
(it's pretty self-explanatory) - Create a new class and implement
ITranslator
andILanguageDetector
interfaces. After that, openDiServices.cs
and replaceTranslatePlaceholderService
with your new class. - Build the project.
docker build -t tgtranslator.
- Start an app container.
docker run tgtranslator
The project is licensed under the MIT license.