No description
This repository has been archived on 2025-10-05. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2025-10-05 16:01:39 +02:00
src/webhook_to_telegram Initial commit 2025-10-05 16:01:39 +02:00
.dockerignore Initial commit 2025-10-05 16:01:39 +02:00
.env.example Initial commit 2025-10-05 16:01:39 +02:00
.gitignore Initial commit 2025-10-05 16:01:39 +02:00
Dockerfile Initial commit 2025-10-05 16:01:39 +02:00
fly.toml Initial commit 2025-10-05 16:01:39 +02:00
poetry.lock Initial commit 2025-10-05 16:01:39 +02:00
pyproject.toml Initial commit 2025-10-05 16:01:39 +02:00
README.md Initial commit 2025-10-05 16:01:39 +02:00

Webhook to Telegram Forwarder

A simple application that forwards HTTP webhook requests to a Telegram chat.

Disclaimer: wholly vibe coded

Setup

  1. Create a Telegram bot using BotFather and get the API token
  2. Get your chat ID (you can use @userinfobot or start a chat with your bot and check the API)
  3. Set the required environment variables:
    • TELEGRAM_TOKEN: Your Telegram bot API token
    • TELEGRAM_CHAT_ID: The chat ID to forward messages to
    • PORT (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 endpoint
  • POST /: 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/