Skip to content

Commit 851b174

Browse files
committed
Add new_video_start_timestamp in forward_messages and the bound method.
Renamed some of the parameters in forward_messages and the bound method.
1 parent 3f82c5d commit 851b174

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

docs/source/releases/changes-in-this-fork.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Changes in this Fork
2626
| Scheme layer used: 198 |
2727
+------------------------+
2828

29+
- Added the ``new_video_start_timestamp`` and renamed the ``send_copy`` and ``remove_caption`` parameters in :meth:`~pyrogram.Client.forward_messages` and :meth:`~pyrogram.types.Message.forward`.
2930
- Added the ``gift_count`` to the :obj:`~pyrogram.types.Chat`.
3031
- Added the :meth:`~pyrogram.Client.get_similar_bots`.
3132
- Changed types in :obj:`~pyrogram.types.UpgradedGift`, :obj:`~pyrogram.types.UserGift`.
@@ -395,7 +396,7 @@ Changes in this Fork
395396
- Replaced the parameter ``disable_web_page_preview`` with :obj:`~pyrogram.types.LinkPreviewOptions` in the methods :meth:`~pyrogram.Client.send_message` and :meth:`~pyrogram.Client.edit_message_text`.
396397
- Replaced the field ``disable_web_page_preview`` with :obj:`~pyrogram.types.LinkPreviewOptions` in the class :obj:`~pyrogram.types.InputTextMessageContent`.
397398
- Added missing parameters to :meth:`~pyrogram.Client.forward_messages`.
398-
- Added the class :obj:`~pyrogram.types.ReplyParameters` and replaced parameters ``reply_to_message_id`` in the methods :meth:`~pyrogram.Client.copy_message`, :meth:`~pyrogram.Client.forward_messages`, :meth:`~pyrogram.Client.send_message`, :meth:`~pyrogram.Client.send_photo`, :meth:`~pyrogram.Client.send_video`, :meth:`~pyrogram.Client.send_animation`, :meth:`~pyrogram.Client.send_audio`, :meth:`~pyrogram.Client.send_document`, :meth:`~pyrogram.Client.send_sticker`, :meth:`~pyrogram.Client.send_video_note`, :meth:`~pyrogram.Client.send_voice`, :meth:`~pyrogram.Client.send_location`, :meth:`~pyrogram.Client.send_venue`, :meth:`~pyrogram.Client.send_contact`, :meth:`~pyrogram.Client.send_poll`, :meth:`~pyrogram.Client.send_dice`, :meth:`~pyrogram.Client.send_game`, :meth:`~pyrogram.Client.send_media_group`, :meth:`~pyrogram.Client.copy_media_group`, :meth:`~pyrogram.Client.send_inline_bot_result`, :meth:`~pyrogram.Client.send_cached_media`, and the corresponding reply_* methods with the field ``reply_parameters`` of type :obj:`~pyrogram.types.ReplyParameters`.
399+
- Added the class :obj:`~pyrogram.types.ReplyParameters` and replaced parameters ``reply_to_message_id`` in the methods :meth:`~pyrogram.Client.copy_message`, :meth:`~pyrogram.Client.send_message`, :meth:`~pyrogram.Client.send_photo`, :meth:`~pyrogram.Client.send_video`, :meth:`~pyrogram.Client.send_animation`, :meth:`~pyrogram.Client.send_audio`, :meth:`~pyrogram.Client.send_document`, :meth:`~pyrogram.Client.send_sticker`, :meth:`~pyrogram.Client.send_video_note`, :meth:`~pyrogram.Client.send_voice`, :meth:`~pyrogram.Client.send_location`, :meth:`~pyrogram.Client.send_venue`, :meth:`~pyrogram.Client.send_contact`, :meth:`~pyrogram.Client.send_poll`, :meth:`~pyrogram.Client.send_dice`, :meth:`~pyrogram.Client.send_game`, :meth:`~pyrogram.Client.send_media_group`, :meth:`~pyrogram.Client.copy_media_group`, :meth:`~pyrogram.Client.send_inline_bot_result`, :meth:`~pyrogram.Client.send_cached_media`, and the corresponding reply_* methods with the field ``reply_parameters`` of type :obj:`~pyrogram.types.ReplyParameters`.
399400
- Bug fixes for sending ``ttl_seconds`` and ``has_spoiler``.
400401

401402
+------------------------+

