diff --git a/aiogram/types/message.py b/aiogram/types/message.py index f867a44a..9d2ad505 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -245,8 +245,8 @@ class Message(base.TelegramObject): :return: str """ - if self.chat.type == ChatType.PRIVATE: - raise TypeError('Invalid chat type + if ChatType.is_private(self.chat): + raise TypeError("Invalid chat type!") url = "https://t.me/" if self.chat.username: # Generates public link