A privacy-focused Telegram bot that enables anonymous peer-to-peer chatting with smart matching based on user preferences. Connect with random users while maintaining your privacy and finding matches based on your preferences.
- 🔒 Anonymous Chatting: Chat with random users while keeping your identity private
- 🎯 Smart Matching: Get matched with users based on your preferences:
- Country
- Language
- Gender
- ⚡ Real-time Status: See who's online and available to chat
- 🖼️ Media Support: Send and receive photos in chats
- ⏱️ Auto Timeouts:
- Chat inactivity timeout (1 hour)
- Match search timeout (2 minutes)
- 🔄 Rate Limiting: Respects Telegram's API rate limits
- ⚙️ Customizable Settings: Set and clear your preferences anytime
- Python 3.7 or higher
- A Telegram Bot Token (get it from @BotFather)
- SQLite3 (usually comes with Python)
- Clone the repository:
git clone https://github.com/okoyausman/telegram-anonymous-p2p-chat.git
cd telegram-anonymous-p2p-chat- Install required packages:
pip install python-telegram-bot python-dotenv- Create a
.envfile in the project root:
BOT_TOKEN=your_telegram_bot_token_here- Run the bot:
python main.py-
Start the bot by sending
/startcommand -
Use the main menu to:
- Toggle your online status
- View active users
- Access settings
- Find a match
-
In Settings, you can:
- Set your country
- Choose your language
- Set your gender
- Clear any preference
-
When in a chat:
- Send text messages and photos
- Use
/endto end the chat - Chat will auto-end after 1 hour of inactivity
The bot has several configurable constants in main.py:
INACTIVITY_TIMEOUT = 3600 # 1 hour in seconds
MATCH_TIMEOUT = 120 # 2 minutes in seconds
MESSAGE_RATE_LIMIT = 30 # messages per secondThe bot uses SQLite3 to store:
- User states
- Chat connections
- User preferences
- Activity timestamps
- All chats are anonymous
- No user data is stored beyond necessary preferences
- Messages are not logged
- Users can clear their preferences anytime
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please open an issue in the GitHub repository.