pyrogram/methods/messages/forward_messages.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ async def forward_messages(
3434
disable_notification: bool = None,
3535
protect_content: bool = None,
3636
allow_paid_broadcast: bool = None,
37-
drop_author: bool = None,
38-
drop_media_captions: bool = None,
37+
send_copy: bool = None,
38+
remove_caption: bool = None,
39+
new_video_start_timestamp: int = None,
3940
send_as: Union[int, str] = None,
4041
schedule_date: datetime = None
4142
) -> Union["types.Message", list["types.Message"]]:
@@ -70,11 +71,14 @@ async def forward_messages(
7071
allow_paid_broadcast (``bool``, *optional*):
7172
Pass True to allow the message to ignore regular broadcast limits for a fee; for bots only
7273
73-
drop_author (``bool``, *optional*):
74-
Whether to forward messages without quoting the original author.
74+
send_copy (``bool``, *optional*):
75+
Pass True to copy content of the messages without reference to the original sender.
7576
76-
drop_media_captions (``bool``, *optional*):
77-
Whether to strip captions from media.
77+
remove_caption (``bool``, *optional*):
78+
Pass True to remove media captions of message copies.
79+
80+
new_video_start_timestamp (``int``, *optional*):
81+
The new video start timestamp. Pass time to replace video start timestamp in the forwarded message.
7882
7983
send_as (``int`` | ``str``):
8084
Unique identifier (int) or username (str) of the chat or channel to send the message as.
@@ -110,16 +114,15 @@ async def forward_messages(
110114
id=message_ids,
111115
silent=disable_notification or None,
112116
# TODO
113-
# TODO
114-
drop_author=drop_author,
115-
drop_media_captions=drop_media_captions,
117+
video_timestamp=new_video_start_timestamp,
118+
drop_author=send_copy,
119+
drop_media_captions=remove_caption,
116120
noforwards=protect_content,
117121
allow_paid_floodskip=allow_paid_broadcast,
118122
random_id=[self.rnd_id() for _ in message_ids],
119123
send_as=await self.resolve_peer(send_as) if send_as else None,
120124
schedule_date=utils.datetime_to_timestamp(schedule_date),
121125
top_msg_id=message_thread_id
122-
# TODO
123126
)
124127
)
125128

pyrogram/types/messages_and_media/message.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4571,8 +4571,9 @@ async def forward(
45714571
disable_notification: bool = None,
45724572
protect_content: bool = None,
45734573
allow_paid_broadcast: bool = None,
4574-
drop_author: bool = None,
4575-
drop_media_captions: bool = None,
4574+
send_copy: bool = None,
4575+
remove_caption: bool = None,
4576+
new_video_start_timestamp: int = None,
45764577
send_as: Union[int, str] = None,
45774578
schedule_date: datetime = None
45784579
) -> Union["types.Message", list["types.Message"]]:
@@ -4612,11 +4613,14 @@ async def forward(
46124613
allow_paid_broadcast (``bool``, *optional*):
46134614
Pass True to allow the message to ignore regular broadcast limits for a fee; for bots only
46144615
4615-
drop_author (``bool``, *optional*):
4616-
Whether to forward messages without quoting the original author.
4616+
send_copy (``bool``, *optional*):
4617+
Pass True to copy content of the messages without reference to the original sender.
46174618
4618-
drop_media_captions (``bool``, *optional*):
4619-
Whether to strip captions from media.
4619+
remove_caption (``bool``, *optional*):
4620+
Pass True to remove media captions of message copies.
4621+
4622+
new_video_start_timestamp (``int``, *optional*):
4623+
The new video start timestamp. Pass time to replace video start timestamp in the forwarded message.
46204624
46214625
send_as (``int`` | ``str``):
46224626
Unique identifier (int) or username (str) of the chat or channel to send the message as.
@@ -4642,8 +4646,9 @@ async def forward(
46424646
disable_notification=disable_notification,
46434647
protect_content=protect_content,
46444648
allow_paid_broadcast=allow_paid_broadcast,
4645-
drop_author=drop_author,
4646-
drop_media_captions=drop_media_captions,
4649+
send_copy=send_copy,
4650+
remove_caption=remove_caption,
4651+
new_video_start_timestamp=new_video_start_timestamp,
46474652
send_as=send_as,
46484653
schedule_date=schedule_date
46494654
)

0 commit comments

Comments
 (0)