Skip to content

shipany.bot.contrib.aiogram.persistency

shipany.bot.contrib.aiogram.persistency package

Submodules

shipany.bot.contrib.aiogram.persistency.bindings module

shipany.bot.contrib.aiogram.persistency.bindings.default_bindings(binder)

Bind the default dependencies.

  • Parameters: binder (Binder) — The dependency injector binder.
  • Return type: None

shipany.bot.contrib.aiogram.persistency.handles module

class shipany.bot.contrib.aiogram.persistency.handles.EventInspector

Bases: object

Inspect the event to extract user and chat ids.

  • Parameters: event (TelegramObject) — The event to inspect.

__init__(event)

  • Parameters:
    • self (Self)
    • event (TelegramObject)
  • Return type: None

user_id()

Extract the user id from the event.

  • Returns: The user id.
  • Return type: str
  • Parameters: self (Self)

chat_id()

Extract the chat id from the event.

  • Returns: The chat id.
  • Return type: str
  • Parameters: self (Self)

class shipany.bot.contrib.aiogram.persistency.handles.AiogramHandleGenerator

Bases: HandleGenerator

Generate the handle for the aiogram event.

  • Parameters: event (Any) — The event to generate the handle for.

__init__(event)

  • Parameters:
    • self (Self)
    • event (Any)
  • Return type: None

generate(key, scope)

Generate the handle for the given key and scope.

  • Parameters:
    • key (str) — The key to generate the handle for.
    • scope (list[Scope]) — The scope to generate the handle for.
    • self (Self)
  • Returns: The generated handle.
  • Return type: str

class shipany.bot.contrib.aiogram.persistency.handles.HandleGeneratorFactory

Bases: object

Factory to create handle generators for aiogram events.

create(event)

Create a handle generator for the given event.

  • Parameters:
    • event (Any) — The event to create the handle generator for.
    • self (Self)
  • Returns: The handle generator.
  • Return type: HandleGenerator

Module contents