Events
This module contains data structures for events received from the server.
- class miney.events.ChatCommandEvent(client_id: str, command_name: str, issuer: str, param: str, timestamp: float = <factory>)[source]
An event representing a chat command invocation.
- class miney.events.ChatMessageEvent(client_id: str, sender_name: str, message: str, timestamp: float = <factory>)[source]
An event representing a chat message.
- class miney.events.Event(name: str, client_id: str)[source]
Represents a generic event received from the server.
- class miney.events.GenericEvent(name: str, client_id: str, raw_payload: ~typing.Dict[str, ~typing.Any], timestamp: float = <factory>)[source]
An event for which no specific type is defined.
- class miney.events.PlayerJoinsEvent(client_id: str, player_name: str, last_login: ~datetime.datetime | None, timestamp: float = <factory>)[source]
An event representing a player joining the server.
- class miney.events.PlayerLeavesEvent(client_id: str, player_name: str, timed_out: bool, timestamp: float = <factory>)[source]
An event representing a player leaving the server.
- miney.events.create_event(raw_event: Dict[str, Any]) Event[source]
Factory function to create a specific Event object from a raw dictionary. This function flattens the ‘payload’ dictionary into the event’s attributes.
- Parameters:
raw_event – The dictionary received from the server.
- Returns:
A specific subclass of Event (e.g., ChatMessageEvent).