From 0cda4f9c79d01259b45a9a9426ce09ace5d55f40 Mon Sep 17 00:00:00 2001 From: S!R X <111647198+SIR-X@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:50:26 +0330 Subject: [PATCH] Fix a bug with get_session (#76) * Fix a bug InputBotInlineMessageID's dc_id being the same with Client's dc_id. Closes #74 --------- Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com> --- pyrogram/methods/messages/inline_session.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrogram/methods/messages/inline_session.py b/pyrogram/methods/messages/inline_session.py index cf74e5ad..cbc09ea3 100644 --- a/pyrogram/methods/messages/inline_session.py +++ b/pyrogram/methods/messages/inline_session.py @@ -36,6 +36,9 @@ async def get_session(client: "pyrogram.Client", dc_id: int) -> Session: await session.start() + if dc_id == await client.storage.dc_id(): + return session + for _ in range(3): exported_auth = await client.invoke( raw.functions.auth.ExportAuthorization(