Add bound method get_media_group() (#593)

* Bound method - get_media_group()

* Update message.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
This commit is contained in:
Legenda24 2021-02-27 22:53:18 +05:00 committed by GitHub
parent 415beb21f2
commit 6a22e2e262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -706,6 +706,33 @@ class Message(Object, Update):
else:
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}/{self.message_id}"
async def get_media_group(self) -> List["types.Message"]:
"""Bound method *get_media_group* of :obj:`~pyrogram.types.Message`.
Use as a shortcut for:
.. code-block:: python
client.get_media_group(
chat_id=message.chat.id,
message_id=message.message_id
)
Example:
.. code-block:: python
message.get_media_group()
Returns:
List of :obj:`~pyrogram.types.Message`: On success, a list of messages of the media group is returned.
Raises:
ValueError: In case the passed message id doesn't belong to a media group.
"""
return await self._client.get_media_group(
chat_id=self.chat.id,
message_id=self.message_id
)
async def reply_text(
self,
text: str,