From dfc8d00adb0c30202c22ba319e935ad74d2205bf Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 8 Apr 2018 12:44:27 +0200 Subject: [PATCH 1/2] Allow passing api_id as string --- pyrogram/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 31b4b895..4581371d 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -132,7 +132,7 @@ class Client: def __init__(self, session_name: str, - api_id: int = None, + api_id: int or str = None, api_hash: str = None, proxy: dict or Proxy = None, test_mode: bool = False, @@ -144,7 +144,7 @@ class Client: last_name: str = None, workers: int = 4): self.session_name = session_name - self.api_id = api_id + self.api_id = int(api_id) self.api_hash = api_hash self.proxy = proxy self.test_mode = test_mode From 26a41ec00e650c7bc476a8ca22c541c15faf960b Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 8 Apr 2018 12:46:02 +0200 Subject: [PATCH 2/2] Allow returning sms codes as int from the callback function --- pyrogram/client/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 4581371d..ca3fb1e0 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -370,7 +370,7 @@ class Client: self.phone_code = ( input("Enter phone code: ") if self.phone_code is None else self.phone_code if type(self.phone_code) is str - else self.phone_code() + else str(self.phone_code()) ) try: