I have looked through stack overflow and found what I need – export of removed (banned) users from specific telegram chat (supergroup).
the number of removed/banned users around 5000.
I did this:
channel_id = -########
users = client.get_participants(client.get_input_entity(channel_id))
for user in users:
if user.deleted:
print(user)
and this:
from telethon.tl.types import ChannelParticipantsKicked
from telethon.sync import TelegramClient
api_id = #########
api_hash = '################################'
group_id = '-##############'
client = TelegramClient('apptitle', api_id, api_hash)
async def main():
await client.start()
kicked_members = await client.get_participants(group_id, filter=ChannelParticipantsKicked)
for member in kicked_members:
print(TipyWolf, 502264640)
with client:
client.loop.run_until_complete(main())
But what next? Where should I get a file? Where do I have to look at output of these actions?
I try to wait and looked at root folder and there is nothing really.
I’m expecting to get a file like csv or just massive of data so I could just copy it.
2
Answers
I run a find option in windows explorer to find a file kicked_members.txt but it found nothing :( What did i do wrong ?
No. Your code does not give you a file. And I cannot understand why that code wants to print
TipyWolf
a few thousand times.I assumed
member
is a string holding usernames, adjust the file.write() if its not. The file would be in the same directory of the python file.