@@ -2484,10 +2484,10 @@ class KeyboardButtonRequestUsers(Dictionaryable):
24842484
24852485 :return: Instance of the class
24862486 :rtype: :class:`telebot.types.KeyboardButtonRequestUsers`
2487-
24882487 """
2489-
2490- def __init__ (self , request_id : int , user_is_bot : Optional [bool ]= None , user_is_premium : Optional [bool ]= None , max_quantity : Optional [int ]= None ) -> None :
2488+ def __init__ (
2489+ self , request_id : int , user_is_bot : Optional [bool ]= None , user_is_premium : Optional [bool ]= None ,
2490+ max_quantity : Optional [int ]= None ) -> None :
24912491 self .request_id : int = request_id
24922492 self .user_is_bot : Optional [bool ] = user_is_bot
24932493 self .user_is_premium : Optional [bool ] = user_is_premium
@@ -2503,7 +2503,15 @@ def to_dict(self) -> dict:
25032503 data ['max_quantity' ] = self .max_quantity
25042504 return data
25052505
2506- KeyboardButtonRequestUser = KeyboardButtonRequestUsers
2506+
2507+ class KeyboardButtonRequestUser (KeyboardButtonRequestUsers ):
2508+ """Deprecated. Use KeyboardButtonRequestUsers instead."""
2509+ def __init__ (
2510+ self , request_id : int , user_is_bot : Optional [bool ]= None , user_is_premium : Optional [bool ]= None ,
2511+ max_quantity : Optional [int ]= None ) -> None :
2512+ logger .warning ('The parameter "voice_chat_scheduled" is deprecated, use "video_chat_scheduled" instead' )
2513+ super ().__init__ (request_id , user_is_bot = user_is_bot , user_is_premium = user_is_premium , max_quantity = max_quantity )
2514+
25072515
25082516class KeyboardButtonRequestChat (Dictionaryable ):
25092517 """
@@ -2603,9 +2611,12 @@ class KeyboardButton(Dictionaryable, JsonSerializable):
26032611 will be able to send a “web_app_data” service message. Available in private chats only.
26042612 :type web_app: :class:`telebot.types.WebAppInfo`
26052613
2606- :param request_user: Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user
2607- will send their identifier to the bot in a “users_shared” service message. Available in private chats only.
2608- :type request_user: :class:`telebot.types.KeyboardButtonRequestUsers`
2614+ :param request_user: deprecated
2615+ :type request_user: :class:`telebot.types.KeyboardButtonRequestUser`
2616+
2617+ :param request_users: Optional. If specified, pressing the button will open a list of suitable users.
2618+ Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
2619+ :type request_users: :class:`telebot.types.KeyboardButtonRequestUsers`
26092620
26102621 :param request_chat: Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will
26112622 send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
@@ -2616,18 +2627,19 @@ class KeyboardButton(Dictionaryable, JsonSerializable):
26162627 """
26172628 def __init__ (self , text : str , request_contact : Optional [bool ]= None ,
26182629 request_location : Optional [bool ]= None , request_poll : Optional [KeyboardButtonPollType ]= None ,
2619- web_app : Optional [WebAppInfo ]= None , request_user : Optional [KeyboardButtonRequestUsers ]= None ,
2630+ web_app : Optional [WebAppInfo ]= None , request_user : Optional [KeyboardButtonRequestUser ]= None ,
26202631 request_chat : Optional [KeyboardButtonRequestChat ]= None , request_users : Optional [KeyboardButtonRequestUsers ]= None ):
26212632 self .text : str = text
26222633 self .request_contact : bool = request_contact
26232634 self .request_location : bool = request_location
26242635 self .request_poll : KeyboardButtonPollType = request_poll
26252636 self .web_app : WebAppInfo = web_app
2626- self .request_user : KeyboardButtonRequestUsers = request_user
26272637 self .request_chat : KeyboardButtonRequestChat = request_chat
26282638 self .request_users : KeyboardButtonRequestUsers = request_users
26292639 if request_user is not None :
2630- self .request_users = request_user
2640+ logger .warning ('The parameter "request_user" is deprecated, use "request_users" instead' )
2641+ if self .request_users is None :
2642+ self .request_users = request_user
26312643
26322644
26332645 def to_json (self ):
@@ -2643,8 +2655,8 @@ def to_dict(self):
26432655 json_dict ['request_poll' ] = self .request_poll .to_dict ()
26442656 if self .web_app is not None :
26452657 json_dict ['web_app' ] = self .web_app .to_dict ()
2646- if self .request_user is not None :
2647- json_dict ['request_user ' ] = self .request_user .to_dict ()
2658+ if self .request_users is not None :
2659+ json_dict ['request_users ' ] = self .request_users .to_dict ()
26482660 if self .request_chat is not None :
26492661 json_dict ['request_chat' ] = self .request_chat .to_dict ()
26502662 return json_dict
0 commit comments