Repository: alexander-akhmetov/python-telegram

Issue:
[FeatureRequest] Add getUserFullInfo() support
In the TDLIB update event, there is only the 'sender_user_id' field and no other user identification. Currently, there is no way to get first and last names using python-telegram.
As far as I know, to get that information the client should use getUserFullInfo() method. Please, add it.

Discussion:

Patch:
diff --git a/telegram/client.py b/telegram/client.py
index 9744d32..5a1ea27 100644
--- a/telegram/client.py
+++ b/telegram/client.py
@@ -227,6 +227,15 @@ class Telegram:
 
         return self.call_method('getUser', params={'user_id': user_id})
 
+    def get_user_full_info(self, user_id: int) -> AsyncResult:
+        """
+        Requests the full information about a user with id = user_id.
+
+        https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1get_user_full_info.html
+        """
+
+        return self.call_method('getUserFullInfo', params={'user_id': user_id})
+
     def get_chats(self, offset_order: int = 0, offset_chat_id: int = 0, limit: int = 100) -> AsyncResult:
         """
         Returns a list of chats:


Test patch:
diff --git a/tests/requirements.txt b/tests/requirements.txt
index 5f70074..a053c78 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -1,6 +1,6 @@
-pytest==6.2.3
+pytest==6.2.2
 flake8==3.9.0
-pylint==2.7.4
+pylint==2.7.2
 ipdb==0.13.7
 mypy==0.812
 black==20.8b1
diff --git a/tests/test_telegram_methods.py b/tests/test_telegram_methods.py
index 80e7954..e5d7229 100644
--- a/tests/test_telegram_methods.py
+++ b/tests/test_telegram_methods.py
@@ -201,6 +201,32 @@ class TestTelegram:
 
         telegram._tdjson.send.assert_called_once_with(exp_data)
 
+    def test_get_user(self, telegram):
+        user_id = 1
+
+        async_result = telegram.get_user(user_id=user_id)
+
+        exp_data = {
+            '@type': 'getUser',
+            'user_id': user_id,
+            '@extra': {'request_id': async_result.id},
+        }
+
+        telegram._tdjson.send.assert_called_once_with(exp_data)
+
+    def test_get_user_full_info(self, telegram):
+        user_id = 1
+
+        async_result = telegram.get_user_full_info(user_id=user_id)
+
+        exp_data = {
+            '@type': 'getUserFullInfo',
+            'user_id': user_id,
+            '@extra': {'request_id': async_result.id},
+        }
+
+        telegram._tdjson.send.assert_called_once_with(exp_data)
+
     def test_get_chat(self, telegram):
         chat_id = 1