feat(onebot): report group name change as notify/group_name
Dispatch the 0x2DC subType-16 push by NotifyMessageBody.field13 (was
emoji-react only); field13==12 decodes eventParam as GroupNameChange and
emits notify/group_name {group_id, user_id=operator, name_new}, matching
NapCat. Emoji-react (field13==35) path unchanged.
This commit is contained in:
7 files changed
+128
-3
No files matched your search
@@ -18,6 +18,7 @@ type GroupFileUpload = Extract<QQEventVariant, { kind: 'group_file_upload' }>;
|
||||
type FriendAdd = Extract<QQEventVariant, { kind: 'friend_add' }>;
|
||||
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' }>;
|
||||
|
||||
export function convertGroupMemberJoin(ctx: ConverterContext, event: GroupMemberJoin): JsonObject {
|
||||
return notice(ctx, event, {
|
||||
@@ -157,6 +158,18 @@ export function convertFriendAdd(ctx: ConverterContext, event: FriendAdd): JsonO
|
||||
});
|
||||
}
|
||||
|
||||
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`.
|
||||
return notice(ctx, event, {
|
||||
notice_type: 'notify',
|
||||
sub_type: 'group_name',
|
||||
group_id: event.groupId,
|
||||
user_id: event.operatorUin,
|
||||
name_new: event.name,
|
||||
});
|
||||
}
|
||||
|
||||
export function convertFriendInputStatus(ctx: ConverterContext, event: FriendInputStatus): JsonObject {
|
||||
// Mirrors NapCat's OB11InputStatusEvent: notify/input_status with the peer's
|
||||
// uin, the raw event_type (1 = typing, 3 = recording voice) and status_text.
|
||||
|
||||
Reference in new issue
Block a user