Set the list of the bot’s commands. The commands passed will overwrite any command set previously. This method can be used by the own bot only.Usable by Users Bots
commands (List of
BotCommand) – A list of bot commands. At most 100 commands can be specified.
BotCommandScope, optional) – An object describing the scope of users for which the commands are relevant. Defaults to
str, optional) – A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
bool– On success, True is returned.
from pyrogram.types import BotCommand # Set new commands await app.set_bot_commands([ BotCommand("start", "Start the bot"), BotCommand("settings", "Bot settings")])