matrixlib.events module

Classes that represent Matrix events

class matrixlib.events.Event(type: str, sender: str, content: dict[str, Any], unsigned: dict[str, Any] | None = None, **kwargs)

Base class for Matrix events

classmethod is_valid(data)
static schema()
to_dict() dict

Return a dict representation of the event, e.g. for serialization

class matrixlib.events.RoomEvent(event_id: str, room_id: str, origin_server_ts: int, **kwargs)

Represents an event sent in a room

static schema()
static schema_without_room_id()
to_dict() dict

Return a dict representation of the event, e.g. for serialization

class matrixlib.events.StateEvent(state_key: str, **kwargs)

Represents a state room

static schema()
static schema_without_room_id()
to_dict() dict

Return a dict representation of the event, e.g. for serialization