mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Return None instead of raising TypeError, removed redundant f-string
This commit is contained in:
parent
cb424bacab
commit
82fa950676
1 changed files with 2 additions and 2 deletions
|
|
@ -1724,12 +1724,12 @@ class Message(TelegramObject):
|
|||
:return: string with full message URL
|
||||
"""
|
||||
if self.chat.type in ("private", "group"):
|
||||
raise TypeError("Invalid chat type!")
|
||||
return None
|
||||
|
||||
if not self.chat.username or force_private:
|
||||
chat_value = f"c/{self.chat.shifted_id}"
|
||||
else:
|
||||
chat_value = f"{self.chat.username}"
|
||||
chat_value = self.chat.username
|
||||
|
||||
return f"https://t.me/{chat_value}/{self.message_id}"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue