Bot example: @nGTranslatorBot
- Python 3.10 and above.
- Systemd or Docker.
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
-
Install docker and docker compose
-
Build and run your container
docker-compose up -d
-
Create a virtual environment
python3.10 -m venv env
-
Activate virtual environment
source env/bin/activate
-
Install required packages
pip install -r requirements.txt
-
Check if the bot is running
python -m app
-
Set WorkingDirectory to the path to the project folder.
nano telegram-bot.service
-
Copy telegram-bot.service to /lib/systemd/system/
sudo cp telegram-bot.service /lib/systemd/system/google-translator-bot.service
-
Enable autostart on boot
sudo systemctl enable google-translator-bot.service
-
Launch Bot
sudo systemctl start google-translator-bot.service
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 |