DefaultBehaviourContextWithFSM
Default realization of BehaviourContextWithFSM. It uses behaviourContext as a base for this object as BehaviourContext, but managing substates contexts updates for avoiding of updates lost between states
Parameters
Will be used in case if state handling has not been successfully completed in launchStateHandling
Constructors
Properties
Will be called BEFORE handling of State will be started
Functions
Add NON STRICT handler to list of available in future BehaviourContextWithFSM. Non strict means that for input State will be used KClass.isInstance and any inheritor of kClass will pass this requirement
Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and FlowsUpdatesFilter.allUpdatesFlow of flowUpdatesFilter as DefaultBehaviourContext.upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets. Use this method in case you wish to make some additional actions with flowUpdatesFilter.
Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets.
Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope
Extracting from BehaviourContext.data exists StatesMachine by key DATA_FSM_KEY, which usually some BehaviourContextWithFSM. In case if value absent in BehaviourContext.data will return null
Extracting from BehaviourContext.data exists StatesMachine by key DATA_FSM_KEY, which usually some BehaviourContextWithFSM. In case if value absent in BehaviourContext.data will throw NullPointerException
Add NON STRICT handler to list of available in future BehaviourContextWithFSM. Non strict means that for input State will be used KClass.isInstance and any inheritor of kClass will pass this requirement
Add NON STRICT handler to list of available in future BehaviourContextWithFSM. Non strict means that for input State will be used KClass.isInstance and any inheritor of kClass will pass this requirement
Add STRICT handler to list of available in future BehaviourContextWithFSM. Strict means that for input State will be used State::class == kClass and any State with exactly the same type will pass requirements
Add STRICT handler to list of available in future BehaviourContextWithFSM. Strict means that for input State will be used State::class == kClass and any State with exactly the same type will pass requirements