An intelligent room-finding automation bot that monitors Telegram and WhatsApp groups for apartment rental advertisements matching your criteria and automatically sends interested messages to landlords.
- Telegram Bot: Monitors Telegram groups for new rental ads
- WhatsApp Bot: Monitors WhatsApp groups for rental advertisements
- AI Filtering: Uses DeepSeek LLM to intelligently match ads against your criteria
- Multi-language Support: Supports Italian, English, and Persian/Farsi languages
- Customizable Criteria:
- Maximum rent price
- Room type (single/double)
- Gender requirements
- Availability dates
- Student status restrictions
- Contract duration
- Automatic Responses: Generates personalized messages in the detected language
- Message Detection: Bots listen to specified Telegram/WhatsApp groups
- Regex Filtering: Quick pre-filtering using regex patterns (keywords, price range, etc.)
- LLM Analysis: DeepSeek AI performs detailed analysis against your criteria
- Smart Response: If matched, generates and sends a personalized message to the landlord
- Logging: Tracks all matches and errors for debugging
AI-room-rent-agent/
βββ telegram_bot.py # Telegram group monitor
βββ whatsapp_bot.py # WhatsApp group monitor
βββ ai_utils.py # Shared AI and filtering logic
βββ requirements.txt # Python dependencies
βββ .env.example # Configuration template
βββ README.md # This file
βββ SETUP.md # Detailed setup instructions
- Python 3.8+
- Telegram account and API credentials
- DeepSeek API key
- WhatsApp account (for WhatsApp bot)
- WAHA server running (for WhatsApp integration)
-
Clone and setup:
git clone https://github.com/B3H1Z/AI-room-rent-agent.git cd AI-room-rent-agent pip install -r requirements.txt -
Configure:
cp .env.example .env # Edit .env with your credentials and preferences -
Run:
# Telegram bot python telegram_bot.py # OR WhatsApp bot (in separate terminal) python whatsapp_bot.py
See SETUP.md for detailed setup instructions.
All configuration is done via the .env file:
TELEGRAM_API_ID: Your Telegram API IDTELEGRAM_API_HASH: Your Telegram API hashTELEGRAM_TARGET_GROUP: Target group username (without @)TELEGRAM_TARGET_TOPIC_ID: Topic ID within the group to monitor
DEEPSEEK_API_KEY: Your DeepSeek API keyDEEPSEEK_API_URL: DeepSeek API endpoint
USER_NAME: Your nameFIELD_OF_STUDY: Your field of studyUSER_AGE: Your age
MAX_RENT: Maximum monthly rent in euros
WAHA_API: WAHA server URLWAHA_API_KEY: WAHA authentication keyWAHA_TARGET_GROUPS: Comma-separated list of group IDs
Edit the filtering keywords in ai_utils.py:
# Room type
room_type_keywords = ['singola', 'single room', 'Ψ³ΫΩΪ―Ω']
# Gender restrictions
gender_negative_keywords = ['ragazza', 'girls only', 'ragazze', ...]
# Availability
availability_months = ['immediatamente', 'subito', 'immediately', ...]
# Contract duration
short_term_negative_keywords = ['temporary', 'subaffitto', ...]- Add language templates to
generate_message_with_llm()function - Update the
langdetectdetection inai_utils.py
- Conflict Error: Multiple bot instances using same token. Kill other processes.
- No Connection: Check API credentials and internet connection.
- Verify your criteria in
.envmatches the ads being posted - Check LLM prompt in
ai_utils.pyfor any mismatches - Review logs for LLM decision reasons
- Ensure WAHA server is running on the configured URL
- Verify API key matches WAHA configuration
- Check group IDs are correct format (
@g.us)
See logs for detailed error messages.
- Visit my.telegram.org
- Get your API ID and API Hash
- Save these in
.env
- Sign up at deepseek.com
- Generate an API key
- Save to
.env
- Run WAHA server locally:
docker run -p 3010:3010 devlikeapro/waha - Configure bot with WAHA API URL and key
This project is licensed under the MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
This bot is for personal use only. Always respect the terms of service of the platforms you're using (Telegram, WhatsApp). The authors are not responsible for any misuse of this tool.
For issues, questions, or suggestions, please open an GitHub issue.