mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Upgrade architecture + 5.0 Bot API (#469) * Moved `methods`, `types` and `client` to root package * Removed update handler from routers to dispatcher * Reworked events propagation mechanism to handlers * Reworked inner middlewares logic (very small change) * Updated to Bot API 5.0 * Initial migration from MkDocs to Sphinx + config for readthedocs
23 lines
546 B
Python
23 lines
546 B
Python
from abc import ABC
|
|
from typing import Optional
|
|
|
|
from aiogram.dispatcher.handler import BaseHandler
|
|
from aiogram.types import CallbackQuery, Message, User
|
|
|
|
|
|
class CallbackQueryHandler(BaseHandler[CallbackQuery], ABC):
|
|
"""
|
|
Base class for callback query handlers
|
|
"""
|
|
|
|
@property
|
|
def from_user(self) -> User:
|
|
return self.event.from_user
|
|
|
|
@property
|
|
def message(self) -> Optional[Message]:
|
|
return self.event.message
|
|
|
|
@property
|
|
def callback_data(self) -> Optional[str]:
|
|
return self.event.data
|