Skip to content

How to receive steam messages #391

Answered by Gobot1234
Detla7t asked this question in Q&A
Jul 14, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

To handle messages you need to listen for the "chat_message" event you also shouldn't register the listener inside of a while True loop, your code should like more like

client = ...

@client.on("chat_message")
def on_message(user: steam.client.user.User, text: str):
    ...

client.cli_logon()

Recieving messages from a group/clan currently isn't handled by the client by default see #13 for more. You can implement for them yourself with a bit of fandangling.

@client.on("ChatRoomClient.NotifyIncomingChatMessage#1")
def on_clan_or_group_message(msg):
    ... # go wild with msg, (it should be a wrapper around https://github.com/ValvePython/steam/blob/bf3cb330d3e4303a20092e842c503e373294382f/p…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Detla7t
Comment options

@Gobot1234
Comment options

@Detla7t
Comment options

Answer selected by Detla7t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants