mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 16:15:51 +00:00
Update base.rst (#1340)
* Update base.rst Typo correction * Create 1340.doc.rst
This commit is contained in:
parent
cf3044687a
commit
98771fdf31
2 changed files with 5 additions and 4 deletions
1
CHANGES/1340.doc.rst
Normal file
1
CHANGES/1340.doc.rst
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Minor typo correction, specifically in module naming + some grammar.
|
||||||
|
|
@ -6,15 +6,15 @@ BaseHandler
|
||||||
|
|
||||||
Base handler is generic abstract class and should be used in all other class-based handlers.
|
Base handler is generic abstract class and should be used in all other class-based handlers.
|
||||||
|
|
||||||
Import: :code:`from aiogram.handler import BaseHandler`
|
Import: :code:`from aiogram.handlers import BaseHandler`
|
||||||
|
|
||||||
By default you will need to override only method :code:`async def handle(self) -> Any: ...`
|
By default you will need to override only method :code:`async def handle(self) -> Any: ...`
|
||||||
|
|
||||||
This class is also have an default initializer and you don't need to change it.
|
This class also has a default initializer and you don't need to change it.
|
||||||
Initializer accepts current event and all contextual data and which
|
The initializer accepts the incoming event and all contextual data, which
|
||||||
can be accessed from the handler through attributes: :code:`event: TelegramEvent` and :code:`data: Dict[Any, str]`
|
can be accessed from the handler through attributes: :code:`event: TelegramEvent` and :code:`data: Dict[Any, str]`
|
||||||
|
|
||||||
If instance of the bot is specified in context data or current context it can be accessed through *bot* class attribute.
|
If an instance of the bot is specified in context data or current context it can be accessed through *bot* class attribute.
|
||||||
|
|
||||||
Example
|
Example
|
||||||
=======
|
=======
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue