Deleted mysql support, redis password, webhook, keyboard constructors, filters, loguru.

Added support of decorators in handlers
Added function to notify admins on startup
This commit is contained in:
Kostiantyn Kriuchkov
2020-04-14 01:50:57 +03:00
parent 13ff8d0478
commit eab45a5088
30 changed files with 141 additions and 223 deletions

View File

@@ -0,0 +1,5 @@
from .help import dp
from .start import dp
from .echo import dp
__all__ = ["dp"]

7
handlers/users/echo.py Normal file
View File

@@ -0,0 +1,7 @@
from aiogram import types
from bot import dp
@dp.message_handler()
async def bot_start(message: types.Message):
await message.answer(message.text)

16
handlers/users/help.py Normal file
View File

@@ -0,0 +1,16 @@
from aiogram import types
from aiogram.dispatcher.filters.builtin import CommandStart
from bot import dp
from utils.misc import rate_limit
@rate_limit(5, 'help')
@dp.message_handler(CommandStart())
async def bot_help(message: types.Message):
text = [
'Список команд: ',
'/start - Начать диалог',
'/help - Получить справку'
]
await message.answer('\n'.join(text))

9
handlers/users/start.py Normal file
View File

@@ -0,0 +1,9 @@
from aiogram import types
from aiogram.dispatcher.filters.builtin import CommandStart
from bot import dp
@dp.message_handler(CommandStart())
async def bot_start(message: types.Message):
await message.answer(f'Привет, {message.from_user.full_name}!')