Skip to content

Commit b54ff93

Browse files
committed
Merge remote-tracking branch 'origin/broken' into back
# Conflicts: # lagrange/client/client.py
2 parents 65677d9 + 82fea70 commit b54ff93

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

lagrange/client/client.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from lagrange.info import AppInfo, DeviceInfo, SigInfo
1717
from lagrange.pb.message.msg_push import MsgPushBody
1818
from lagrange.pb.message.send import SendMsgRsp
19-
from lagrange.pb.service.comm import SendNudge
19+
from lagrange.pb.service.comm import SendGrpBotHD, SendNudge
2020
from lagrange.pb.service.friend import (
2121
GetFriendListRsp,
2222
GetFriendListUin,
@@ -562,6 +562,24 @@ async def get_user_info(
562562
else:
563563
return [UserInfo.from_pb(body) for body in rsp.body]
564564

565+
async def set_grp_bot_hd(
566+
self, grp_id: int, bot_id: int, data_1: str = "", data_2: str = ""
567+
):
568+
await self.send_oidb_svc(
569+
0x112E,
570+
1,
571+
SendGrpBotHD(
572+
grp_id=grp_id, bot_id=bot_id, B_id=data_1, B_data=data_2
573+
).encode(),
574+
)
575+
576+
async def set_c2c_bot_hd(self, bot_id: int, data_1: str = "", data_2: str = ""):
577+
await self.send_oidb_svc(
578+
0x112E,
579+
1,
580+
SendGrpBotHD(bot_id=bot_id, B_id=data_1, B_data=data_2).encode(),
581+
)
582+
565583
async def get_group_last_seq(self, grp_id: int) -> int:
566584
rsp = GetGrpLastSeqRsp.decode(
567585
(

lagrange/pb/service/comm.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ class SendNudge(ProtoStruct):
1111
to_grp: Optional[int] = proto_field(2)
1212
to_uin: Optional[int] = proto_field(5)
1313
field6: int = proto_field(6, default=0)
14+
15+
16+
class SendGrpBotHD(ProtoStruct):
17+
bot_id: int = proto_field(3)
18+
seq: int = proto_field(4, default=111111) # nobody care
19+
B_id: str = proto_field(5, default="") # set button_id
20+
B_data: str = proto_field(6, default="") # set button_data
21+
IDD: int = proto_field(7, default=0)
22+
grp_id: int = proto_field(8, default=None)
23+
grp_type: int = proto_field(9, default=0) # 0guild 1grp 2C2C(need grp_id==None)

0 commit comments

Comments
 (0)