Welcome to Telefetcher!

Telefetcher helps you collect Telegram group messages and deliver them to your server via webhooks or manual fetch.

Motivation

Telefetcher was created while I was working on a Product Management assignment that required building a Telegram chatbot (ChatsTodo) capable of summarizing chats, creating todo list and recommending next actions. I needed an easy way to collect messages from Telegram groups in a structured, accessible format. This led me to build Telefetcher as a standalone tool to fetch and forward Telegram messages via API. I later expanded its use for a personal group bot that helped my friends plan outings, summarize discussions, and split bills based on chat history. The goal was to make chat-based automation and insights simple for developers and users alike.

How it works

  1. Add @telefetcherbot to your Telegram group as an admin.
  2. Send /start in the group to register and get your Access Key.
  3. Configure your webhook URL using the provided API (optional).
  4. Use /fetch to deliver buffered messages to your webhook or download them manually.

Try the API

Manage your group’s webhook settings easily using our Swagger docs:

Open API Docs

Example: Set Webhook

POST https://telefetcher.com/set_webhook
Content-Type: application/json

{
  "gid": "-123456789",
  "access_key": "your-access-key-here",
  "webhook_url": "https://yourserver.com/receive"
}
    

Note: If you omit webhook_url, the webhook will be removed and you will fetch messages manually.

Fetching Messages

Send the /fetch command in your group to either:

Need help using Telefetcher in code?

Here’s a prompt you can use with ChatGPT or any AI coding assistant:

I want to collect Telegram messages using Telefetcher.

Telefetcher API Info:
- Set webhook via POST /set_webhook
- Fetch messages with /fetch command in the group
- Messages will be posted to my webhook or sent back as a file.

Requirements:
1. Show me how to set the webhook using httpx.
2. Show me how to fetch and handle messages posted by Telefetcher.
3. Remind me to first /start the bot in my group to get my access key.
4. Handle webhook errors gracefully.