群聊场景命令特殊处理

This commit is contained in:
Raven95676
2025-04-10 14:54:25 +08:00
parent db257af58e
commit a1481fb179
@@ -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":