Skip to content

[fix]修复临时会话消息被错误发送到群聊的bug#122

Merged
fumiama merged 4 commits intowdvxdr1123:mainfrom
xyy0411:pr-1
Apr 4, 2026
Merged

[fix]修复临时会话消息被错误发送到群聊的bug#122
fumiama merged 4 commits intowdvxdr1123:mainfrom
xyy0411:pr-1

Conversation

@xyy0411
Copy link
Copy Markdown
Contributor

@xyy0411 xyy0411 commented Mar 28, 2026

这个pr是为了修复
此前通过 GroupID != 0 判断消息发送目标(群聊/私聊),
但在 临时会话(私聊)也可能包含 GroupID
导致消息被错误发送到群聊。
此前的效果图,如果有reply则会
image

@xyy0411 xyy0411 changed the title [fix]修复临时会话消息被错误发送到群聊的问题 [fix]修复临时会话消息被错误发送到群聊的bug Mar 28, 2026
@xyy0411
Copy link
Copy Markdown
Contributor Author

xyy0411 commented Mar 28, 2026

@fumiama

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复在临时会话(私聊)事件可能携带 GroupID 的情况下,Ctx.Send 通过 GroupID != 0 推断目标导致回复被错误发送到群聊的问题;改为优先根据 message_type(group/private)选择发送目标,从而确保临时会话按私聊路径发送。

Changes:

  • Ctx.Send 在普通消息发送场景下改用 event.MessageType(group/private)决定调用 SendGroupMessage / SendPrivateMessage
  • Ctx.Send 在合并转发场景下同样基于 event.MessageType 决定调用 SendGroupForwardMessage / SendPrivateForwardMessage
  • 保留 MessageType 异常/缺失时的兜底逻辑(继续回退到 GroupID != 0 的判断)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread context.go Outdated
Comment thread context.go Outdated
@fumiama fumiama merged commit 352177d into wdvxdr1123:main Apr 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants