Skip to content

Improve Telegram notification formatting for Max messages - #4

Draft
erop39 wants to merge 1 commit into
mainfrom
cursor/telegram-message-formatting-7c22
Draft

Improve Telegram notification formatting for Max messages#4
erop39 wants to merge 1 commit into
mainfrom
cursor/telegram-message-formatting-7c22

Conversation

@erop39

@erop39 erop39 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Adds configurable Telegram message formatting to make Max notifications easier to read when multiple users post in quick succession.

  • Enhanced mode (default): stronger headers with sender name and timestamp, message body in <blockquote>, separator line when the sender changes
  • Compact mode: same as enhanced, but hides repeated headers when the same user posts consecutive messages
  • Plain mode: restores the previous formatting (TG_FORMAT_STYLE=plain)

Configuration

Variable Default Description
TG_FORMAT_STYLE enhanced plain, enhanced, or compact
TG_FORMAT_SEPARATOR true Show ━━━━━━━━━━━━━━━━ when sender changes
TG_FORMAT_TIMESTAMP true Show HH:MM in the header

Example (enhanced)

💬 Иван Иванов · 14:30

> Привет

━━━━━━━━━━━━━━━━
💬 Петр Сидоров · 14:31

> +1

Test plan

  • pytest — 243 tests passed
  • Unit tests for _format_time, _build_header, _needs_separator, MessageFormatter
  • Config tests for new env vars and invalid style fallback
Open in Web Open in Cursor 

Add configurable message styles (plain, enhanced, compact) with
sender-change separators, timestamps, and blockquote body text to
make notifications from different users easier to scan in Telegram.

Co-authored-by: eGoR <erop39@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants