maks00x2022-02-08 16:17:50
maks00x, 2022-02-08 16:17:50

Aiogram. How to make FSM for a group?

Hello! I am writing a bot that will do interactive for the group. The problem is that when a user writes something that should switch the State, the bot changes the State only for that user, while the State remains unchanged for the rest of the chat members. It turns out that the bot interacts with each user individually, just "in front of" the whole group. Is there a way to make FSM for the whole group, or is it worth looking for a new technology?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
husee, 2022-02-08

from aiogram.contrib.fsm_storage.memory import MemoryStorage
storage = MemoryStorage()
await storage.set_state(chat=chat_id,
user = user_id ,

Jan, 2022-02-17

The first thought is to move the current state into a global variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question