From 98771fdf31f9653dfaafc6a0afdc54ac8e7b4203 Mon Sep 17 00:00:00 2001 From: VasBrd <86557363+VasBrd@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:00:25 +0300 Subject: [PATCH] Update base.rst (#1340) * Update base.rst Typo correction * Create 1340.doc.rst --- CHANGES/1340.doc.rst | 1 + docs/dispatcher/class_based_handlers/base.rst | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 CHANGES/1340.doc.rst diff --git a/CHANGES/1340.doc.rst b/CHANGES/1340.doc.rst new file mode 100644 index 00000000..83bd6723 --- /dev/null +++ b/CHANGES/1340.doc.rst @@ -0,0 +1 @@ +Minor typo correction, specifically in module naming + some grammar. diff --git a/docs/dispatcher/class_based_handlers/base.rst b/docs/dispatcher/class_based_handlers/base.rst index 0d478224..8c694d4f 100644 --- a/docs/dispatcher/class_based_handlers/base.rst +++ b/docs/dispatcher/class_based_handlers/base.rst @@ -6,15 +6,15 @@ BaseHandler 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: ...` -This class is also have an default initializer and you don't need to change it. -Initializer accepts current event and all contextual data and which +This class also has a default initializer and you don't need to change it. +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]` -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 =======