mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
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:
parent
415beb21f2
commit
6a22e2e262
@ -706,6 +706,33 @@ class Message(Object, Update):
|
|||||||
else:
|
else:
|
||||||
return f"https://t.me/c/{utils.get_channel_id(self.chat.id)}/{self.message_id}"
|
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(
|
async def reply_text(
|
||||||
self,
|
self,
|
||||||
text: str,
|
text: str,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user