我无法通过Telethon库或任何其他API删除个人资料照片
我在下面已经做过(使用telethon),但是没有用
from telethon import TelegramClient, sync
from telethon.tl.functions.photos import DeletePhotosRequest
api_id = "id"
api_hash = "hash"
client = TelegramClient("bot_5", api_id, api_hash)
client.start()
client(DeletePhotosRequest(client.get_profile_photos('me')))
我希望这段代码能删除我的个人资料照片
如何使用API删除它?
答案 0 :(得分:0)
这将为您服务
from telethon.sync import TelegramClient
from telethon.tl.functions.photos import DeletePhotosRequest
from telethon.tl.types import InputPhoto
with TelegramClient('your session', api_id, api_hash) as client:
p = client.get_profile_photos('me')[0]
client(DeletePhotosRequest(
id=[InputPhoto(
id=p.id,
access_hash=p.access_hash,
file_reference=p.file_reference
)]
))