mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fixed usage of deprecated is_private function (#421)
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
This commit is contained in:
parent
a936465f42
commit
51547f9745
2 changed files with 3 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue