Skip to content

basic_bot.commons.hub_state

HubState Objects

class HubState()

This class manages the local state of the hub. It is initialized with a default initial state and can be updated with new state data.

__init__

def __init__(default_state: Dict[str, Any] = {}) -> None

Initializes the hub state with the default state.

get

def get(keys_requested: List[str]) -> Dict[str, Any]

Return the requested state data for a list of state keys.

update_state_from_message_data

def update_state_from_message_data(message_data: Dict[str, Any]) -> None

Update state from received message data.

serialize_state

def serialize_state(keys_requested: Optional[List[str]] = None) -> str

Serialize the current state to JSON.