Skeleton of project - database loading
This commit is contained in:
0
bot/utils/__init__.py
Normal file
0
bot/utils/__init__.py
Normal file
20
bot/utils/commands.py
Normal file
20
bot/utils/commands.py
Normal 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[/]')
|
||||
Reference in New Issue
Block a user