Add new FSM strategy CHAT_TOPIC to strategy.py #1343
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new FSM strategy, which sets the state for the entire topic in the chat, also works in private messages and regular groups without topics.
Description
Aiogram did not have an FSM strategy that would set state only for a specific topic in the chat. This strategy is quite reasonable and it has many applications.
The work of state in private messages remains unchanged
The work of state in groups / super groups without topics, state will be established for all groups
The work of state in groups /super groups with topics, State will be established only for one topic, other topics will not have a state until it is installed, state can be set separately for each topic, and state_data will be separate in all topics where state is installed.
Fixes # (issue)
Type of change
How Has This Been Tested?
Run tests/test_fsm/test_strategy.py
You can run bot with FSMStrategy.CHAT_TOPIC, and make sure that the strategy is working correctly:
Test Configuration:
Checklist: