feat(frontends): add tgapp_plus_v2.py — Rich rendering Telegram frontend - #764
Open
v2up-32mb wants to merge 1 commit into
Open
feat(frontends): add tgapp_plus_v2.py — Rich rendering Telegram frontend#764v2up-32mb wants to merge 1 commit into
v2up-32mb wants to merge 1 commit into
Conversation
…elegram - Rich native rendering via Bot API sendRichMessage (tables/task-list/details/fenced math) - Three-tier fallback: Rich -> MarkdownV2 -> plain text - TG Desktop adaptation (CJK garble / Math crash auto-skip) - GFM table support (_wrap_markdown_tables) - Quoted message extraction (_extract_quoted_content from rich_message.blocks) - Turn-summary expandable blockquote - Enhanced _TelegramStreamSession (Rich send/edit dual-path + fallback latch) - No extra dependencies (only python-telegram-bot, same as tgapp.py)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
新增
frontends/tgapp_plus_v2.py,一个增强版 Telegram Bot 前端,在tgapp.py基础上增加了 Telegram Rich 原生渲染能力。相比 tgapp.py 的改进
sendRichMessage:表格 / task-list /<details>折叠 / 块级公式format_message) → 纯文本(_strip_mdv2)_wrap_markdown_tables把管道表格重写为粗体+列表_extract_quoted_content从rich_message.blocks还原(支持 quote / external_reply / reply_to)expandable blockquote引用块_TelegramStreamSession基础关键设计
额外依赖
无额外依赖。与
tgapp.py的 import 完全一致,仅依赖原有的python-telegram-bot。兼容性
tgapp.py,不影响现有功能tgapp.py的可选替代前端使用