Skip to content

Commit 38d60f5

Browse files
authored
Fix DC sessions for inline message edits (#585)
1 parent 99829ef commit 38d60f5

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

pyrogram/methods/messages/inline_session.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@
2626

2727
lock = Lock()
2828
session = None
29-
dest_dc_id = 4
3029

3130

3231
async def get_session(client: "pyrogram.Client", dc_id: int):
33-
if dc_id != dest_dc_id:
34-
return client
35-
3632
if dc_id == await client.storage.dc_id():
3733
return client
3834

@@ -43,8 +39,8 @@ async def get_session(client: "pyrogram.Client", dc_id: int):
4339
return session
4440

4541
session = Session(
46-
client, dest_dc_id,
47-
await Auth(client, dest_dc_id, False).create(),
42+
client, dc_id,
43+
await Auth(client, dc_id, False).create(),
4844
False, is_media=True
4945
)
5046

@@ -53,7 +49,7 @@ async def get_session(client: "pyrogram.Client", dc_id: int):
5349
for _ in range(3):
5450
exported_auth = await client.send(
5551
raw.functions.auth.ExportAuthorization(
56-
dc_id=dest_dc_id
52+
dc_id=dc_id
5753
)
5854
)
5955

0 commit comments

Comments
 (0)