MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / get_my_commands

Method get_my_commands

telebot/__init__.py:5159–5180  ·  view source on GitHub ↗

Use this method to get the current list of the bot's commands. Returns List of BotCommand on success. Telegram documentation: https://core.telegram.org/bots/api#getmycommands :param scope: The scope of users for which the commands are relevant. Defaults

(self, scope: Optional[types.BotCommandScope]=None,
            language_code: Optional[str]=None)

Source from the content-addressed store, hash-verified

5157
5158
5159 def get_my_commands(self, scope: Optional[types.BotCommandScope]=None,
5160 language_code: Optional[str]=None) -> List[types.BotCommand]:
5161 """
5162 Use this method to get the current list of the bot's commands.
5163 Returns List of BotCommand on success.
5164
5165 Telegram documentation: https://core.telegram.org/bots/api#getmycommands
5166
5167 :param scope: The scope of users for which the commands are relevant.
5168 Defaults to BotCommandScopeDefault.
5169 :type scope: :class:`telebot.types.BotCommandScope`
5170
5171 :param language_code: A two-letter ISO 639-1 language code. If empty,
5172 commands will be applied to all users from the given scope,
5173 for whose language there are no dedicated commands
5174 :type language_code: :obj:`str`
5175
5176 :return: List of BotCommand on success.
5177 :rtype: :obj:`list` of :class:`telebot.types.BotCommand`
5178 """
5179 result = apihelper.get_my_commands(self.token, scope=scope, language_code=language_code)
5180 return [types.BotCommand.de_json(cmd) for cmd in result]
5181
5182
5183 def set_my_name(self, name: Optional[str]=None, language_code: Optional[str]=None):

Callers 3

test_chat_commandsMethod · 0.95
mainFunction · 0.45

Calls 1

de_jsonMethod · 0.45

Tested by 1

test_chat_commandsMethod · 0.76