如何使用 aiogram 将您的团队的描述添加到列表中
How to add a description of your teams to the list using aiogram
the same list
当您在电报机器人中键入 "/" 时,会出现一个菜单,其中包含可能的命令及其描述。我知道这是用 types.BotCommand ()
完成的,但我不知道如何正确应用它。
刚找到一个答案,但不确定它是否有效...
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"),
])
然后清除bot历史并重启bot,成功了)
the same list
当您在电报机器人中键入 "/" 时,会出现一个菜单,其中包含可能的命令及其描述。我知道这是用 types.BotCommand ()
完成的,但我不知道如何正确应用它。
刚找到一个答案,但不确定它是否有效...
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"),
])
然后清除bot历史并重启bot,成功了)