compose()#

pyrogram.compose()#

Run multiple clients at once.

This method can be used to run multiple clients at once and can be found directly in the pyrogram package.

If you want to run a single client, you can use Client’s bound method run().

Parameters:
  • clients (List of Client) – A list of client objects to run.

  • sequential (bool, optional) – Pass True to run clients sequentially. Defaults to False (run clients concurrently)

Example

import asyncio
from pyrogram import Client, compose


async def main():
    apps = [
        Client("account1"),
        Client("account2"),
        Client("account3")
    ]

    ...

    await compose(apps)


asyncio.run(main())