Partial update docs

This commit is contained in:
Alex Root Junior 2022-10-01 22:51:16 +03:00
parent d9f9ff74fe
commit 4db765f3a7
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
17 changed files with 81 additions and 123 deletions

18
examples/own_filter.py Normal file
View file

@ -0,0 +1,18 @@
from aiogram import Router
from aiogram.filters import Filter
from aiogram.types import Message
router = Router()
class MyFilter(Filter):
def __init__(self, my_text: str) -> None:
self.my_text = my_text
async def __call__(self, message: Message) -> bool:
return message.text == self.my_text
@router.message(MyFilter("hello"))
async def my_handler(message: Message):
...