Skip to content

Commit

Permalink
Add support for message.link in discussion reply messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Apr 20, 2024
1 parent 2267f4c commit eb8f32c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions pyrogram/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,24 +250,12 @@ class Message(Object, Update):
Note that the Message object in this field will not contain further reply_to_message fields even if it
is itself a reply.
invoice
successful_payment
users_shared (:obj:`~pyrogram.types.UsersShared`, *optional*):
Service message: users were shared with the bot
chat_shared (:obj:`~pyrogram.types.ChatShared`, *optional*):
Service message: a chat was shared with the bot
connected_website
write_access_allowed
passport_data
proximity_alert_triggered
boost_added (:obj:`~pyrogram.types.ChatBoostAdded`, *optional*):
Service message: user boosted the chat
Expand Down Expand Up @@ -1262,7 +1250,7 @@ def link(self) -> str:
enums.ChatType.CHANNEL
)
):
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}/{self.id}"
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}{f'/{self.message_thread_id}' if self.message_thread_id else ''}/{self.id}"
raise ValueError("This message-chat type does not have a link")

async def get_media_group(self) -> List["types.Message"]:
Expand Down

0 comments on commit eb8f32c

Please sign in to comment.