mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Added the ability to get the current bot name in the given language as the class BotName using the method getMyName.
This commit is contained in:
@@ -3462,6 +3462,22 @@ class TeleBot:
|
||||
|
||||
return apihelper.set_my_name(self.token, name, language_code)
|
||||
|
||||
def get_my_name(self, language_code: Optional[str]=None):
|
||||
"""
|
||||
Use this method to get the current bot name for the given user language.
|
||||
Returns BotName on success.
|
||||
|
||||
Telegram documentation: https://core.telegram.org/bots/api#getmyname
|
||||
|
||||
:param language_code: Optional. A two-letter ISO 639-1 language code or an empty string
|
||||
:type language_code: :obj:`str`
|
||||
|
||||
:return: :class:`telebot.types.BotName`
|
||||
"""
|
||||
|
||||
result = apihelper.get_my_name(self.token, language_code)
|
||||
return types.BotName.de_json(result)
|
||||
|
||||
def set_my_description(self, description: Optional[str]=None, language_code: Optional[str]=None):
|
||||
"""
|
||||
Use this method to change the bot's description, which is shown in
|
||||
|
||||
Reference in New Issue
Block a user