INNER CODE UNIT · Python
register_startup_hook
PleasePrompto/ductor · ductor_bot/messenger/telegram/app.py:286
def register_startup_hook(self, hook: Callable[[], Awaitable[None]]) -> None:
"""Register a callback to run after bot startup (used by supervisor)."""
self._dp.startup.register(hook)
@property
def sequential(self) -> SequentialMiddleware:
"""Public read-only access to the sequential middleware."""
return self._sequential
@property
def lock_pool(self) -> LockPool:
"""Shared lock pool (used by middleware, bus, and API server)."""
return self._lock_pool
def _is_addressed(self, message: Message) -> bool:
"""True if the message is addressed to this bot instance."""
if message.chat.type not in ("group", "supergroup"):
return True