Add possibility to include router via string

This commit is contained in:
Alex Root Junior 2019-12-12 00:28:37 +02:00
parent b943ea2207
commit dadedc80a9
6 changed files with 86 additions and 3 deletions

13
handlers.py Normal file
View file

@ -0,0 +1,13 @@
from typing import Any
from aiogram import Router
from aiogram.api.methods import SendMessage
from aiogram.dispatcher.handler.message import MessageHandler
router = Router()
@router.message_handler(commands=["test"])
class MyHandler(MessageHandler):
async def handle(self) -> Any:
return SendMessage(chat_id=self.chat.id, text="<b>PASS</b>")