mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 18:01:04 +00:00
More class based handlers
This commit is contained in:
parent
b144332287
commit
895b727ddf
24 changed files with 506 additions and 30 deletions
27
docs/dispatcher/class_based_handlers/inline_query.md
Normal file
27
docs/dispatcher/class_based_handlers/inline_query.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# InlineQueryHandler
|
||||
There is base class for inline query handlers.
|
||||
|
||||
## Simple usage:
|
||||
```pyhton3
|
||||
from aiogram.handlers import InlineQueryHandler
|
||||
|
||||
...
|
||||
|
||||
@router.inline_query_handler()
|
||||
class MyHandler(InlineQueryHandler):
|
||||
async def handle(self) -> Any: ...
|
||||
|
||||
```
|
||||
|
||||
## Extension
|
||||
|
||||
This base handler is subclass of [BaseHandler](basics.md#basehandler) with some extensions:
|
||||
|
||||
- `self.chat` is alias for `self.event.chat`
|
||||
- `self.query` is alias for `self.event.query`
|
||||
|
||||
## Related pages
|
||||
|
||||
- [BaseHandler](basics.md#basehandler)
|
||||
- [InlineQuery](../../api/types/inline_query.md)
|
||||
- [Router.inline_query_handler](../router.md#inline-query)
|
||||
Loading…
Add table
Add a link
Reference in a new issue