From a4b6674d4d8f43193dfd4f66eb899c9c2c9c8739 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 13 Apr 2018 15:05:46 +0200 Subject: [PATCH] Add date field --- pyrogram/client/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 6cff6670..a0cec4bc 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -154,6 +154,7 @@ class Client: self.dc_id = None self.auth_key = None self.user_id = None + self.date = None self.rnd_id = MsgId @@ -839,12 +840,14 @@ class Client: s = json.load(f) except FileNotFoundError: self.dc_id = 1 + self.date = int(time.time()) self.auth_key = Auth(self.dc_id, self.test_mode, self.proxy).create() else: self.dc_id = s["dc_id"] self.test_mode = s["test_mode"] self.auth_key = base64.b64decode("".join(s["auth_key"])) self.user_id = s["user_id"] + self.date = s.get("date", int(time.time())) def save_session(self): auth_key = base64.b64encode(self.auth_key).decode() @@ -857,6 +860,7 @@ class Client: test_mode=self.test_mode, auth_key=auth_key, user_id=self.user_id, + date=self.date ), f, indent=4