From 32ea611f0c41f4f10cd728ea74ca99535d90fcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E6=99=BA=E8=B6=850668000959?= Date: Fri, 5 Jun 2026 09:37:00 +0800 Subject: [PATCH] fix(onebot): use prefixed chatID for group reply routing When an incoming group message is received, the inbound context ChatID was set to the raw group number without the group: prefix. This caused the outbound reply to use send_private_msg instead of send_group_msg. Fix by using the prefixed chatID as inbound context ChatID. Closes #3002 --- pkg/channels/onebot/onebot.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/channels/onebot/onebot.go b/pkg/channels/onebot/onebot.go index f0d0a890f..76320b6d4 100644 --- a/pkg/channels/onebot/onebot.go +++ b/pkg/channels/onebot/onebot.go @@ -995,7 +995,6 @@ func (c *OneBotChannel) handleMessage(raw *oneBotRawEvent) { senderID := strconv.FormatInt(userID, 10) var chatID string - var contextChatID string var contextChatType string metadata := map[string]string{} @@ -1007,13 +1006,11 @@ func (c *OneBotChannel) handleMessage(raw *oneBotRawEvent) { switch raw.MessageType { case "private": chatID = "private:" + senderID - contextChatID = senderID contextChatType = "direct" case "group": groupIDStr := strconv.FormatInt(groupID, 10) chatID = "group:" + groupIDStr - contextChatID = groupIDStr contextChatType = "group" metadata["group_id"] = groupIDStr @@ -1080,7 +1077,7 @@ func (c *OneBotChannel) handleMessage(raw *oneBotRawEvent) { inboundCtx := bus.InboundContext{ Channel: c.Name(), - ChatID: contextChatID, + ChatID: chatID, ChatType: contextChatType, SenderID: senderID, MessageID: messageID,