diff --git a/aiogram/dispatcher/filters/builtin.py b/aiogram/dispatcher/filters/builtin.py index fcaaf786..20317f57 100644 --- a/aiogram/dispatcher/filters/builtin.py +++ b/aiogram/dispatcher/filters/builtin.py @@ -673,7 +673,7 @@ class AdminFilter(Filter): message = obj.message else: return False - if ChatType.is_private(message): # there is no admin in private chats + if message.chat.type == ChatType.PRIVATE: # there is no admin in private chats return False chat_ids = [message.chat.id] else: diff --git a/aiogram/types/message.py b/aiogram/types/message.py index fedd656e..52c2b3a8 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -236,9 +236,8 @@ class Message(base.TelegramObject): :return: str """ - if ChatType.is_private(self.chat): - raise TypeError("Invalid chat type!") - + if self.chat.type == ChatType.PRIVATE: + raise TypeError('Invalid chat type url = "https://t.me/" if self.chat.username: # Generates public link