Skip to content

Commit

Permalink
Add message.content property
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Jan 29, 2025
1 parent 1fd0d5a commit 0aa963f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyrogram/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ class Message(Object, Update):
link (``str``, *property*):
Generate a link to this message, only for groups and channels.
content (``str``, *property*):
The text or caption content of the message.
"""

# TODO: Add game missing field
Expand Down Expand Up @@ -1397,6 +1400,10 @@ def link(self) -> str:
else:
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}/{self.id}"

@property
def content(self) -> str:
return self.text or self.caption or ""

async def get_media_group(self) -> List["types.Message"]:
"""Bound method *get_media_group* of :obj:`~pyrogram.types.Message`.
Expand Down

0 comments on commit 0aa963f

Please sign in to comment.