perf: tg适配器同步aiocqhttp处理逻辑

This commit is contained in:
Raven95676
2025-05-12 15:04:23 +08:00
parent a730cee7fd
commit 3ad2c46f3f
@@ -282,10 +282,12 @@ class TelegramPlatformAdapter(Platform):
entity.offset + 1 : entity.offset + entity.length
]
message.message.append(Comp.At(qq=name, name=name))
plain_text = (
plain_text[: entity.offset]
+ plain_text[entity.offset + entity.length :]
)
# 如果mention是当前bot则移除;否则保留
if name.lower() == context.bot.username.lower():
plain_text = (
plain_text[: entity.offset]
+ plain_text[entity.offset + entity.length :]
)
if plain_text:
message.message.append(Comp.Plain(plain_text))