Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions telebot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@ def send_photo(

def send_live_photo(
self, chat_id: Union[int, str], live_photo: Union[Any, str], photo: Union[Any, str],
business_connection_id: Optional[str]=None,
message_thread_id: Optional[int]=None, business_connection_id: Optional[str]=None,
caption: Optional[str]=None, parse_mode: Optional[str]=None,
Comment on lines 2651 to 2654
caption_entities: Optional[List[types.MessageEntity]]=None, show_caption_above_media: Optional[bool]=None,
has_spoiler: Optional[bool]=None, disable_notification: Optional[bool]=None, protect_content: Optional[bool]=None,
Expand All @@ -2662,6 +2662,9 @@ def send_live_photo(

Telegram documentation: https://core.telegram.org/bots/api#sendlivephoto

:param message_thread_id: Identifier of a message thread, in which the message will be sent
:type message_thread_id: :obj:`int`

:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:type business_connection_id: :obj:`str`

Expand Down Expand Up @@ -2726,10 +2729,13 @@ def send_live_photo(

return types.Message.de_json(
apihelper.send_live_photo(
self.token, chat_id, live_photo, photo, business_connection_id=business_connection_id, caption=caption, parse_mode=parse_mode,
caption_entities=caption_entities, show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification,
protect_content=protect_content, allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters, reply_parameters=reply_parameters, reply_markup=reply_markup
self.token, chat_id, live_photo, photo, message_thread_id=message_thread_id,
business_connection_id=business_connection_id, caption=caption, parse_mode=parse_mode,
caption_entities=caption_entities, show_caption_above_media=show_caption_above_media,
has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content,
allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters, reply_parameters=reply_parameters,
reply_markup=reply_markup
)
)

Expand Down
8 changes: 5 additions & 3 deletions telebot/apihelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,9 @@ def send_photo(

def send_live_photo(
token, chat_id, live_photo, photo,
caption=None, parse_mode=None, caption_entities=None, show_caption_above_media=None, has_spoiler=None,
disable_notification=None, protect_content=None, reply_parameters=None, reply_markup=None,
business_connection_id=None, message_effect_id=None, allow_paid_broadcast=None,
message_thread_id=None, business_connection_id=None, caption=None, parse_mode=None, caption_entities=None,
show_caption_above_media=None, has_spoiler=None, disable_notification=None, protect_content=None,
reply_parameters=None, reply_markup=None, message_effect_id=None, allow_paid_broadcast=None,
direct_messages_topic_id=None, suggested_post_parameters=None):
Comment on lines 626 to 631
method_url = r'sendLivePhoto'
files = {}
Expand All @@ -642,6 +642,8 @@ def send_live_photo(
files['photo'] = util.pil_image_to_file(photo)
else:
files['photo'] = photo
if message_thread_id is not None:
payload['message_thread_id'] = message_thread_id
Comment on lines +645 to +646
if caption:
payload['caption'] = caption
if parse_mode:
Expand Down
15 changes: 11 additions & 4 deletions telebot/async_telebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4288,7 +4288,7 @@ async def send_photo(

async def send_live_photo(
self, chat_id: Union[int, str], live_photo: Union[Any, str], photo: Union[Any, str],
business_connection_id: Optional[str]=None,
message_thread_id: Optional[int] = None, business_connection_id: Optional[str]=None,
caption: Optional[str]=None, parse_mode: Optional[str]=None,
Comment on lines 4289 to 4292
caption_entities: Optional[List[types.MessageEntity]]=None,
show_caption_above_media: Optional[bool]=None, has_spoiler: Optional[bool]=None,
Expand All @@ -4301,6 +4301,9 @@ async def send_live_photo(

Telegram documentation: https://core.telegram.org/bots/api#sendlivephoto

:param message_thread_id: Identifier of a message thread, in which the message will be sent
:type message_thread_id: :obj:`int`

:param business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
:type business_connection_id: :obj:`str`

Expand Down Expand Up @@ -4367,9 +4370,13 @@ async def send_live_photo(

return types.Message.de_json(
await asyncio_helper.send_live_photo(
self.token, chat_id, live_photo, photo, business_connection_id=business_connection_id, caption=caption, parse_mode=parse_mode, caption_entities=caption_entities,
show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content,
allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, suggested_post_parameters=suggested_post_parameters, reply_parameters=reply_parameters, reply_markup=reply_markup
self.token, chat_id, live_photo, photo, message_thread_id=message_thread_id,
business_connection_id=business_connection_id, caption=caption, parse_mode=parse_mode,
caption_entities=caption_entities, show_caption_above_media=show_caption_above_media,
has_spoiler=has_spoiler, disable_notification=disable_notification, protect_content=protect_content,
allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id,
suggested_post_parameters=suggested_post_parameters, reply_parameters=reply_parameters,
reply_markup=reply_markup
)
)

Expand Down
7 changes: 3 additions & 4 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,6 @@ def de_json(cls, json_string):
if 'gift_upgrade_sent' in obj:
opts['gift_upgrade_sent'] = GiftInfo.de_json(obj['gift_upgrade_sent'])
content_type = 'gift_upgrade_sent'

if 'reply_to_checklist_task_id' in obj:
opts['reply_to_checklist_task_id'] = obj['reply_to_checklist_task_id']
if 'direct_messages_topic' in obj:
Expand Down Expand Up @@ -1663,6 +1662,9 @@ def de_json(cls, json_string):
if 'poll_option_deleted' in obj:
opts['poll_option_deleted'] = PollOptionDeleted.de_json(obj['poll_option_deleted'])
content_type = 'poll_option_deleted'
if 'live_photo' in obj:
opts['live_photo'] = LivePhoto.de_json(obj['live_photo'])
content_type = 'live_photo'
Comment on lines +1665 to +1667
if 'reply_to_poll_option_id' in obj:
opts['reply_to_poll_option_id'] = obj['reply_to_poll_option_id']
if 'guest_bot_caller_user' in obj:
Expand All @@ -1671,8 +1673,6 @@ def de_json(cls, json_string):
opts['guest_bot_caller_chat'] = Chat.de_json(obj['guest_bot_caller_chat'])
if 'guest_query_id' in obj:
opts['guest_query_id'] = obj['guest_query_id']
if 'live_photo' in obj:
opts['live_photo'] = LivePhoto.de_json(obj['live_photo'])
return cls(message_id, from_user, date, chat, content_type, opts, json_string)

@classmethod
Expand Down Expand Up @@ -14543,4 +14543,3 @@ def de_json(cls, json_string):
if 'added_users' in obj:
obj['added_users'] = [User.de_json(user) for user in obj['added_users']]
return cls(**obj)

Loading