aiogram bot for anonymous messaging
- aiogram
- sqlalchemy
- postgres
- alembic
Installation is pretty simple, you'll need to clone this repository and have installed docker and * docker-compose* on your PC.
Clone project and change directory:
git clone https://github.com/intezya/anonymous-telegram-bot
cd anonymous-telegram-bot
Rename .env.example to .env and edit it. This file must looks like:
BOT_TOKEN=<your bot token>
DB_USER=postgres
DB_PASS=postgres
DB_HOST=localhost
DB_PORT=5434
DB_NAME=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
Next, let's figure out how to run the bot.
1. Using docker and docker-compose
The recommended way to use docker-compose.yaml is to build and run the services using Docker Compose. This approach simplifies the setup and ensures that all dependencies and configurations are correctly handled.
docker-compose up --buildThis command will build the Docker images if they are not already built and start the services defined in the docker-compose.yaml file.
Note that if you using this method, you should name DB_HOST in .env the same as your postgres container named (set DB_HOST=db if you dont change container name)
2. Without docker
To run the bot without Docker, you need to set up the environment manually.
poetry env use python3.12 poetry update poetry run python src/bot.py