From d379e012c491d9502e644445657c3ce2ccdc7a5f Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Tue, 25 Mar 2025 14:03:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20telegram=20/start=20issue?= =?UTF-8?q?=20#751?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/platform/sources/telegram/tg_adapter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/astrbot/core/platform/sources/telegram/tg_adapter.py b/astrbot/core/platform/sources/telegram/tg_adapter.py index b12478d5f..77fe3e42b 100644 --- a/astrbot/core/platform/sources/telegram/tg_adapter.py +++ b/astrbot/core/platform/sources/telegram/tg_adapter.py @@ -100,7 +100,8 @@ class TelegramPlatformAdapter(Platform): async def message_handler(self, update: Update, context: ContextTypes.DEFAULT_TYPE): logger.debug(f"Telegram message: {update.message}") abm = await self.convert_message(update, context) - await self.handle_msg(abm) + if abm: + await self.handle_msg(abm) async def convert_message( self, update: Update, context: ContextTypes.DEFAULT_TYPE, get_reply=True @@ -178,7 +179,7 @@ class TelegramPlatformAdapter(Platform): message.message.append(Comp.Plain(plain_text)) message.message_str = plain_text - if message.message_str == "/start": + if message.message_str.strip() == "/start": await self.start(update, context) return