Skip to content

fix: proto_decode usage in get rkey #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lagrange/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ async def get_friend_list(self) -> list[BotFriend]:
)

while nextuin_cache:
next = GetFriendListRsp.decode(
next: GetFriendListRsp = GetFriendListRsp.decode(
(
await self.send_oidb_svc(
0xFD4,
Expand All @@ -368,7 +368,7 @@ async def get_friend_list(self) -> list[BotFriend]:
properties.get(27394),
)
)
if next.next:
if next.next and next.next.uin is not None:
nextuin_cache.append(next.next)

return rsp
Expand Down Expand Up @@ -579,13 +579,12 @@ async def get_rkey(self) -> tuple[str, str]:
"""
Returns:
rkey:
Tuple[str, str]: first is private,second is group
Tuple[str, str]: first is private, second is group
"""
body = {
1: {1: {1: 1, 2: 202}, 2: {101: 2, 102: 1, 200: 0}, 3: {1: 2}},
4: {1: [10, 20, 2]},
}
rsp = await self.send_oidb_svc(0x9067, 202, proto_encode(body), True)
a = proto_decode(rsp.data).proto
temp = a[4][1] # type: ignore
return temp[0][1].decode(), temp[1][1].decode() # type: ignore
temp = proto_decode(rsp.data).into((4, 1), dict[int, list[bytes]])
return temp[0][1].decode(), temp[1][1].decode()