mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added FSMStrategy to the documentation
This commit is contained in:
parent
60f93b3b46
commit
2215df7a0f
4 changed files with 20 additions and 1 deletions
|
|
@ -3,11 +3,20 @@ from typing import Optional, Tuple
|
|||
|
||||
|
||||
class FSMStrategy(Enum):
|
||||
"""
|
||||
FSM strategy for storage key generation.
|
||||
"""
|
||||
|
||||
USER_IN_CHAT = auto()
|
||||
"""State will be stored for each user in chat."""
|
||||
CHAT = auto()
|
||||
"""State will be stored for each chat globally without separating by users."""
|
||||
GLOBAL_USER = auto()
|
||||
"""State will be stored globally for each user globally."""
|
||||
USER_IN_TOPIC = auto()
|
||||
"""State will be stored for each user in chat and topic."""
|
||||
CHAT_TOPIC = auto()
|
||||
"""State will be stored for each chat and topic, but not separated by users."""
|
||||
|
||||
|
||||
def apply_strategy(
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ Read more
|
|||
.. toctree::
|
||||
|
||||
storages
|
||||
strategy
|
||||
scene
|
||||
|
||||
|
||||
|
|
|
|||
9
docs/dispatcher/finite_state_machine/strategy.rst
Normal file
9
docs/dispatcher/finite_state_machine/strategy.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
========
|
||||
Strategy
|
||||
========
|
||||
|
||||
This module provides the `FSMStrategy` enumeration which is used to define the strategy of the finite state machine.
|
||||
|
||||
|
||||
.. autoclass:: aiogram.fsm.strategy.FSMStrategy
|
||||
:members:
|
||||
|
|
@ -29,9 +29,9 @@ So, you can use both of them with *aiogram*.
|
|||
dependency_injection
|
||||
filters/index
|
||||
long_polling
|
||||
webhook
|
||||
finite_state_machine/index
|
||||
middlewares
|
||||
errors
|
||||
flags
|
||||
webhook
|
||||
class_based_handlers/index
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue