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

1
bot/handlers/__init__.py Normal file
View File

@@ -0,0 +1 @@
pass

View File

@@ -0,0 +1 @@
pass

23
bot/handlers/help/help.py Normal file
View File

@@ -0,0 +1,23 @@
from aiogram import types
from bot.common import dp
from .help_strings import help_data
@dp.message_handler(commands='help')
async def help_command(message: types.Message):
if message.get_args() == "":
await message.reply(
"\n".join(
list(
map(
(lambda x: f"/{x} - {help_data.get(x) if help_data.get(x) else f'No info for {x}'}"),
help_data.keys()
)
)
)
)
else:
if help_data.get(message.get_args()):
await message.reply(help_data.get(message.get_args()))
else:
await message.reply(f"No info for {message.get_args()}")

View File

@@ -0,0 +1,2 @@
help_data = {
}

View File

@@ -0,0 +1 @@
pass

View File

@@ -0,0 +1,7 @@
from bot.common import dp
from bot.db.pull_db import pull
@dp.message_handler()
async def pull_db_if_new(_):
await pull()

11
bot/handlers/register.py Normal file
View File

@@ -0,0 +1,11 @@
from rich import print
def import_handlers():
import bot.handlers.help.help
assert bot.handlers.help.help
import bot.handlers.initialize.pull_db
assert bot.handlers.initialize.pull_db
print('[gray]All handlers imported[/]')