Describe local servers

This commit is contained in:
Alex Root Junior 2021-01-24 23:37:36 +02:00
parent 1a185928a2
commit 0719b27b6d
4 changed files with 25 additions and 0 deletions

View file

@ -6,6 +6,8 @@ AiohttpSession represents a wrapper-class around `ClientSession` from `aiohttp <
Currently `AiohttpSession` is a default session used in `aiogram.Bot`
.. autoclass:: aiogram.client.session.aiohttp.AiohttpSession
Usage example
=============

View file

@ -0,0 +1,13 @@
Use Custom API server
=====================
.. autoclass:: aiogram.client.telegram.TelegramAPIServer
:members:
For example, if you want to use self-hosted API server:
.. code-block:: python3
session = AiohttpSession()
session.api = TelegramAPIServer.from_base('http://localhost:8082')
bot = Bot(..., session=session)

View file

@ -2,6 +2,9 @@
Client session
##############
Client sessions is used for interacting with API server.
.. toctree::
custom_server
base
aiohttp