ValvePython / steam

☁️ Python package for interacting with Steam
http://steam.readthedocs.io
MIT License
1.1k stars 137 forks source link

[FEATURE REQUEST] Take over steam chat, User to user messaging #427

Open ZangYUzhang opened 1 year ago

ZangYUzhang commented 1 year ago

Taking over Steam chat and realizing the reception and transmission of Steam messages.

Here you can get all the socket addresses for Steamchat: https://api.steampowered.com/ISteamDirectory/GetCMList/v1/?cellid=0

Here you can get information about the currently logged-in account: https://steamcommunity.com/chat/clientjstoken

Finally, connect them together to realize the reception and transmission of messages.

Gobot1234 commented 1 year ago

You can already send messages to users using https://steam.readthedocs.io/en/stable/api/steam.client.user.html#steam.client.user.SteamUser.send_message and you can receive them by listening for the EVENT_CHAT_MESSAGE event with client.on

ZangYUzhang commented 1 year ago

You can already send messages to users using https://steam.readthedocs.io/en/stable/api/steam.client.user.html#steam.client.user.SteamUser.send_message and you can receive them by listening for the EVENT_CHAT_MESSAGE event with client.on

classs team.client.user.SteamUser(steam_id, steam) Do you know what the parameter steam is? the reuqests.session()?

Gobot1234 commented 1 year ago

You aren't meant to construct the class yourself, you are meant to use SteamClient.get_user to get user instances as suggested by the docstring

ZangYUzhang commented 1 year ago

OMG, I still don't know what the second parameter ‘’steam‘’ is in classes SteamUser (steam_id, steam)。 i think the parameter 'steam' s something with my account identity...but how to get it.. also i cant found SteamClient.get_user ... what's that... I know that to send a steam message, at frist we need open a friend's chat then ISteamMessagesService.SendMessage # 1 message text to send message to friend

Can you give me a sample code?ty very much

Gobot1234 commented 1 year ago

https://steam.readthedocs.io/en/latest/api/steam.client.html#steam.client.SteamClient.get_user

ZangYUzhang commented 1 year ago

1677345615919 check img, here is no the path of steam > client > 'SteamClient' ?? Where am I stuck??

Gobot1234 commented 1 year ago

It's in __init__.py you import it using from steam.client import SteamClient.

p.s you should probably make this a discussion