Added FSMStrategy to the documentation

This commit is contained in:
JRoot Junior 2024-08-14 02:09:31 +03:00
parent 60f93b3b46
commit 2215df7a0f
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
4 changed files with 20 additions and 1 deletions

View file

@ -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(

View file

@ -95,6 +95,7 @@ Read more
.. toctree::
storages
strategy
scene

View 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:

View file

@ -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