mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 12:59:46 +00:00
Init connection on the DC from the session
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user