Get the members list of a chat.
A chat can be either a basic group, a supergroup or a channel. Requires administrator rights in channels.Usable by Users Bots
str) – Unique identifier (int) or username (str) of the target chat.
str, optional) – Query string to filter members based on their display names and usernames. Only applicable to supergroups and channels. Defaults to “” (empty string). A query string is applicable only for
int, optional) – Limits the number of members to be retrieved.
ChatMembersFilter, optional) – Filter used to select the kind of members you want to retrieve. Only applicable for supergroups and channels.
Generator– On success, a generator yielding
ChatMemberobjects is returned.
from pyrogram import enums # Get members async for member in app.get_chat_members(chat_id): print(member) # Get administrators administrators =  async for m in app.get_chat_members(chat_id, filter=enums.ChatMembersFilter.ADMINISTRATORS): administrators.append(m) # Get bots bots =  async for m in app.get_chat_members(chat_id, filter=enums.ChatMembersFilter.BOTS): bots.append(m)