SetBotCommandsRequest
Only bots can use this request. See code examples.
---functions--- bots.setBotCommands#0517165a scope:BotCommandScope lang_code:string commands:Vector<BotCommand> = Bool
Returns
| Bool |
This type has no instances available.
Parameters
| scope | BotCommandScope | |
| lang_code | string | |
| commands | BotCommand | A list must be supplied. |
Known RPC errors
This request can cause 3 known errors:
BotCommandDescriptionInvalidError | The command description was empty, too long or had invalid characters used. |
BotCommandInvalidError | The specified command is invalid. |
LangCodeInvalidError | The specified language code is invalid. |
You can import these from telethon.errors.
Example
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.bots.SetBotCommandsRequest(
scope=types.BotCommandScopeDefault(),
lang_code='en',
commands=[types.BotCommand(
command='some string here',
description='some string here'
)]
))
print(result)