Skip to content

fix(tgapp): polish Telegram MarkdownV2 rendering and startup helpers#160

Merged
lsdefine merged 2 commits intolsdefine:mainfrom
YooooEX:telegram-polish
Apr 25, 2026
Merged

fix(tgapp): polish Telegram MarkdownV2 rendering and startup helpers#160
lsdefine merged 2 commits intolsdefine:mainfrom
YooooEX:telegram-polish

Conversation

@YooooEX
Copy link
Copy Markdown
Contributor

@YooooEX YooooEX commented Apr 24, 2026

Context

Telegram replies already use a MarkdownV2 rendering path, but a few edge cases still made the output less
polished:

  • [FILE:...] markers were removed from the message body after attachment extraction, so users could receive
    attachments without an inline filename reference.
  • Telegram startup still duplicated helper logic that is already shared by other chat frontends.
  • Common Markdown styles like __bold__ and ~~strikethrough~~ were not converted into Telegram MarkdownV2
    entities.

This PR keeps the change radius inside frontends/tgapp.py. No new dependencies are added.

Summary

Polish Telegram message rendering and startup wiring by reusing shared frontend helpers, keeping file marker
basenames visible in replies, and expanding Markdown-to-MarkdownV2 conversion for common bold and strikethrough
styles.

Changes

frontends/tgapp.py

  • Reuse shared chat frontend helpers for single-instance locking, runtime checks, and log redirection.
  • Keep [FILE:...] markers visible in the reply body as basenames while still resolving and sending matching
    files as Telegram attachments.
  • Convert common Markdown __bold__ input to Telegram MarkdownV2 bold output.
  • Convert GFM-style ~~strikethrough~~ input to Telegram MarkdownV2 strikethrough output.

Copy link
Copy Markdown
Owner

@lsdefine lsdefine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Confirmed it applies cleanly and the Telegram polish changes are scoped.

@lsdefine lsdefine merged commit c19ac2d into lsdefine:main Apr 25, 2026
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