feat(onebot): add group_name to group message events (#212)

Group message events (message + message_sent) now carry group_name — a
non-standard but common OneBot extension. The name comes from the
message's own wire field (ResponseGrp field 7, accurate even right after
a rename), falling back to the identity group cache, else '' when neither
is available. It's resolved in the group-message decoder, where both the
wire head and the identity cache are already at hand, so the converter
just passes it through (no ConverterContext change).

Verified live (tempserver): real inbound group messages from a non-self
account carry group_name set to the actual group name.
This commit is contained in:
DrSmoothl committed 2026-07-09 18:50:54 +08:00
1 parent 7ab91c81e9
commit 9b470d0412
5 files changed
+15 -3

No files matched your search

+4
View File
@@ -133,6 +133,10 @@ export interface FriendMessage extends QQEvent {
export interface GroupMessage extends QQEvent {
kind: 'group_message';
groupId: number;
/** Group display name. From the message's own wire field (ResponseGrp
* field 7 — accurate even right after a rename), falling back to the
* identity group cache, else '' when neither is available. */
groupName: string;
senderUin: number;
senderNick: string;
senderCard: string;