nonebot / nonebot/plugin-alconna

[Bug]当at_sender=True时会追加一个<@openid>字符串

Open
#148 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
143
Forks
27
PR merge metrics
No merged PRs in 30d

Description

请确认:

  • 问题的标题明确
  • 我翻阅过其他的issue并且找不到类似的问题
  • 我已经阅读了相关文档 并仍然认为这是一个Bug

Bug

问题

0.62.1版本官机在群聊里无论开不开全量,当at_sender=True时会追加一个<@openid>字符串。
回退0.62.0就正常,还为此专门写了插件来测试。

最简测试:不走 MessageUtils,直接用 Alconna UniMessage + at_sender

test_alc_at = on_alconna(
Alconna("测试艾特"),
aliases={"测试at", "testat"},
priority=5,
block=True,
)

@test_alc_at.handle()
async def _(bot: Bot, event: Event):
uid = event.get_user_id()
logger.info(
"alc at_sender 测试: self_id={} user_id={} event={}",
bot.self_id,
uid,
event.class.name,
)
await UniMessage(f"alc原生at_sender测试 uid={uid}").send(at_sender=True)

如何复现

任何at_sender=True的消息

使用环境:

  • Python 版本: 3.10.5
  • Nonebot2 版本: 2.5.0
  • Alconna 版本: 0.62.1

日志/截图

Image Image Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the minimal on_alconna example with UniMessage and at_sender=True on Alconna 0.62.1, then inspect the message-send path that handles at_sender. Compare the behavior with version 0.62.0. Done means sending the message no longer appends an unexpected <@openid> string while preserving the intended at-sender behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.