Last active
December 22, 2020 14:18
-
-
Save x0x8x/141faa6dc1a43660abad96fce47f9e73 to your computer and use it in GitHub Desktop.
Will count all users messages of the specific group and print sorted out from most talked to none with an λ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group = 'telethonchat' | |
print( | |
( | |
( | |
lambda c: ( | |
lambda ts: "\n".join( | |
f"{t} messages from {u}" for t, u in sorted(ts, key=lambda t: -t[0]) | |
) | |
)( | |
( | |
client.get_messages(c, from_user=u).total, | |
f"{u.first_name}, {u.last_name}, {u.username or u.id}", | |
) | |
for u in client.iter_participants(c) | |
if not u.deleted | |
) | |
)(group) | |
).replace(" None,", "") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment