Base#
Abstract session for all client sessions
- class aiogram.client.session.base.BaseSession(api: ~aiogram.client.telegram.TelegramAPIServer = TelegramAPIServer(base='https://api.telegram.org/bot{token}/{method}', file='https://api.telegram.org/file/bot{token}/{path}', is_local=False, wrap_local_file=<aiogram.client.telegram.BareFilesPathWrapper object>), json_loads: ~typing.Callable[[...], ~typing.Any] = <function loads>, json_dumps: ~typing.Callable[[...], str] = <function dumps>, timeout: float = 60.0)[source]#
- check_response(method: TelegramMethod[TelegramType], status_code: int, content: str) Response [source]#
Check response status
- abstract async make_request(bot: Bot, method: TelegramMethod[TelegramType], timeout: Optional[int] = None) TelegramType [source]#
Make request to Telegram Bot API
- Parameters:
bot – Bot instance
method – Method instance
timeout – Request timeout
- Returns:
- Raises:
TelegramApiError –