How to add a description of your teams to the list using aiogram

Viewed 671

the same list

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 cannot figure out how to apply it correctly.

2 Answers

Just found one answer but not sure that it works well...

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", "Меню"),
    ])
from aiogram import types


async def commands_list_menu(disp):
        await disp.bot.set_my_commands([
            types.BotCommand("start", "Start"),
            types.BotCommand("help", "Help"),
            types.BotCommand("settings", "Settings"),
    ])

then clear bot history and restart the bot, it's worked)

Related