Fix self_user setting in chat_hashes (#4402)

This commit is contained in:
Nazar Taran 2024-07-02 16:52:13 +02:00 committed by GitHub
parent 26c32f31d2
commit 65a4a96dbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -190,13 +190,12 @@ async def connect(self: Client) -> None:
except Exception:
pass
else:
if not self._session.user:
me = await self.get_me()
assert me is not None
self._session.user = SessionUser(
id=me.id, dc=self._sender.dc_id, bot=me.bot, username=me.username
)
self._chat_hashes.set_self_user(me.id, me.bot)
me = await self.get_me()
assert me is not None
self._chat_hashes.set_self_user(me.id, me.bot)
self._session.user = SessionUser(
id=me.id, dc=self._sender.dc_id, bot=me.bot, username=me.username
)
self._dispatcher = asyncio.create_task(dispatcher(self))