2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

Allow passing api_id as string

This commit is contained in:
Dan 2018-04-08 12:44:27 +02:00
parent 73fbe60057
commit dfc8d00adb

View File

@ -132,7 +132,7 @@ class Client:
def __init__(self, def __init__(self,
session_name: str, session_name: str,
api_id: int = None, api_id: int or str = None,
api_hash: str = None, api_hash: str = None,
proxy: dict or Proxy = None, proxy: dict or Proxy = None,
test_mode: bool = False, test_mode: bool = False,
@ -144,7 +144,7 @@ class Client:
last_name: str = None, last_name: str = None,
workers: int = 4): workers: int = 4):
self.session_name = session_name self.session_name = session_name
self.api_id = api_id self.api_id = int(api_id)
self.api_hash = api_hash self.api_hash = api_hash
self.proxy = proxy self.proxy = proxy
self.test_mode = test_mode self.test_mode = test_mode