Event Reference¶
Through the Client.event() decorator, you can subscribe to realtime events that the library dispatches.
This page lists the various events and their parameters.
Global Events¶
-
backtracked.on_ready()¶ Called when the websocket connection was successfully established. Usually this call is used exclusively for joining rooms.
Room Events¶
-
backtracked.on_member_presence(room, user)¶ Emitted when a user in a room changes presence.
-
backtracked.on_chat(message)¶ Emitted when a user sends a chat message in a joined room. You can access the room and user via fields on the
Messageobject.- Parameters
message –
Messagethat was received.
-
backtracked.on_chat_delete(message)¶ Emitted when a message is deleted. This does not remove the message from the local cache.
Message.deletedwill be True.- Parameters
message –
Messagewhich was deleted.
-
backtracked.on_dub(song, user, dubtype)¶ Emitted when a user “dubs” a song. (In practice, this is always the current song.) You can get the type of the dub via the
dubtypeparameter.
-
backtracked.on_playlist_song_add(song)¶ Emitted when a new song is added to the current room queue.
- Parameters
song –
Songobject representing the item that was added.
User Events¶
When subscribed to user rooms via User.open_conversation(), you can receive user-specific events.
-
backtracked.on_private_message(conversation)¶ Emitted when a user sends you a private message. Unlike
on_chat(), this does not fire for the connected client’s messages.- Parameters
conversation –
Conversationwhich the new message was sent in.