mautrix.client.state_store
- class mautrix.client.state_store.StateStore
Bases:
abc.ABC
- abstract async get_encryption_info(room_id)
- Parameters
room_id (mautrix.types.RoomID) –
- Return type
- abstract async get_member(room_id, user_id)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
- Return type
- abstract async get_member_profiles(room_id, memberships=(Membership.JOIN, Membership.INVITE))
- Parameters
room_id (mautrix.types.RoomID) –
memberships (tuple[mautrix.types.Membership, ...]) –
- Return type
- async get_members(room_id, memberships=(Membership.JOIN, Membership.INVITE))
- Parameters
room_id (mautrix.types.RoomID) –
memberships (tuple[mautrix.types.Membership, ...]) –
- Return type
- async get_members_filtered(room_id, not_prefix, not_suffix, not_id, memberships=(Membership.JOIN, Membership.INVITE))
A filtered version of get_members that only returns user IDs that aren’t operated by a bridge. This should return the same as
get_members()
, except users where the user ID is equal to not_id OR it starts with not_prefix AND ends with not_suffix.The default implementation simply calls
get_members()
, but databases can implement this more efficiently.- Parameters
room_id (mautrix.types.RoomID) – The room ID to find.
not_prefix (str) – The user ID prefix to disallow.
not_suffix (str) – The user ID suffix to disallow.
not_id (str) – The user ID to disallow.
memberships (tuple[mautrix.types.Membership, ...]) – The membership states to include.
- Return type
- async get_membership(room_id, user_id)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
- Return type
- abstract async get_power_levels(room_id)
- Parameters
room_id (mautrix.types.RoomID) –
- Return type
- abstract async has_encryption_info_cached(room_id)
- Parameters
room_id (mautrix.types.RoomID) –
- Return type
- abstract async has_full_member_list(room_id)
- Parameters
room_id (mautrix.types.RoomID) –
- Return type
- async has_power_level(room_id, user_id, event_type)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
event_type (mautrix.types.EventType) –
- Return type
- abstract async has_power_levels_cached(room_id)
- Parameters
room_id (mautrix.types.RoomID) –
- Return type
- invited(room_id, user_id)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
- Return type
Awaitable[None]
- abstract async is_encrypted(room_id)
- Parameters
room_id (mautrix.types.RoomID) –
- Return type
- async is_joined(room_id, user_id)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
- Return type
- joined(room_id, user_id)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
- Return type
Awaitable[None]
- left(room_id, user_id)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
- Return type
Awaitable[None]
- abstract async set_encryption_info(room_id, content)
- Parameters
room_id (mautrix.types.RoomID) –
content (mautrix.types.RoomEncryptionStateEventContent | dict[str, any]) –
- Return type
- abstract async set_member(room_id, user_id, member)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
member (mautrix.types.Member | mautrix.types.MemberStateEventContent) –
- Return type
- abstract async set_members(room_id, members, only_membership=None)
- Parameters
room_id (mautrix.types.RoomID) –
members (dict[mautrix.types.UserID, mautrix.types.Member | mautrix.types.MemberStateEventContent]) –
only_membership (Optional[mautrix.types.Membership]) –
- Return type
- abstract async set_membership(room_id, user_id, membership)
- Parameters
room_id (mautrix.types.RoomID) –
user_id (mautrix.types.UserID) –
membership (mautrix.types.Membership) –
- Return type
- abstract async set_power_levels(room_id, content)
- Parameters
room_id (mautrix.types.RoomID) –
content (mautrix.types.PowerLevelStateEventContent) –
- Return type
- async update_state(evt)
- Parameters
evt (mautrix.types.StateEvent) –
- Return type