This project now includes a FastAPI server to expose Telegram automation features as REST endpoints.
/Users/Kato/Desktop/telegram-agent/.venv/bin/python -m pip install -r requirements.txt/Users/Kato/Desktop/telegram-agent/.venv/bin/python server.pyThe server will start at http://0.0.0.0:8000.
Once the server is running, open your browser and go to: http://localhost:8000/docs
This provides an interactive Swagger UI where you can test all endpoints:
- POST /groups: Create a new group.
- PUT /groups/{id}: Rename a group.
- DELETE /groups/{id}: Delete a group.
- POST /contacts: Add a contact.
- DELETE /contacts/{id}: Remove a contact.
- POST /messages/scrape: Scrape messages from a chat.
To deploy, simply push this code to your server. Ensure you:
- Install python dependencies.
- Important: You must generate the
circle_dxb_session.sessionfile locally (by runningmain.pyonce) and upload it to the server, OR runmain.pyon the server once to authenticate interactively. - Run
server.py(or use a process manager likesupervisororsystemd).