H
H
hezeri232021-05-16 04:21:14
Python
hezeri23, 2021-05-16 04:21:14

How to add a description of your commands to the list using aiogram?

When you type "/" in the telegram bot, a menu appears with possible commands and their descriptions. I know this is done with types.BotCommand(), however I can't figure out how to apply this correctly.
bfOB6.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Confy, 2021-05-16
@hezeri23

from aiogram import types

async def set_default_commands(dp):
    await dp.bot.set_my_commands([
        types.BotCommand("start", "Запустить бота"),
        types.BotCommand("help", "Помощь"),
        types.BotCommand("test", "Тест"),
        types.BotCommand("form", "Форма"),
        types.BotCommand("menu", "Меню"),
    ])

Source: random bot on github

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question