Skip to content
lores1337 edited this page Aug 2, 2024 · 2 revisions

The Broadcaster class is a core component of the library. It manages multiple mailers, providing functionality to create and control mailers.

Initialization

from aiogram_broadcaster import Broadcaster

broadcaster = Broadcaster(bot1, bot2, bot3, storage=..., additional_context="some_value")
broadcaster.setup(dispatcher)  # Setup the context, and startup, shutdown events

Attributes

  • bots (Tuple[bot, ...]): List of bots used to restore mailers.

  • storage (Optional[BaseStorage]): Storage of mailers.

  • context (Dict[str, Any]): Context for Dependency injection, used in events, placeholders, intervals and some contents.

  • event (Event): Root event instance for bind other events.

  • placeholder (Placeholder): Root placeholder instance for bind other placeholders.

  • mailers (Dict[int, Mailer]): Mapping of the all mailers.

Methods

  • get_mailers(magic: Optional[MagicFilter] = None) -> MailerGroup: