Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pyrogram/client/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ class Message(Object, Update):
Messages sent from yourself to other chats are outgoing (*outgoing* is True).
An exception is made for your own personal chat; messages sent there will be incoming.

link (``str``):
A link to the message, only for groups and channels.

matches (List of regex Matches, *optional*):
A list containing all `Match Objects <https://docs.python.org/3/library/re.html#match-objects>`_ that match
the text of this message. Only applicable when using :obj:`Filters.regex <pyrogram.Filters.regex>`.
Expand Down Expand Up @@ -670,6 +673,13 @@ def _parse(client, message: types.Message or types.MessageService or types.Messa

return parsed_message

@property
def link(self) -> str:
if self.chat.type in ("group", "supergroup", "channel") and self.chat.username:
return "https://t.me/{}/{}".format(self.chat.username, self.message_id)
else:
return "https://t.me/c/{}/{}".format(utils.get_channel_id(self.chat.id), self.message_id)

def reply_text(
self,
text: str,
Expand Down