Init connection on the DC from the session

This commit is contained in:
Lonami Exo 2023-09-12 20:55:46 +02:00
parent 9e5eb619e1
commit c57543d79a

View File

@ -124,6 +124,15 @@ async def connect(self: Client) -> None:
if session := await self._storage.load():
self._config.session = session
if user := self._config.session.user:
self._dc_id = user.dc
else:
for dc in self._config.session.dcs:
if dc.auth:
self._dc_id = dc.id
break
self._sender = await connect_sender(self._dc_id, self._config)
if self._message_box.is_empty() and self._config.session.user: