feat(start): add persistent reply keyboard with main commands; add /menu to show it\nchore(bot): register BotCommand list for Telegram menu
This commit is contained in:
16
main.py
16
main.py
@@ -4,6 +4,7 @@ import logging
|
||||
from aiogram import Bot, Dispatcher
|
||||
from aiogram.client.default import DefaultBotProperties
|
||||
from aiogram.enums import ParseMode
|
||||
from aiogram.types import BotCommand
|
||||
|
||||
from config.settings import settings
|
||||
from bot.handlers import start, vocabulary, tasks, settings as settings_handler, words, import_text, practice, reminder, level_test
|
||||
@@ -26,6 +27,21 @@ async def main():
|
||||
)
|
||||
dp = Dispatcher()
|
||||
|
||||
# Команды бота для меню Telegram
|
||||
await bot.set_my_commands([
|
||||
BotCommand(command="start", description="Запустить бота"),
|
||||
BotCommand(command="add", description="Добавить слово"),
|
||||
BotCommand(command="words", description="Тематическая подборка слов"),
|
||||
BotCommand(command="import", description="Импорт слов из текста"),
|
||||
BotCommand(command="vocabulary", description="Мой словарь"),
|
||||
BotCommand(command="task", description="Задания"),
|
||||
BotCommand(command="practice", description="Диалог с AI"),
|
||||
BotCommand(command="stats", description="Статистика"),
|
||||
BotCommand(command="settings", description="Настройки"),
|
||||
BotCommand(command="reminder", description="Напоминания"),
|
||||
BotCommand(command="help", description="Справка"),
|
||||
])
|
||||
|
||||
# Регистрация роутеров
|
||||
dp.include_router(start.router)
|
||||
dp.include_router(level_test.router)
|
||||
|
||||
Reference in New Issue
Block a user