mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-27 20:37:54 +00:00
Add get_user_dc method
This commit is contained in:
parent
09d012b696
commit
38de4299c5
@ -16,24 +16,24 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user