get_chat_members

This example shows how to get all the members of a chat.

import asyncio
from pyrogram import Client

# Target channel/supergroup
TARGET = -100123456789


async def main():
    app = Client("my_account")

    async with app:
        async for member in app.get_chat_members(TARGET):
            print(member)


asyncio.run(main())