@@ -3324,6 +3324,7 @@ def edit_message_live_location(
3324
3324
heading : Optional [int ]= None ,
3325
3325
proximity_alert_radius : Optional [int ]= None ,
3326
3326
live_period : Optional [int ]= None ,
3327
+ business_connection_id : Optional [str ]= None
3327
3328
) -> types .Message or bool :
3328
3329
"""
3329
3330
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly
@@ -3366,14 +3367,17 @@ def edit_message_live_location(
3366
3367
:param live_period: New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged
3367
3368
:type live_period: :obj:`int`
3368
3369
3370
+ :param business_connection_id: Identifier of a business connection
3371
+ :type business_connection_id: :obj:`str`
3372
+
3369
3373
:return: On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
3370
3374
:rtype: :class:`telebot.types.Message` or bool
3371
3375
"""
3372
3376
return types .Message .de_json (
3373
3377
apihelper .edit_message_live_location (
3374
3378
self .token , latitude , longitude , chat_id = chat_id , message_id = message_id , inline_message_id = inline_message_id ,
3375
3379
reply_markup = reply_markup , timeout = timeout , horizontal_accuracy = horizontal_accuracy , heading = heading ,
3376
- proximity_alert_radius = proximity_alert_radius , live_period = live_period )
3380
+ proximity_alert_radius = proximity_alert_radius , live_period = live_period , business_connection_id = business_connection_id )
3377
3381
)
3378
3382
3379
3383
@@ -3382,7 +3386,8 @@ def stop_message_live_location(
3382
3386
message_id : Optional [int ]= None ,
3383
3387
inline_message_id : Optional [str ]= None ,
3384
3388
reply_markup : Optional [types .InlineKeyboardMarkup ]= None ,
3385
- timeout : Optional [int ]= None ) -> types .Message or bool :
3389
+ timeout : Optional [int ]= None ,
3390
+ business_connection_id : Optional [str ]= None ) -> types .Message or bool :
3386
3391
"""
3387
3392
Use this method to stop updating a live location message before live_period expires.
3388
3393
On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
@@ -3405,13 +3410,16 @@ def stop_message_live_location(
3405
3410
:param timeout: Timeout in seconds for the request.
3406
3411
:type timeout: :obj:`int`
3407
3412
3413
+ :param business_connection_id: Identifier of a business connection
3414
+ :type business_connection_id: :obj:`str`
3415
+
3408
3416
:return: On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
3409
3417
:rtype: :class:`telebot.types.Message` or bool
3410
3418
"""
3411
3419
return types .Message .de_json (
3412
3420
apihelper .stop_message_live_location (
3413
3421
self .token , chat_id = chat_id , message_id = message_id , inline_message_id = inline_message_id ,
3414
- reply_markup = reply_markup , timeout = timeout )
3422
+ reply_markup = reply_markup , timeout = timeout , business_connection_id = business_connection_id )
3415
3423
)
3416
3424
3417
3425
@@ -4645,7 +4653,8 @@ def edit_message_text(
4645
4653
entities : Optional [List [types .MessageEntity ]]= None ,
4646
4654
disable_web_page_preview : Optional [bool ]= None , # deprecated, for backward compatibility
4647
4655
reply_markup : Optional [types .InlineKeyboardMarkup ]= None ,
4648
- link_preview_options : Optional [types .LinkPreviewOptions ]= None ) -> Union [types .Message , bool ]:
4656
+ link_preview_options : Optional [types .LinkPreviewOptions ]= None ,
4657
+ business_connection_id : Optional [str ]= None ) -> Union [types .Message , bool ]:
4649
4658
"""
4650
4659
Use this method to edit text and game messages.
4651
4660
@@ -4678,6 +4687,9 @@ def edit_message_text(
4678
4687
:param link_preview_options: A JSON-serialized object for options used to automatically generate previews for links.
4679
4688
:type link_preview_options: :obj:`LinkPreviewOptions`
4680
4689
4690
+ :param business_connection_id: Unique identifier of the business connection
4691
+ :type business_connection_id: :obj:`str`
4692
+
4681
4693
:return: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
4682
4694
:rtype: :obj:`types.Message` or :obj:`bool`
4683
4695
"""
@@ -4704,7 +4716,8 @@ def edit_message_text(
4704
4716
4705
4717
result = apihelper .edit_message_text (
4706
4718
self .token , text , chat_id = chat_id , message_id = message_id , inline_message_id = inline_message_id ,
4707
- parse_mode = parse_mode , entities = entities , reply_markup = reply_markup , link_preview_options = link_preview_options )
4719
+ parse_mode = parse_mode , entities = entities , reply_markup = reply_markup , link_preview_options = link_preview_options ,
4720
+ business_connection_id = business_connection_id )
4708
4721
4709
4722
if type (result ) == bool : # if edit inline message return is bool not Message.
4710
4723
return result
@@ -4715,7 +4728,8 @@ def edit_message_media(
4715
4728
self , media : Any , chat_id : Optional [Union [int , str ]]= None ,
4716
4729
message_id : Optional [int ]= None ,
4717
4730
inline_message_id : Optional [str ]= None ,
4718
- reply_markup : Optional [types .InlineKeyboardMarkup ]= None ) -> Union [types .Message , bool ]:
4731
+ reply_markup : Optional [types .InlineKeyboardMarkup ]= None ,
4732
+ business_connection_id : Optional [str ]= None ) -> Union [types .Message , bool ]:
4719
4733
"""
4720
4734
Use this method to edit animation, audio, document, photo, or video messages.
4721
4735
If a message is a part of a message album, then it can be edited only to a photo or a video.
@@ -4738,12 +4752,15 @@ def edit_message_media(
4738
4752
:param reply_markup: A JSON-serialized object for an inline keyboard.
4739
4753
:type reply_markup: :obj:`telebot.types.InlineKeyboardMarkup` or :obj:`ReplyKeyboardMarkup` or :obj:`ReplyKeyboardRemove` or :obj:`ForceReply`
4740
4754
4755
+ :param business_connection_id: Unique identifier of the business connection
4756
+ :type business_connection_id: :obj:`str`
4757
+
4741
4758
:return: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
4742
4759
:rtype: :obj:`types.Message` or :obj:`bool`
4743
4760
"""
4744
4761
result = apihelper .edit_message_media (
4745
4762
self .token , media , chat_id = chat_id , message_id = message_id , inline_message_id = inline_message_id ,
4746
- reply_markup = reply_markup )
4763
+ reply_markup = reply_markup , business_connection_id = business_connection_id )
4747
4764
4748
4765
if type (result ) == bool : # if edit inline message return is bool not Message.
4749
4766
return result
@@ -4754,7 +4771,8 @@ def edit_message_reply_markup(
4754
4771
self , chat_id : Optional [Union [int , str ]]= None ,
4755
4772
message_id : Optional [int ]= None ,
4756
4773
inline_message_id : Optional [str ]= None ,
4757
- reply_markup : Optional [types .InlineKeyboardMarkup ]= None ) -> Union [types .Message , bool ]:
4774
+ reply_markup : Optional [types .InlineKeyboardMarkup ]= None ,
4775
+ business_connection_id : Optional [str ]= None ) -> Union [types .Message , bool ]:
4758
4776
"""
4759
4777
Use this method to edit only the reply markup of messages.
4760
4778
@@ -4772,12 +4790,15 @@ def edit_message_reply_markup(
4772
4790
:param reply_markup: A JSON-serialized object for an inline keyboard.
4773
4791
:type reply_markup: :obj:`InlineKeyboardMarkup` or :obj:`ReplyKeyboardMarkup` or :obj:`ReplyKeyboardRemove` or :obj:`ForceReply`
4774
4792
4793
+ :param business_connection_id: Unique identifier of the business connection
4794
+ :type business_connection_id: :obj:`str`
4795
+
4775
4796
:return: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
4776
4797
:rtype: :obj:`types.Message` or :obj:`bool`
4777
4798
"""
4778
4799
result = apihelper .edit_message_reply_markup (
4779
4800
self .token , chat_id = chat_id , message_id = message_id , inline_message_id = inline_message_id ,
4780
- reply_markup = reply_markup )
4801
+ reply_markup = reply_markup , business_connection_id = business_connection_id )
4781
4802
4782
4803
if type (result ) == bool :
4783
4804
return result
@@ -5397,7 +5418,8 @@ def send_poll(
5397
5418
5398
5419
def stop_poll (
5399
5420
self , chat_id : Union [int , str ], message_id : int ,
5400
- reply_markup : Optional [types .InlineKeyboardMarkup ]= None ) -> types .Poll :
5421
+ reply_markup : Optional [types .InlineKeyboardMarkup ]= None ,
5422
+ business_connection_id : Optional [str ]= None ) -> types .Poll :
5401
5423
"""
5402
5424
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
5403
5425
@@ -5412,11 +5434,14 @@ def stop_poll(
5412
5434
:param reply_markup: A JSON-serialized object for a new message markup.
5413
5435
:type reply_markup: :obj:`InlineKeyboardMarkup`
5414
5436
5437
+ :param business_connection_id: Identifier of the business connection to use for the poll
5438
+ :type business_connection_id: :obj:`str`
5439
+
5415
5440
:return: On success, the stopped Poll is returned.
5416
5441
:rtype: :obj:`types.Poll`
5417
5442
"""
5418
5443
return types .Poll .de_json (
5419
- apihelper .stop_poll (self .token , chat_id , message_id , reply_markup = reply_markup )
5444
+ apihelper .stop_poll (self .token , chat_id , message_id , reply_markup = reply_markup , business_connection_id = business_connection_id )
5420
5445
)
5421
5446
5422
5447
@@ -5478,6 +5503,27 @@ def answer_pre_checkout_query(
5478
5503
"""
5479
5504
return apihelper .answer_pre_checkout_query (
5480
5505
self .token , pre_checkout_query_id , ok , error_message = error_message )
5506
+
5507
+
5508
+ def get_star_transactions (self , offset : Optional [int ]= None , limit : Optional [int ]= None ) -> types .StarTransactions :
5509
+ """
5510
+ Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
5511
+
5512
+ Telegram documentation: https://core.telegram.org/bots/api#getstartransactions
5513
+
5514
+ :param offset: Number of transactions to skip in the response
5515
+ :type offset: :obj:`int`
5516
+
5517
+ :param limit: The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100.
5518
+ :type limit: :obj:`int`
5519
+
5520
+ :return: On success, returns a StarTransactions object.
5521
+ :rtype: :obj:`types.StarTransactions`
5522
+ """
5523
+ return types .StarTransactions .de_json (
5524
+ apihelper .get_star_transactions (self .token , offset = offset , limit = limit )
5525
+ )
5526
+
5481
5527
5482
5528
def refund_star_payment (self , user_id : int , telegram_payment_charge_id : str ) -> bool :
5483
5529
"""
@@ -5503,7 +5549,8 @@ def edit_message_caption(
5503
5549
parse_mode : Optional [str ]= None ,
5504
5550
caption_entities : Optional [List [types .MessageEntity ]]= None ,
5505
5551
reply_markup : Optional [types .InlineKeyboardMarkup ]= None ,
5506
- show_caption_above_media : Optional [bool ]= None ) -> Union [types .Message , bool ]:
5552
+ show_caption_above_media : Optional [bool ]= None ,
5553
+ business_connection_id : Optional [str ]= None ) -> Union [types .Message , bool ]:
5507
5554
"""
5508
5555
Use this method to edit captions of messages.
5509
5556
@@ -5533,6 +5580,9 @@ def edit_message_caption(
5533
5580
:param show_caption_above_media: Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.
5534
5581
:type show_caption_above_media: :obj:`bool`
5535
5582
5583
+ :param business_connection_id: Identifier of the business connection to use for the message
5584
+ :type business_connection_id: :obj:`str`
5585
+
5536
5586
:return: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
5537
5587
:rtype: :obj:`types.Message` | :obj:`bool`
5538
5588
"""
@@ -5541,7 +5591,7 @@ def edit_message_caption(
5541
5591
result = apihelper .edit_message_caption (
5542
5592
self .token , caption , chat_id = chat_id , message_id = message_id , inline_message_id = inline_message_id ,
5543
5593
parse_mode = parse_mode , caption_entities = caption_entities , reply_markup = reply_markup ,
5544
- show_caption_above_media = show_caption_above_media )
5594
+ show_caption_above_media = show_caption_above_media , business_connection_id = business_connection_id )
5545
5595
5546
5596
if type (result ) == bool :
5547
5597
return result
0 commit comments