mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add possibility to include router via string
This commit is contained in:
parent
b943ea2207
commit
dadedc80a9
6 changed files with 86 additions and 3 deletions
13
handlers.py
Normal file
13
handlers.py
Normal 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>")
|
||||
Loading…
Add table
Add a link
Reference in a new issue