File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
pyrogram/types/messages_and_media Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -419,6 +419,12 @@ class Message(Object, Update):
419419 link (``str``, *property*):
420420 Generate a link to this message, only for supergroups and channels. Can be None if the message cannot have a link.
421421
422+ content (``str``, *property*):
423+ The text or caption content of the message.
424+ If the message contains entities (bold, italic, ...) you can access *content.markdown* or
425+ *content.html* to get the marked up content. In case there is no caption entity, the fields
426+ will contain the same text as *content*.
427+
422428 """
423429
424430 # TODO: Add game missing field.
@@ -1462,6 +1468,10 @@ def link(self) -> str:
14621468 return f"https://t.me/{ self .chat .username } { f'/{ self .message_thread_id } ' if self .message_thread_id else '' } /{ self .id } "
14631469 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 } "
14641470
1471+ @property
1472+ def content (self ) -> str :
1473+ return self .text or self .caption or Str ("" ).init ([])
1474+
14651475 async def get_media_group (self ) -> list ["types.Message" ]:
14661476 """Bound method *get_media_group* of :obj:`~pyrogram.types.Message`.
14671477
You can’t perform that action at this time.
0 commit comments