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:
2025-12-04 17:15:49 +03:00
parent f8a5294ca8
commit ff17dc543a
2 changed files with 58 additions and 3 deletions

16
main.py
View File

@@ -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)