- User starts with
/start. - Bot asks for gender → user selects.
- Bot asks for age → user enters a number between 18–99.
- Bot asks for preferred partner’s gender → user selects.
- Bot asks for preferred partner’s age range → user selects.
- User is added to the waiting queue.
- Bot searches for a matching partner:
- Gender preferences must align.
- Age must fit within both users’ chosen ranges.
- If a match is found → both users are connected anonymously.
- Messages are forwarded between users until one ends the chat.
- Chat can be ended via button “End Chat” or
/stop.
-
Clone the repository: git clone https://github.com/username/anon-chat-bot.git cd anon-chat-bot
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows
-
Install dependencies: pip install -r requirements.txt
-
Create
.envfile in the project root: TOKEN=your-telegram-bot-token -
Run locally: python bot.py
- Build image: docker build -t anon-chat-bot .
- Run container: docker run -e TOKEN=your-telegram-bot-token anon-chat-bot
- Detached mode: docker run -d -e TOKEN=your-telegram-bot-token --name chatbot anon-chat-bot
- Manage: docker stop chatbot docker start chatbot docker logs chatbot
bot.py— main bot logicrequirements.txt— dependenciesDockerfile— container setupREADME.md— documentationLICENSE— license
/start— begin/stop— end chat- Inline buttons — choose gender, age, preferences
