feat(onebot): report group special title grant as notify/title
Decode the 0x2DC subType-16 field13==6 push: eventParam carries the member
uin (f5) and a gray-tip template (f2) whose last rich token holds the title
text. Emit notify/title {group_id, user_id, title}, matching NapCat. Field
layout taken from a real on-wire sample, not ported blindly.
This commit is contained in:
7 files changed
+133
-2
No files matched your search
@@ -20,6 +20,7 @@ type GroupMsgEmojiLike = Extract<QQEventVariant, { kind: 'group_msg_emoji_like'
|
||||
type FriendInputStatus = Extract<QQEventVariant, { kind: 'friend_input_status' }>;
|
||||
type GroupNameChange = Extract<QQEventVariant, { kind: 'group_name_change' }>;
|
||||
type GroupCardChange = Extract<QQEventVariant, { kind: 'group_card_change' }>;
|
||||
type GroupTitleChange = Extract<QQEventVariant, { kind: 'group_title_change' }>;
|
||||
|
||||
export function convertGroupMemberJoin(ctx: ConverterContext, event: GroupMemberJoin): JsonObject {
|
||||
return notice(ctx, event, {
|
||||
@@ -171,6 +172,18 @@ export function convertGroupCardChange(ctx: ConverterContext, event: GroupCardCh
|
||||
});
|
||||
}
|
||||
|
||||
export function convertGroupTitleChange(ctx: ConverterContext, event: GroupTitleChange): JsonObject {
|
||||
// Mirrors NapCat's OB11GroupTitleEvent: notify/title with the recipient's uin
|
||||
// and the granted title text.
|
||||
return notice(ctx, event, {
|
||||
notice_type: 'notify',
|
||||
sub_type: 'title',
|
||||
group_id: event.groupId,
|
||||
user_id: event.userUin,
|
||||
title: event.title,
|
||||
});
|
||||
}
|
||||
|
||||
export function convertGroupNameChange(ctx: ConverterContext, event: GroupNameChange): JsonObject {
|
||||
// Mirrors NapCat's OB11GroupNameEvent: notify/group_name with the operator's
|
||||
// uin as user_id and the new name in `name_new`.
|
||||
|
||||
Reference in new issue
Block a user