feat(onebot): implement set_group_portrait via highway cmdId 3000
Port the Lagrange.Core protocol path for group avatar upload —
napcat's NTQQ GroupService.setHeader has no oidb wrapper, but
Lagrange.Core/Internal/Context/Logic/Implementation/OperationLogic.cs
spells out the wire shape: same highway HTTP endpoint as personal
avatar, but with cmdId=3000 and a GroupAvatarExtra proto carried as
the `extend` blob (type=101, groupUin, field3={field1=1}, field5=3,
field6=1 — all four are protocol-prescribed constants).
Adds:
- GroupAvatarExtraSchema in proto/oidb-action.ts
- bridge.setGroupAvatar(groupId, source) wrapping the highway upload
- BridgeInterface.setGroupAvatar
- OneBot set_group_portrait action (was a stub returning
'not yet implemented'; accepts the same file-source variants as
set_qq_avatar)
5 new tests: 3 bridge-action (cmdId, extra-blob round-trip, empty-file
guard) + 2 OneBot (forwarding, param validation) — also tightens the
existing setAvatar test to assert the extend blob stays empty.
This commit is contained in:
7 files changed
+134
-3
No files matched your search
@@ -90,6 +90,7 @@ import {
|
||||
setSelfLongNick as setSelfLongNick_,
|
||||
setInputStatus as setInputStatus_,
|
||||
setAvatar as setAvatar_,
|
||||
setGroupAvatar as setGroupAvatar_,
|
||||
fetchCustomFace as fetchCustomFace_,
|
||||
getProfileLike as getProfileLike_,
|
||||
getUnidirectionalFriendList as getUnidirectionalFriendList_,
|
||||
@@ -540,6 +541,9 @@ export class Bridge implements BridgeInterface {
|
||||
async setAvatar(source: string): Promise<void> {
|
||||
return setAvatar_(this, source);
|
||||
}
|
||||
async setGroupAvatar(groupId: number, source: string): Promise<void> {
|
||||
return setGroupAvatar_(this, groupId, source);
|
||||
}
|
||||
async fetchCustomFace(count?: number): Promise<string[]> {
|
||||
return fetchCustomFace_(this, count);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user