2020# random module to generate random string
2121import random
2222import string
23+ import copy
2324
2425import ssl
2526
@@ -4640,7 +4641,7 @@ def set_chat_description(self, chat_id: Union[int, str], description: Optional[s
46404641
46414642 def pin_chat_message (
46424643 self , chat_id : Union [int , str ], message_id : int ,
4643- disable_notification : Optional [bool ]= False ) -> bool :
4644+ disable_notification : Optional [bool ]= False , business_connection_id : Optional [ str ] = None ) -> bool :
46444645 """
46454646 Use this method to pin a message in a supergroup.
46464647 The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
@@ -4659,15 +4660,19 @@ def pin_chat_message(
46594660 to all group members about the new pinned message
46604661 :type disable_notification: :obj:`bool`
46614662
4663+ :param business_connection_id: Unique identifier of the business connection
4664+ :type business_connection_id: :obj:`str`
4665+
46624666 :return: True on success.
46634667 :rtype: :obj:`bool`
46644668 """
46654669 disable_notification = self .disable_notification if (disable_notification is None ) else disable_notification
46664670
4667- return apihelper .pin_chat_message (self .token , chat_id , message_id , disable_notification = disable_notification )
4671+ return apihelper .pin_chat_message (self .token , chat_id , message_id , disable_notification = disable_notification ,
4672+ business_connection_id = business_connection_id )
46684673
46694674
4670- def unpin_chat_message (self , chat_id : Union [int , str ], message_id : Optional [int ]= None ) -> bool :
4675+ def unpin_chat_message (self , chat_id : Union [int , str ], message_id : Optional [int ]= None , business_connection_id : Optional [ str ] = None ) -> bool :
46714676 """
46724677 Use this method to unpin specific pinned message in a supergroup chat.
46734678 The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
@@ -4682,10 +4687,13 @@ def unpin_chat_message(self, chat_id: Union[int, str], message_id: Optional[int]
46824687 :param message_id: Int: Identifier of a message to unpin
46834688 :type message_id: :obj:`int`
46844689
4690+ :param business_connection_id: Unique identifier of the business connection
4691+ :type business_connection_id: :obj:`str`
4692+
46854693 :return: True on success.
46864694 :rtype: :obj:`bool`
46874695 """
4688- return apihelper .unpin_chat_message (self .token , chat_id , message_id )
4696+ return apihelper .unpin_chat_message (self .token , chat_id , message_id , business_connection_id = business_connection_id )
46894697
46904698
46914699 def unpin_all_chat_messages (self , chat_id : Union [int , str ]) -> bool :
@@ -8749,7 +8757,7 @@ def _run_middlewares_and_handler(self, message, handlers, middlewares, update_ty
87498757 logger .error ("It is not allowed to pass data and values inside data to the handler. Check your handler: {}" .format (handler ['function' ]))
87508758 return
87518759 else :
8752- data_copy = data . copy ( )
8760+ data_copy = copy . deepcopy ( data )
87538761 for key in list (data_copy ):
87548762 # remove data from data_copy if handler does not accept it
87558763 if key not in params :
0 commit comments