mirror of
https://github.com/koloideal/Quizzi.git
synced 2026-06-10 18:35:28 +03:00
commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
from aiogram import Bot
|
||||
from aiogram.types import BotCommand, BotCommandScopeAllPrivateChats, BotCommandScopeChat
|
||||
|
||||
from trudex.infrastructure.database.repo.user import UserRepository
|
||||
from trudex.infrastructure.utils.config import Config
|
||||
|
||||
|
||||
async def setup_bot_commands(bot: Bot, config: Config, user_repo: UserRepository) -> None:
|
||||
await bot.set_my_commands(
|
||||
commands=[
|
||||
BotCommand(command="start", description="Главное меню"),
|
||||
],
|
||||
scope=BotCommandScopeAllPrivateChats(),
|
||||
)
|
||||
|
||||
admins = await user_repo.get_admins()
|
||||
for admin in admins:
|
||||
await bot.set_my_commands(
|
||||
commands=[
|
||||
BotCommand(command="start", description="Главное меню"),
|
||||
BotCommand(command="admin", description="Админ-панель"),
|
||||
],
|
||||
scope=BotCommandScopeChat(chat_id=admin.id),
|
||||
)
|
||||
|
||||
await bot.set_my_commands(
|
||||
commands=[
|
||||
BotCommand(command="start", description="Главное меню"),
|
||||
BotCommand(command="creator", description="Панель создателя"),
|
||||
],
|
||||
scope=BotCommandScopeChat(chat_id=config.bot.creator_id),
|
||||
)
|
||||
Reference in New Issue
Block a user