-
Notifications
You must be signed in to change notification settings - Fork 134
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
Query chat #299
Comments
I have not looked at exactly the flow of messages for the new chat system, but its all in the chat protobuf. Retrieve message history: steam/protobufs/steammessages_chat.proto Lines 454 to 482 in 6f955c4
Members and state: steam/protobufs/steammessages_chat.proto Lines 520 to 526 in 6f955c4
These are unified messages, and you use https://steam.readthedocs.io/en/latest/api/steam.client.html#steam.client.SteamClient.send_um or The RPC definitions are at the end of the file. So for example, steam/protobufs/steammessages_chat.proto Lines 1073 to 1075 in 6f955c4
Your code might look like: client = SteamClient()
# CChatRoom_GetChatRoomGroupState_Request
msg = client.send_um_and_wait("ChatRoom.GetChatRoomGroupState#1", {"chat_group_id": 12345"})
# CChatRoom_GetChatRoomGroupState_Response
print(msg) |
Thanks; to refine my inquiry, I seek contents of a private chat window between myself and a Friend. This is more involved as I don't presume one can retrieve such information without authentication (... I hope?); is this something |
You can get the recent messages of friends. It's a different service: steam/protobufs/steammessages_friendmessages.proto Lines 6 to 28 in 6f955c4
|
Made several attempts, can't get from steam.client import SteamClient
from steam.steamid import SteamID
client = SteamClient()
client.cli_login()
id1_64 = 76561198066775726 # me
id2_64 = # friend with recent chat
id1 = SteamID(id1_64).id#as_32
id2 = SteamID(id1_64).id#as_32
#%%########################################
msg = client.send_um_and_wait(
"FriendMessages.GetRecentMessages#1",
{"steamid1": id1,
"steamid2": id2,
"count": 100,
"most_recent_conversation": True},
)
print(msg) |
client.send_um_and_wait("FriendMessages.GetRecentMessages#1_Request", dict(steamid1=id1_64, steamid2=id2_64, count=100)) Should work. (Although I'm on mobile and can't test) |
@Gobot1234 |
Oh sorry yes change that to just what you had for that so |
Closing as it looks resolved |
My Dec 24 comment remains unresolved |
What's unresolved? In your code, id1 = SteamID(id1_64).id#as_32
id2 = SteamID(id1_64).id#as_32
Basic example, and it works as one would expect: >>> msg = client.send_um_and_wait("FriendMessages.GetRecentMessages#1", {
'steamid1': client.steam_id, 'steamid2': 7xxxxxxxxxxxxxxxxxx, 'count': 2})
>>> print(msg)
<MsgProto(<EMsg.ServiceMethodResponse: 147> | CFriendMessages_GetRecentMessages_Response)>
-------------- header --
steamid: 7xxxxxxxxxxxxxxxxxx
client_sessionid: 111111111
jobid_target: 9
target_job_name: "FriendMessages.GetRecentMessages#1"
eresult: 1
---------------- body --
messages {
accountid: 111111
timestamp: 1234
message: "asdasdasdasd"
}
messages {
accountid: 222222
timestamp: 1235
message: "lol"
}
more_available: true |
I see it's a work in progress; any working code that'd let me retrieve contents of a Friends chat window? Text and user names mainly.
The text was updated successfully, but these errors were encountered: