Skip to content

Instantly share code, notes, and snippets.

@Aero-Blue
Last active January 9, 2020 23:14
Show Gist options
  • Save Aero-Blue/ef0e67f239a3d2ee52e6e0bb28617392 to your computer and use it in GitHub Desktop.
Save Aero-Blue/ef0e67f239a3d2ee52e6e0bb28617392 to your computer and use it in GitHub Desktop.
Get usernames of all Telegram members in a group
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