From 258171c9c4bfa8e981abf4510ea4adfa254e12f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=AF=E5=A4=A7=E4=BE=A0?= Date: Wed, 11 Feb 2026 01:40:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(telegram):=20=E4=BF=AE=E5=A4=8D=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=A0=87=E9=A2=98=E5=90=AB=E7=89=B9=E6=AE=8A=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E6=97=B6=E5=BC=82=E5=B8=B8=E6=98=BE=E7=A4=BA**?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/telegram/telegram.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/modules/telegram/telegram.py b/app/modules/telegram/telegram.py index 86817b8a..20457e1f 100644 --- a/app/modules/telegram/telegram.py +++ b/app/modules/telegram/telegram.py @@ -237,10 +237,14 @@ class Telegram: return False try: - if title and text: - caption = f"**{title}**\n{text}" - elif title: - caption = f"**{title}**" + # 标准化标题后再加粗,避免**符号被显示为文本 + bold_title = ( + f"**{standardize(title).removesuffix('\n')}**" if title else None + ) + if bold_title and text: + caption = f"{bold_title}\n{text}" + elif bold_title: + caption = bold_title elif text: caption = text else: