diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index 315c6b73..54fd9b9f 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -416,7 +416,8 @@ def pyrogram_api(): title = "{}".format(type) f2.write(title + "\n" + "=" * len(title) + "\n\n") - f2.write(".. autoclass:: pyrogram.types.{}()".format(type)) + f2.write(".. autoclass:: pyrogram.types.{}()\n".format(type)) + f2.write(" :members:\n") f.write(template.format(**fmt_keys)) diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index 51bb4293..9950df4a 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -245,9 +245,6 @@ 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 `_ that match the text of this message. Only applicable when using :obj:`Filters.regex `. @@ -675,6 +672,7 @@ class Message(Object, Update): @property def link(self) -> str: + """Generate a link to this message, only for groups and channels.""" if self.chat.type in ("group", "supergroup", "channel") and self.chat.username: return f"https://t.me/{self.chat.username}/{self.message_id}" else: diff --git a/pyrogram/types/user_and_chats/user.py b/pyrogram/types/user_and_chats/user.py index e9a95182..7174a3d4 100644 --- a/pyrogram/types/user_and_chats/user.py +++ b/pyrogram/types/user_and_chats/user.py @@ -192,6 +192,11 @@ class User(Object, Update): @property def mention(self): + """Generate a text mention for this user. + + You can use ``user.mention()`` to mention the user using their first name (styled using html), or + ``user.mention("another name")`` for a custom name. To choose a different style + ("html" or "md"/"markdown") use ``user.mention(style="md")``.""" return Link(f"tg://user?id={self.id}", self.first_name, self._client.parse_mode) @staticmethod