A bot that translates messages in Telegram group chats, using DeepL and/or ChatGPT. Allows you to specify which users should have their messages translated, into which language and with which translation service. Intended for group chats where several people speaking different languages would talk.
- any environment that can run node.js
- 64MB of RAM
- any reverse proxy web server that can handle SSL (for incoming messages webhook)
- Create a new bot with @BotFather, copy bot token.
- Clone this repo or download the code archive.
- Copy
.env.example
to.env
and edit it, bare minimum would beWEBHOOK_URL
,BOT_TOKEN
,ADMIN_USER_ID
and service-specific parameters for at least one service (DeepL or ChatGPT). - Set up a reverse proxy so your webhook URL would actually be available via HTTPS.
- Run
docker compose up -d
.
- Install node.js 18 (higher versions could work too, untested).
- Run
npm i
. - Run
npm run start
.
- Send
/start
to the bot, it should answer with an introductory message. - Add the bot to the group chat (or chats).
- Use bot commands to add translation rules.
- on the
info
log level, bot outputs all user IDs of all incoming messages to stdout, in case you need a quick way to get them - for the list of supported languages look here (this is for DeepL, but the same language code is getting passed to ChatGPT)
- there's a
/health
endpoint that could be used for monitoring