import re, telethon
from telethon import TelegramClient
from telethon.tl.functions.messages import ImportChatInviteRequest
api_id = '' # https://my.telegram.org/apps
api_hash = ''
open('data.txt', 'a')
client = TelegramClient('session', api_id, api_hash)
client.start()
participants = client.get_participants('@') # Сюда юзер чата
user = re.findall(r"username='\S+", str(participants)) # ищем ники
phone = re.findall(r"phone='7\S+", str(participants)) # ищем номера
for data in user:
res=data
filter=res[9:]
f=open('data.txt', 'a')
f.write(f'{str(filter)}'+'\n')
for data in phone:
res=data
filter=res[6:]
f=open('data.txt', 'a')
f.write(f'{str(filter)}'+'\n')
print('Всё найдено!')
client.run_until_disconnected()
input()