aiogram/aiogram/dispatcher/handler/callback_query.py
Alex Root Junior 4008a3114d
Upgrade architecture + 5.0 Bot API (#469)
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
2021-01-26 21:20:52 +02:00

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