14 lines
383 B
Python
14 lines
383 B
Python
|
#!/usr/bin/python3
|
||
|
from telethon.sync import TelegramClient
|
||
|
from config import *
|
||
|
|
||
|
from telethon.tl.types import User
|
||
|
|
||
|
with TelegramClient('telelog', api_id, api_hash) as client:
|
||
|
for dialog in client.iter_dialogs():
|
||
|
entity = dialog.entity
|
||
|
if isinstance(entity, User):
|
||
|
f = open(f'logs/{dialog.id}', "a")
|
||
|
f.write("Message history for " + str(dialog.id) + ":\n")
|
||
|
f.close()
|