Add type ignores for specific attributes and replace tuple with set for chat type check

This commit is contained in:
JRoot Junior 2026-01-04 04:28:10 +02:00
parent 27561361fc
commit 54039e3db9
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
2 changed files with 3 additions and 3 deletions

View file

@ -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:

View file

@ -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 = (