Per-user Finite State Machine backed by Pockets (ETS).
Stores {state, data} per chat and provides defstate/2 for state-specific
handlers. See Finite State Machines for workflow examples.
Summary
Functions
Defines handlers that only execute when the user is in a specific FSM state.
Retrieves the current FSM state and data for a user.
Initializes the FSM storage for a bot.
Resets the FSM state for a user, removing their stored state and data.
Sets the FSM state for a user, keeping existing data.
Sets the FSM state and data for a user.
Types
@type chat_id() :: TelegramEx.Types.chat_id()
Functions
Defines handlers that only execute when the user is in a specific FSM state.
See Finite State Machines for a complete multi-step example.
Retrieves the current FSM state and data for a user.
Returns {nil, nil} when the chat has no stored state.
Initializes the FSM storage for a bot.
This is called automatically by TelegramEx.Server when the bot starts.
Resets the FSM state for a user, removing their stored state and data.
Sets the FSM state for a user, keeping existing data.
Sets the FSM state and data for a user.