From be83f8e25ea909a92b64f6145ed96557cdf8ee39 Mon Sep 17 00:00:00 2001 From: Ripe <42308266+Ripeey@users.noreply.github.com> Date: Sat, 15 May 2021 10:36:37 +0530 Subject: [PATCH] Actually fix inline message id invalid (for inline message queries) (#683) * Fix Inline Message ID Invalid * Update inline_session.py * Update inline_session.py Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com> --- pyrogram/methods/messages/inline_session.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyrogram/methods/messages/inline_session.py b/pyrogram/methods/messages/inline_session.py index 3ea86369..bfc323a2 100644 --- a/pyrogram/methods/messages/inline_session.py +++ b/pyrogram/methods/messages/inline_session.py @@ -25,7 +25,7 @@ from pyrogram.session import Session from pyrogram.session.auth import Auth lock = Lock() -session = None +sessions = {} async def get_session(client: "pyrogram.Client", dc_id: int): @@ -33,12 +33,12 @@ async def get_session(client: "pyrogram.Client", dc_id: int): return client async with lock: - global session + global sessions - if session is not None: - return session + if sessions.get(dc_id): + return sessions[dc_id] - session = Session( + session = sessions[dc_id] = Session( client, dc_id, await Auth(client, dc_id, False).create(), False, is_media=True