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]¶
This is base class for all HTTP sessions in aiogram.
If you want to create your own session, you must inherit from this class.
- check_response(bot: Bot, method: TelegramMethod[TelegramType], status_code: int, content: str) Response[TelegramType] [source]¶
Check response status
- abstract async make_request(bot: Bot, method: TelegramMethod[TelegramType], timeout: int | None = None) TelegramType [source]¶
Make request to Telegram Bot API
- Parameters:
bot – Bot instance
method – Method instance
timeout – Request timeout
- Returns:
- Raises:
TelegramApiError –