@@ -3443,13 +3443,49 @@ def get_my_commands(self, scope: Optional[types.BotCommandScope]=None,
34433443 """
34443444 result = apihelper .get_my_commands (self .token , scope , language_code )
34453445 return [types .BotCommand .de_json (cmd ) for cmd in result ]
3446+
3447+ def set_my_name (self , name : Optional [str ]= None , language_code : Optional [str ]= None ):
3448+ """
3449+ Use this method to change the bot's name. Returns True on success.
3450+
3451+ Telegram documentation: https://core.telegram.org/bots/api#setmyname
3452+
3453+ :param name: Optional. New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
3454+ :type name: :obj:`str`
3455+
3456+ :param language_code: Optional. A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose
3457+ language there is no dedicated name.
3458+ :type language_code: :obj:`str`
3459+
3460+ :return: True on success.
3461+ """
3462+
3463+ return apihelper .set_my_name (self .token , name , language_code )
3464+
3465+ def get_my_name (self , language_code : Optional [str ]= None ):
3466+ """
3467+ Use this method to get the current bot name for the given user language.
3468+ Returns BotName on success.
3469+
3470+ Telegram documentation: https://core.telegram.org/bots/api#getmyname
3471+
3472+ :param language_code: Optional. A two-letter ISO 639-1 language code or an empty string
3473+ :type language_code: :obj:`str`
3474+
3475+ :return: :class:`telebot.types.BotName`
3476+ """
3477+
3478+ result = apihelper .get_my_name (self .token , language_code )
3479+ return types .BotName .de_json (result )
34463480
34473481 def set_my_description (self , description : Optional [str ]= None , language_code : Optional [str ]= None ):
34483482 """
34493483 Use this method to change the bot's description, which is shown in
34503484 the chat with the bot if the chat is empty.
34513485 Returns True on success.
34523486
3487+ Telegram documentation: https://core.telegram.org/bots/api#setmydescription
3488+
34533489 :param description: New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
34543490 :type description: :obj:`str`
34553491
@@ -3467,6 +3503,8 @@ def get_my_description(self, language_code: Optional[str]=None):
34673503 Use this method to get the current bot description for the given user language.
34683504 Returns BotDescription on success.
34693505
3506+ Telegram documentation: https://core.telegram.org/bots/api#getmydescription
3507+
34703508 :param language_code: A two-letter ISO 639-1 language code or an empty string
34713509 :type language_code: :obj:`str`
34723510
@@ -3481,6 +3519,8 @@ def set_my_short_description(self, short_description:Optional[str]=None, languag
34813519 is sent together with the link when users share the bot.
34823520 Returns True on success.
34833521
3522+ Telegram documentation: https://core.telegram.org/bots/api#setmyshortdescription
3523+
34843524 :param short_description: New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
34853525 :type short_description: :obj:`str`
34863526
@@ -3498,6 +3538,8 @@ def get_my_short_description(self, language_code: Optional[str]=None):
34983538 Use this method to get the current bot short description for the given user language.
34993539 Returns BotShortDescription on success.
35003540
3541+ Telegram documentation: https://core.telegram.org/bots/api#getmyshortdescription
3542+
35013543 :param language_code: A two-letter ISO 639-1 language code or an empty string
35023544 :type language_code: :obj:`str`
35033545
@@ -4479,7 +4521,8 @@ def answer_inline_query(
44794521 is_personal : Optional [bool ]= None ,
44804522 next_offset : Optional [str ]= None ,
44814523 switch_pm_text : Optional [str ]= None ,
4482- switch_pm_parameter : Optional [str ]= None ) -> bool :
4524+ switch_pm_parameter : Optional [str ]= None ,
4525+ button : Optional [types .InlineQueryResultsButton ]= None ) -> bool :
44834526 """
44844527 Use this method to send answers to an inline query. On success, True is returned.
44854528 No more than 50 results per query are allowed.
@@ -4515,11 +4558,18 @@ def answer_inline_query(
45154558 :param switch_pm_text: Parameter for the start message sent to the bot when user presses the switch button
45164559 :type switch_pm_text: :obj:`str`
45174560
4561+ :param button: A JSON-serialized object describing a button to be shown above inline query results
4562+ :type button: :obj:`types.InlineQueryResultsButton`
4563+
45184564 :return: On success, True is returned.
45194565 :rtype: :obj:`bool`
45204566 """
4567+ if not button and (switch_pm_text or switch_pm_parameter ):
4568+ logger .warning ("switch_pm_text and switch_pm_parameter are deprecated for answer_inline_query. Use button instead." )
4569+ button = types .InlineQueryResultsButton (text = switch_pm_text , start_parameter = switch_pm_parameter )
4570+
45214571 return apihelper .answer_inline_query (self .token , inline_query_id , results , cache_time , is_personal , next_offset ,
4522- switch_pm_text , switch_pm_parameter )
4572+ button )
45234573
45244574 def answer_callback_query (
45254575 self , callback_query_id : int ,
0 commit comments