deleteMyCommands¶
Returns: bool
- class aiogram.methods.delete_my_commands.DeleteMyCommands(*, scope: BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember | None = None, language_code: str | None = None, **extra_data: Any)[source]¶
Use this method to delete the list of the bot’s commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns
True
on success.Source: https://core.telegram.org/bots/api#deletemycommands
- scope: BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember | None¶
A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to
aiogram.types.bot_command_scope_default.BotCommandScopeDefault
.
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_post_init(context: Any, /) None ¶
We need to both initialize private attributes and call the user-defined model_post_init method.
- language_code: str | None¶
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
Usage¶
As bot method¶
result: bool = await bot.delete_my_commands(...)
Method as object¶
Imports:
from aiogram.methods.delete_my_commands import DeleteMyCommands
alias:
from aiogram.methods import DeleteMyCommands
With specific bot¶
result: bool = await bot(DeleteMyCommands(...))
As reply into Webhook in handler¶
return DeleteMyCommands(...)