mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-27 16:45:19 +00:00
Document undocumented properties
This commit is contained in:
parent
15f504a91f
commit
c5dd474f93
@ -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))
|
||||
|
||||
|
@ -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 <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>`.
|
||||
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user