MCPcopy Index your code
hub / github.com/eternnoir/pyTelegramBotAPI / main

Function main

examples/asynchronous_telebot/set_command_example.py:17–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16
17async def main():
18 # use in for delete with the necessary scope and language_code if necessary
19 await bot.delete_my_commands(scope=None, language_code=None)
20
21 await bot.set_my_commands(
22 commands=[
23 telebot.types.BotCommand("command1", "command1 description"),
24 telebot.types.BotCommand("command2", "command2 description")
25 ],
26 # scope=telebot.types.BotCommandScopeChat(12345678) # use for personal command menu for users
27 # scope=telebot.types.BotCommandScopeAllPrivateChats() # use for all private chats
28 )
29
30 cmd = await bot.get_my_commands(scope=None, language_code=None)
31 print([c.to_json() for c in cmd])
32
33
34if __name__ == '__main__':

Callers 1

Calls 4

delete_my_commandsMethod · 0.45
set_my_commandsMethod · 0.45
get_my_commandsMethod · 0.45
to_jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…