Skip to content

Telegram bot translator, based on Google Translate.

Notifications You must be signed in to change notification settings

nessshon/gtranslator-bot

Repository files navigation

🤖 Google Translator Bot

Telegram bot translator, based on Google Translate.

Bot example: @nGTranslatorBot

Requirements

  • Python 3.10 and above.
  • Systemd or Docker.

Usage

Clone this repo via link

git clone https://github.com/nessshon/google-translator-bot

Go to the project folder

cd google-translator-bot

Create environment variables file

cp .env.example .env

Edit environment variables in .env

nano .env

Launch using Docker

  1. Install docker and docker compose

  2. Build and run your container

    docker-compose up -d

Launch using systemd

  1. Create a virtual environment

    python3.10 -m venv env
  2. Activate virtual environment

    source env/bin/activate
  3. Install required packages

    pip install -r requirements.txt
  4. Check if the bot is running

    python -m app
  5. Set WorkingDirectory to the path to the project folder.

    nano telegram-bot.service
  6. Copy telegram-bot.service to /lib/systemd/system/

    sudo cp telegram-bot.service /lib/systemd/system/google-translator-bot.service
  7. Enable autostart on boot

    sudo systemctl enable google-translator-bot.service
  8. Launch Bot

    sudo systemctl start google-translator-bot.service

Environment variables reference

Variable Type Description
BOT_TOKEN str Token, get it from @BotFather
USE_REDIS bool Set to True if you are using Redis
REDIS_HOST str Set "redis" if you will be using docker

About

Telegram bot translator, based on Google Translate.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published