Skip to content

Add Telegram sink #4

Description

@YuyangXueEd

Summary

Add a Telegram delivery sink so users can receive their daily digest as a Telegram message via the Bot API.

Why

Telegram is a primary notification channel for many users, especially in China and Europe. It is also popular in academic and open-source communities.

What to implement

A new sink at sinks/telegram/ that:

  • Sends the daily digest using the Telegram Bot API (sendMessage endpoint)
  • Formats content in Telegram's MarkdownV2 or HTML parse mode
  • Reads credentials from environment variables:
    • TELEGRAM_BOT_TOKEN — bot token from @Botfather
    • TELEGRAM_CHAT_ID — target channel or chat ID
  • Supports splitting long digests into multiple messages if needed (Telegram has a 4096 character limit per message)
  • Respects max_papers, max_hn, max_github config options

How to get started

  1. Copy sinks/_template/ to sinks/telegram/
  2. Look at sinks/slack/ and sinks/serverchan/ as reference implementations
  3. Add config under sinks: in config/sources.yaml:
    sinks:
      telegram:
        enabled: false
        max_papers: 5
        max_hn: 3
        max_github: 3
  4. Register in sinks/__init__.py
  5. Add TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID to .github/workflows/daily.yml env block
  6. Write a test in tests/ — see tests/test_slack_sink.py for the pattern
  7. Add a sinks/telegram/README.md documenting how to create a bot and get a chat ID

Acceptance criteria

  • sinks/telegram/__init__.py with TelegramSink class
  • sinks/telegram/README.md with setup instructions (bot creation, chat ID lookup)
  • Registered in sinks/__init__.py
  • Config block documented in config/sources.yaml (commented out, enabled: false)
  • Both secrets wired into daily.yml
  • At least one test
  • pytest tests/ -q passes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions