From 6e3dbbde5a8f2d90096e5e4890b66901ebd6f6e3 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 24 Apr 2022 21:20:13 +0200 Subject: [PATCH] Allow passing the api_id as string --- pyrogram/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client.py b/pyrogram/client.py index b0c493d5..2bc1dbfd 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -192,7 +192,7 @@ class Client(Methods): def __init__( self, name: str, - api_id: int = None, + api_id: Union[int, str] = None, api_hash: str = None, app_version: str = APP_VERSION, device_model: str = DEVICE_MODEL, @@ -219,7 +219,7 @@ class Client(Methods): super().__init__() self.name = name - self.api_id = api_id + self.api_id = int(api_id) if api_id else None self.api_hash = api_hash self.app_version = app_version self.device_model = device_model