Last active
January 9, 2020 23:14
-
-
Save Aero-Blue/ef0e67f239a3d2ee52e6e0bb28617392 to your computer and use it in GitHub Desktop.
Get usernames of all Telegram members in a group
This file contains 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
with TelegramClient(PHONE_NUMBER, API_ID, API_HASH) as client: | |
users = client.get_participants(input("Group Name: ")) # Get all members of a group | |
user_list = [user.username for user in users if user.username is not None] | |
print(user_list) # Print a list of members |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment