diff --git a/astrbot/core/platform/sources/telegram/tg_adapter.py b/astrbot/core/platform/sources/telegram/tg_adapter.py index 33211288..4aefdb97 100644 --- a/astrbot/core/platform/sources/telegram/tg_adapter.py +++ b/astrbot/core/platform/sources/telegram/tg_adapter.py @@ -247,6 +247,16 @@ class TelegramPlatformAdapter(Platform): # 处理文本消息 plain_text = update.message.text + # 群聊场景命令特殊处理 + if plain_text.startswith("/"): + command_parts = plain_text.split(" ", 1) + if "@" in command_parts[0]: + command, bot_name = command_parts[0].split("@") + if bot_name == self.client.username: + plain_text = command + ( + f" {command_parts[1]}" if len(command_parts) > 1 else "" + ) + if update.message.entities: for entity in update.message.entities: if entity.type == "mention":