Код: Выделить всё
client = TelegramClient(username, api_id, api_hash)
async def dump_all_participants(channel) -> list:
offset_user = 0
limit_user = 100
all_participants = []
filter_user = ChannelParticipantsSearch('')
while True:
participants = await client(GetParticipantsRequest(channel,
filter_user, offset_user, limit_user, hash=0))
if not participants.users:
break
all_participants.extend(participants.users)
offset_user += len(participants.users)
all_users_details = []
for participant in all_participants:
if participant.photo is None:
photo = UNKNOWN.STRING
else:
photo = participant.photo
all_users_details.append({participant.id: [participant.username, photo]})
return all_users_details
выходное фото: UserProfilePhoto(photo_id=208135253786732667, photo_small=FileLocationToBeDeprecated(volume_id=257125342, local_id=230348), photo_big=FileLocationToBeDeprecated(volume_id=257125342, local_id=230350), dc_id=2, has_video=False)
Я нашел InputPhoto в документации InputPhoto и надеюсь, что он мне поможет, но в документации нет примеров использования, и я не могу понять, как его реализовать. Может кто-нибудь помочь подсказкой или примером, как вытащить оттуда фото?
Подробнее здесь: https://stackoverflow.com/questions/636 ... n-telethon
Мобильная версия