With telethon
you can do pretty much anything you want around Telegram. However, I cannot find a way to get a list of removed (banned) users in a group/channel. Any ideas?
For the record, you can do that via Telegram’s GUI by going to Edit > Permissions > Removed Users
.
2
Answers
In order to get a list of all the removed users in a Telegram group/channel using Telethon you need to use
get_participants()
withfilter
parameter set toChannelParticipantsKicked
.If you’d prefer to loop over the result without assign it to a variable you can use
iter_participants()
instead.NR: here is a list of all the avaible
filters
usable withget/iter_participants()
.