From 32d58193f35bc9498d8ad05826e1167acd7f4c0c Mon Sep 17 00:00:00 2001 From: h Date: Wed, 14 Oct 2026 05:25:45 +0200 Subject: [PATCH] fix(backend): raw update reaches every handler that declares it, contact list follows user updates --- backend/src/userbot/handlers/raw/dispatcher.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/userbot/handlers/raw/dispatcher.py b/backend/src/userbot/handlers/raw/dispatcher.py index 32e0bde..8f16c47 100644 --- a/backend/src/userbot/handlers/raw/dispatcher.py +++ b/backend/src/userbot/handlers/raw/dispatcher.py @@ -24,8 +24,9 @@ _MODULES = ( read_receipts, transcribed, ) -_REGISTRY: dict[type, RawHandler] = { - update_type: module.handle for module in _MODULES for update_type in module.HANDLES +_REGISTRY: dict[type, list[RawHandler]] = { + update_type: [module.handle for module in _MODULES if update_type in module.HANDLES] + for update_type in {kind for module in _MODULES for kind in module.HANDLES} } @@ -33,8 +34,7 @@ _REGISTRY: dict[type, RawHandler] = { async def dispatch( client: PyroClient, update: raw.base.Update, users: dict, chats: dict ) -> None: - handler = _REGISTRY.get(type(update)) - if handler is not None: + for handler in _REGISTRY.get(type(update), ()): await handler(client, update, users, chats)