From 38de4299c511046b866abd0b32d2db5c9575a16c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 29 May 2019 09:43:48 +0200 Subject: [PATCH] Add get_user_dc method --- pyrogram/client/methods/users/__init__.py | 16 ++++++++-------- pyrogram/client/methods/users/get_user_dc.py | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyrogram/client/methods/users/__init__.py b/pyrogram/client/methods/users/__init__.py index a33a0f0c..bbc2df23 100644 --- a/pyrogram/client/methods/users/__init__.py +++ b/pyrogram/client/methods/users/__init__.py @@ -16,24 +16,24 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from .delete_user_profile_photos import DeleteUserProfilePhotos +from .delete_photos import DeletePhotos from .get_me import GetMe from .get_user_dc import GetUserDC -from .get_user_profile_photos import GetUserProfilePhotos -from .get_user_profile_photos_count import GetUserProfilePhotosCount +from .get_user_photos import GetUserPhotos +from .get_user_photos_count import GetUserPhotosCount from .get_users import GetUsers -from .set_user_profile_photo import SetUserProfilePhoto +from .set_photo import SetPhoto from .update_username import UpdateUsername class Users( - GetUserProfilePhotos, - SetUserProfilePhoto, - DeleteUserProfilePhotos, + GetUserPhotos, + SetPhoto, + DeletePhotos, GetUsers, GetMe, UpdateUsername, - GetUserProfilePhotosCount, + GetUserPhotosCount, GetUserDC ): pass diff --git a/pyrogram/client/methods/users/get_user_dc.py b/pyrogram/client/methods/users/get_user_dc.py index 27631e95..49596c11 100644 --- a/pyrogram/client/methods/users/get_user_dc.py +++ b/pyrogram/client/methods/users/get_user_dc.py @@ -46,7 +46,7 @@ class GetUserDC(BaseClient): r = r[0] if r.photo: - if isinstance(r.photo.photo_small, types.FileLocation): - return r.photo.photo_small.dc_id + if isinstance(r.photo, types.UserProfilePhoto): + return r.photo.dc_id return None