如何使用Telethon获取到用户照片的链接

问题描述

使用api是我的新手。我尝试使用方法GetUserPhotosRequest获取用户照片

def get_data(user):
    with TelegramClient('anon',api_id,api_hash) as client:
        result = client(functions.photos.GetUserPhotosRequest(
            user_id=user,offset=0,max_id=0,limit=0
        ))
        client.flood_sleep_threshold = 24 * 60 * 60 
        array_of_photos = result.photos
        for photo in array_of_photos:
            file_reference = photo.file_reference
            file_id = photo.id
            access_hash = photo.access_hash
            path = client.download_media(access_hash)
            return path

但是我的函数返回None。请帮我弄清楚

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)