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

scopeBotCommandScope
lang_codestring
commandsBotCommandA list must be supplied.

Known RPC errors

This request can cause 3 known errors:

BotCommandDescriptionInvalidErrorThe command description was empty, too long or had invalid characters used.
BotCommandInvalidErrorThe specified command is invalid.
LangCodeInvalidErrorThe 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)