Skip to content

Commit

Permalink
Pyrofork: Add message_effect_id and allow_paid_broadcast copy_media_g…
Browse files Browse the repository at this point in the history
…roup method
  • Loading branch information
yasirarism committed Jan 29, 2025
1 parent 8f9797f commit 3e504ed
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions pyrogram/methods/messages/copy_media_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async def copy_media_group(
has_spoilers: Union[List[bool], bool] = None,
disable_notification: bool = None,
message_thread_id: int = None,
send_as: Union[int, str] = None,
reply_to_message_id: int = None,
reply_to_chat_id: Union[int, str] = None,
reply_to_story_id: int = None,
Expand All @@ -44,6 +45,8 @@ async def copy_media_group(
schedule_date: datetime = None,
invert_media: bool = None,
protect_content: bool = None,
allow_paid_broadcast: bool = None,
message_effect_id: int = None,
) -> List["types.Message"]:
"""Copy a media group by providing one of the message ids.
Expand Down Expand Up @@ -73,6 +76,9 @@ async def copy_media_group(
If a ``string`` is passed, it becomes a caption only for the first media.
If a list of ``string`` passed, each element becomes caption for each media element.
You can pass ``None`` in list to keep the original caption (see examples below).
has_spoilers (``bool``, *optional*):
Pass True if the photo needs to be covered with a spoiler animation.
disable_notification (``bool``, *optional*):
Sends the message silently.
Expand All @@ -82,6 +88,10 @@ async def copy_media_group(
Unique identifier for the target message thread (topic) of the forum.
For supergroups only.
send_as (``int`` | ``str``):
Unique identifier (int) or username (str) of the chat or channel to send the message as.
You can use this to send the message on behalf of a chat or channel where you have appropriate permissions.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
Expand Down Expand Up @@ -113,6 +123,12 @@ async def copy_media_group(
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats only.
Returns:
List of :obj:`~pyrogram.types.Message`: On success, a list of copied messages is returned.
Expand Down Expand Up @@ -186,9 +202,12 @@ async def copy_media_group(
multi_media=multi_media,
silent=disable_notification or None,
reply_to=reply_to,
send_as=await self.resolve_peer(send_as) if send_as else None,
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
invert_media=invert_media
invert_media=invert_media,
allow_paid_floodskip=allow_paid_broadcast,
effect=message_effect_id,
),
sleep_threshold=60
)
Expand All @@ -205,4 +224,4 @@ async def copy_media_group(
users=r.users,
chats=r.chats
)
)
)

0 comments on commit 3e504ed

Please sign in to comment.