Get your Attorney Finder Bot running in 5 minutes!
cd attorney-finder-bot./setup.shThis will:
- Create a virtual environment
- Install all dependencies
- Initialize the database
- Set up your .env file
./run.shThat's it! Your bot is now running! 🎉
-
Open Telegram and search for your bot: @LawmanRoBot
-
Start a conversation:
/start -
Add an attorney from a URL:
/scrape https://www.consumeradvocates.org/attorney/lisa-espada/ -
Search for attorneys:
94621or
Oakland family law
| What you want | Command |
|---|---|
| Welcome message | /start |
| Search by ZIP | 94621 |
| Search by city | Oakland |
| Search by practice | family law |
| Combined search | 94621 divorce |
| Add attorney | /scrape <url> |
| View stats | /stats |
| Get help | /help |
# Check if .env has your bot token
cat .env | grep TELEGRAM_BOT_TOKEN# Remove database and virtual environment
rm -rf venv attorneys.db
# Run setup again
./setup.shCheck the full README.md for detailed troubleshooting.
- Populate your database - Use
/scrapeto add attorneys - Test searches - Try different ZIP codes and practice areas
- Customize - Edit bot messages in
src/bot.py - Deploy - Run on a server for 24/7 availability
Edit src/bot.py - all messages are in the command functions
Edit src/scraper.py - modify extraction logic
Edit src/database.py - customize search logic
# Install screen or tmux
apt-get install screen
# Run in background
screen -S attorney-bot
./run.sh
# Press Ctrl+A, then D to detach# Create service file
sudo nano /etc/systemd/system/attorney-bot.service
# Add:
[Unit]
Description=Attorney Finder Bot
After=network.target
[Service]
Type=simple
User=youruser
WorkingDirectory=/path/to/attorney-finder-bot
ExecStart=/path/to/attorney-finder-bot/venv/bin/python /path/to/attorney-finder-bot/src/bot.py
Restart=always
[Install]
WantedBy=multi-user.target
# Enable and start
sudo systemctl enable attorney-bot
sudo systemctl start attorney-bot# Create Dockerfile (not included yet)
# Coming soon!- Bulk import: Create a script to scrape multiple URLs
- Regular updates: Schedule scraping for fresh data
- Backup database:
cp attorneys.db backup.dbregularly - Monitor logs: Check console output for errors
- Test first: Add a few attorneys before sharing bot
- Full documentation: README.md
- Bot code:
src/bot.py - Scraper code:
src/scraper.py - Database code:
src/database.py
Questions? Check README.md troubleshooting section