Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix: element type error when check reply#219

Merged
yanyongyu merged 2 commits into
nonebot:masternonebot/adapter-qq:masterfrom
botbikamordehai2-sketch:fix/issue-217-1784548501botbikamordehai2-sketch/adapter-qq:fix/issue-217-1784548501Copy head branch name to clipboard
Jul 21, 2026
Merged

Fix: element type error when check reply#219
yanyongyu merged 2 commits into
nonebot:masternonebot/adapter-qq:masterfrom
botbikamordehai2-sketch:fix/issue-217-1784548501botbikamordehai2-sketch/adapter-qq:fix/issue-217-1784548501Copy head branch name to clipboard

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown
Contributor

What

When a user quotes/forwards a message in a group with 群全量 event mode, _check_reply assumes the first element in msg_elements is a reply segment and tries to access its author attribute. But forwarded messages produce a different segment type (e.g., 'multi_msg' or 'forward'), which may not have author, causing a parsing error.

Fix

Add a check that the first element is actually a 'reply' type before attempting to use it as event.reply. If it's not a reply, return early without setting reply. This prevents crashes and correctly ignores non-reply elements.

Closes #217

@yanyongyu yanyongyu added the bug Something isn't working label Jul 21, 2026
@yanyongyu yanyongyu changed the title fix: check element type before treating as reply in _check_reply (closes #217) Fix: element type error when check reply Jul 21, 2026
@yanyongyu
yanyongyu merged commit 0d8837f into nonebot:master Jul 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

群全量(全部群消息)状态下,用户 引用 [转发消息] 会报错

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.