Skeleton of project - database loading

This commit is contained in:
BarsTiger
2023-02-13 19:51:25 +02:00
commit f778d3f71c
23 changed files with 348 additions and 0 deletions

20
bot/utils/commands.py Normal file
View File

@@ -0,0 +1,20 @@
from rich import print
from aiogram.types import BotCommand
from bot.common import bot
async def set_commands():
from bot.handlers.help.help_strings import help_data
await bot.set_my_commands(
commands=list(
map(
(lambda x: BotCommand(
command='/' + x,
description=help_data.get(x) if help_data.get(x) else f'No info for {x}'
)
), help_data.keys())
) + [BotCommand(command='/help', description='Get commands list or info by command')]
)
print('[gray]Commands registered[/]')