Skip to content

Commit dbe10f5

Browse files
authored
Fix set_chat_photo parameters
Follow-Up: 27e313f
1 parent b14b7b6 commit dbe10f5

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pyrogram/methods/chats/set_chat_photo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def set_chat_photo(
3333
*,
3434
photo: Union[str, "io.BytesIO"] = None,
3535
video: Union[str, "io.BytesIO"] = None,
36-
video_start_ts: float = None,
36+
photo_frame_start_timestamp: float = None,
3737
) -> Union["types.Message", bool]:
3838
"""Set a new chat photo or video (H.264/MPEG-4 AVC video, max 5 seconds).
3939
@@ -58,8 +58,8 @@ async def set_chat_photo(
5858
from your local machine or a binary file-like object with its attribute
5959
".name" set for in-memory uploads.
6060
61-
video_start_ts (``float``, *optional*):
62-
The timestamp in seconds of the video frame to use as photo profile preview.
61+
photo_frame_start_timestamp (``float``, *optional*):
62+
Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if ``video`` is set.
6363
6464
Returns:
6565
:obj:`~pyrogram.types.Message` | ``bool``: On success, a service message will be returned (when applicable),
@@ -91,7 +91,7 @@ async def set_chat_photo(
9191
photo = raw.types.InputChatUploadedPhoto(
9292
file=await self.save_file(photo),
9393
video=await self.save_file(video),
94-
video_start_ts=video_start_ts,
94+
video_start_ts=photo_frame_start_timestamp,
9595
)
9696
else:
9797
photo = utils.get_input_media_from_file_id(photo, FileType.PHOTO)
@@ -100,7 +100,7 @@ async def set_chat_photo(
100100
photo = raw.types.InputChatUploadedPhoto(
101101
file=await self.save_file(photo),
102102
video=await self.save_file(video),
103-
video_start_ts=video_start_ts,
103+
video_start_ts=photo_frame_start_timestamp,
104104
)
105105

106106
if isinstance(peer, raw.types.InputPeerChat):

pyrogram/methods/users/set_profile_photo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
class SetProfilePhoto:
27+
# TODO: FIXME!
2728
async def set_profile_photo(
2829
self: "pyrogram.Client",
2930
*,
@@ -60,7 +61,7 @@ async def set_profile_photo(
6061
The bot should have ``can_be_edited`` property set to True.
6162
6263
photo_frame_start_timestamp (``float``, *optional*):
63-
Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if ``video`` or ``video_emoji_markup`` is set.
64+
Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if ``video`` is set.
6465
6566
Returns:
6667
``bool``: True on success.

pyrogram/types/user_and_chats/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ async def set_photo(
955955
".name" set for in-memory uploads.
956956
957957
photo_frame_start_timestamp (``float``, *optional*):
958-
Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if ``video`` or ``video_emoji_markup`` is set.
958+
Floating point UNIX timestamp in seconds, indicating the frame of the video/sticker that should be used as static preview; can only be used if ``video`` is set.
959959
960960
Returns:
961961
:obj:`~pyrogram.types.Message` | ``bool``: On success, a service message will be returned (when applicable),

0 commit comments

Comments
 (0)