This service integrates Telegram conversations with Attio CRM, automatically syncing messages as activities in Attio deals.
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables in
.env
:
ATTIO_API_KEY=your_api_key
DATABASE_URL=postgresql://user:password@localhost:5432/tg_crm
- Initialize the database:
alembic upgrade head
- Start the service:
uvicorn src.main:app --reload
-
In Telegram Desktop:
- Open Settings > Advanced > Developer Options
- Enable "Show Chat ID in Chat Info"
- Right-click on any chat and select "Copy Chat ID"
-
In Attio:
- Open the deal you want to link
- Find the "Telegram Chat ID" field
- Paste the copied Chat ID
The service will automatically start tracking messages for any deal with a valid Telegram chat ID.
On first run, you'll need to:
- Visit
http://localhost:8000/auth
- Enter your Telegram phone number
- Enter the verification code sent to your Telegram account
- Uses TDLib for Telegram integration (no bot required)
- Batches messages hourly to create consolidated activities in Attio
- Stores minimal mapping data between Telegram chats and Attio deals