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:
5
handlers/users/__init__.py
Normal file
5
handlers/users/__init__.py
Normal 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
7
handlers/users/echo.py
Normal 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
16
handlers/users/help.py
Normal 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
9
handlers/users/start.py
Normal 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}!')
|
||||
Reference in New Issue
Block a user