diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index 0ac26f23..6f8b7e4b 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -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,