From 54039e3db9efc13467dcbc1b399a70a4f796555d Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sun, 4 Jan 2026 04:28:10 +0200 Subject: [PATCH] Add type ignores for specific attributes and replace tuple with set for chat type check --- aiogram/fsm/scene.py | 4 ++-- aiogram/types/message.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aiogram/fsm/scene.py b/aiogram/fsm/scene.py index c5052008..32502296 100644 --- a/aiogram/fsm/scene.py +++ b/aiogram/fsm/scene.py @@ -120,7 +120,7 @@ class ObserverDecorator: handlers = getattr(target, "__aiogram_handler__", None) if not handlers: handlers = [] - target.__aiogram_handler__ = handlers + target.__aiogram_handler__ = handlers # type: ignore[union-attr] handlers.append( HandlerContainer( @@ -137,7 +137,7 @@ class ObserverDecorator: action = getattr(target, "__aiogram_action__", None) if action is None: action = defaultdict(dict) - target.__aiogram_action__ = action + target.__aiogram_action__ = action # type: ignore[attr-defined] action[self.action][self.name] = CallableObject(target) def __call__(self, target: CallbackType) -> CallbackType: diff --git a/aiogram/types/message.py b/aiogram/types/message.py index fe0476f6..91434ee7 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -4353,7 +4353,7 @@ class Message(MaybeInaccessibleMessage): :param include_thread_id: if set, adds chat thread id to URL and returns like https://t.me/username/thread_id/message_id :return: string with full message URL """ - if self.chat.type in ("private", "group"): + if self.chat.type in {"private", "group"}: return None chat_value = (