mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add type ignores for specific attributes and replace tuple with set for chat type check
This commit is contained in:
parent
27561361fc
commit
54039e3db9
2 changed files with 3 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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 = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue