raito.plugins.conversations.waiter module

class raito.plugins.conversations.waiter.Waiter(text, number, message, retry)[исходный код]

Базовые классы: object

Container for conversation result.

Параметры:
  • text (str) – Raw text of the message

  • number (int | None) – Parsed integer if text is a digit, otherwise None

  • message (Message) – Original aiogram.types.Message object

  • retry (Callable[[], Coroutine[Any, Any, Waiter]]) – Callable coroutine for repeating the same wait

text: str
number: int | None
message: Message
retry: Callable[[], Coroutine[Any, Any, Waiter]]
async raito.plugins.conversations.waiter.wait_for(raito, context, *filters)[исходный код]

Wait for the next message from user that matches given filters.

This function sets special state raito__conversation in FSM and suspends coroutine execution until user sends a message that passes all provided filters. Result is wrapped into Waiter.

Параметры:
  • raito (Raito) – Current Raito instance

  • context (FSMContext) – FSM context for current chat

  • filters (CallbackType) – Sequence of aiogram filters

Результат:

Conversation result with text, parsed number and original message

Исключение:
Тип результата:

Waiter