peyk.platforms.telegram.methods.set_my_commands

async peyk.platforms.telegram.methods.set_my_commands(self, commands: Sequence[BotCommand | Mapping[str, object]], *, scope: BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember | Mapping[str, object] | None = None, language_code: str | None = None) bool

Use this method to change the list of the bot’s commands. See this manual for more details about bot commands. Returns True on success.

Parameters:
  • commands – A JSON-serialized list of bot commands to be set as the list of the bot’s commands. At most 100 commands can be specified.

  • scope – A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.

  • language_code – 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.

Returns:

Result returned by Telegram on successful execution.

Return type:

bool