2
0
mirror of https://github.com/LonamiWebs/Telethon synced 2025-09-01 06:45:50 +00:00

Added ability to download media

Now you can also download any message media,
exactly the same way you can upload any media
This commit is contained in:
Lonami
2016-09-11 16:24:03 +02:00
parent 7e78b1b6dc
commit 1293d3be1c
2 changed files with 62 additions and 15 deletions

View File

@@ -78,8 +78,7 @@ if __name__ == '__main__':
# and print them in "[hh:mm] Sender: Message" text format
for msg, sender in zip(reversed(messages), reversed(senders)):
name = sender.first_name if sender else '???'
date = datetime.fromtimestamp(msg.date)
print('[{}:{}] {}: {}'.format(date.hour, date.minute, name, msg.message))
print('[{}:{}] {}: {}'.format(msg.date.hour, msg.date.minute, name, msg.message))
# Send photo
elif msg.startswith('!p '):