diff --git a/lagrange/client/client.py b/lagrange/client/client.py index 5b48c73..66f32b7 100644 --- a/lagrange/client/client.py +++ b/lagrange/client/client.py @@ -16,7 +16,7 @@ from lagrange.info import AppInfo, DeviceInfo, SigInfo from lagrange.pb.message.msg_push import MsgPushBody from lagrange.pb.message.send import SendMsgRsp -from lagrange.pb.service.comm import SendNudge +from lagrange.pb.service.comm import SendGrpBotHD, SendNudge from lagrange.pb.service.friend import ( GetFriendListRsp, GetFriendListUin, @@ -559,3 +559,21 @@ async def get_user_info( return UserInfo.from_pb(rsp.body[0]) else: return [UserInfo.from_pb(body) for body in rsp.body] + + async def set_grp_bot_hd( + self, grp_id: int, bot_id: int, data_1: str = "", data_2: str = "" + ): + await self.send_oidb_svc( + 0x112E, + 1, + SendGrpBotHD( + grp_id=grp_id, bot_id=bot_id, B_id=data_1, B_data=data_2 + ).encode(), + ) + + async def set_c2c_bot_hd(self, bot_id: int, data_1: str = "", data_2: str = ""): + await self.send_oidb_svc( + 0x112E, + 1, + SendGrpBotHD(bot_id=bot_id, B_id=data_1, B_data=data_2).encode(), + ) diff --git a/lagrange/pb/service/comm.py b/lagrange/pb/service/comm.py index 7dda6d3..00da058 100644 --- a/lagrange/pb/service/comm.py +++ b/lagrange/pb/service/comm.py @@ -11,3 +11,13 @@ class SendNudge(ProtoStruct): to_grp: Optional[int] = proto_field(2) to_uin: Optional[int] = proto_field(5) field6: int = proto_field(6, default=0) + + +class SendGrpBotHD(ProtoStruct): + bot_id: int = proto_field(3) + seq: int = proto_field(4, default=111111) # nobody care + B_id: str = proto_field(5, default="") # set button_id + B_data: str = proto_field(6, default="") # set button_data + IDD: int = proto_field(7, default=0) + grp_id: int = proto_field(8, default=None) + grp_type: int = proto_field(9, default=0) # 0guild 1grp 2C2C(need grp_id==None)