Skip to content

Commit

Permalink
Add show_caption_above_media parameter to send_animation method
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Dec 23, 2024
1 parent b1f555f commit 45ee556
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyrogram/methods/messages/send_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async def send_animation(
disable_notification: bool = None,
message_thread_id: int = None,
effect_id: int = None,
show_caption_above_media: bool = None,
reply_to_message_id: int = None,
reply_to_chat_id: Union[int, str] = None,
reply_to_story_id: int = None,
Expand Down Expand Up @@ -132,6 +133,9 @@ async def send_animation(
Unique identifier of the message effect.
For private chats only.
show_caption_above_media (``bool``, *optional*):
Pass True, if the caption must be shown above the message media.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
Expand Down Expand Up @@ -274,6 +278,7 @@ async def progress(current, total):
peer=peer,
media=media,
silent=disable_notification or None,
invert_media=show_caption_above_media,
reply_to=utils.get_reply_to(
reply_to_message_id=reply_to_message_id,
message_thread_id=message_thread_id,
Expand Down
6 changes: 6 additions & 0 deletions pyrogram/methods/messages/send_cached_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ async def send_cached_media(
schedule_date: datetime = None,
protect_content: bool = None,
has_spoiler: bool = None,
effect_id: int = None,
show_caption_above_media: bool = None,
business_connection_id: str = None,
allow_paid_broadcast: bool = None,
Expand Down Expand Up @@ -113,6 +114,10 @@ async def send_cached_media(
has_spoiler (``bool``, *optional*):
True, if the message media is covered by a spoiler animation.
effect_id (``int``, *optional*):
Unique identifier of the message effect.
For private chats only.
show_caption_above_media (``bool``, *optional*):
Pass True, if the caption must be shown above the message media.
Expand Down Expand Up @@ -160,6 +165,7 @@ async def send_cached_media(
noforwards=protect_content,
allow_paid_floodskip=allow_paid_broadcast,
reply_markup=await reply_markup.write(self) if reply_markup else None,
effect=effect_id,
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
),
business_connection_id=business_connection_id
Expand Down

0 comments on commit 45ee556

Please sign in to comment.