An ExGram.Router.Filter that matches on the current active FSM flow name.
This filter is automatically registered as the :fsm_flow alias when
use ExGram.FSM detects that use ExGram.Router has also been called on
the same module.
Usage
Combine with :fsm_state to scope routes to a specific flow and step:
scope do
filter :fsm_flow, :registration
filter :fsm_state, :get_name
filter :text
handle &MyBot.Handlers.got_name/1
end
scope do
filter :fsm_flow, :settings
filter :fsm_state, :choose_language
filter :text
handle &MyBot.Handlers.set_language/1
endMatch on "no active flow":
scope do
filter :fsm_flow, nil
filter :command, :start
handle &MyBot.Handlers.start/1
endOptions
nil— matches when there is no active flow (flow == nil)atom— matches whencontext.extra.fsm.flow == atom
Summary
Functions
Filter callback.
Functions
@spec call(term(), ExGram.Cnt.t(), atom() | nil) :: boolean()
Filter callback.
Returns true when the current FSM flow name equals expected_flow.