No description
| src/webhook_to_telegram | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile | ||
| fly.toml | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
Webhook to Telegram Forwarder
A simple application that forwards HTTP webhook requests to a Telegram chat.
Disclaimer: wholly vibe coded
Setup
- Create a Telegram bot using BotFather and get the API token
- Get your chat ID (you can use @userinfobot or start a chat with your bot and check the API)
- Set the required environment variables:
TELEGRAM_TOKEN: Your Telegram bot API tokenTELEGRAM_CHAT_ID: The chat ID to forward messages toPORT(optional): The port to run the server on (default: 5000)
Running the Application
Using Poetry:
poetry install
poetry run start
Or with Python directly:
pip install -e .
python -m webhook_to_telegram
Usage
The application exposes two endpoints:
GET /: A simple health check endpointPOST /: The webhook endpoint that forwards data to Telegram
All POST requests to the root endpoint will be formatted and sent to the configured Telegram chat. Both JSON and non-JSON payloads are supported.
Example
To test the webhook:
curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello from webhook!"}' http://localhost:5000/