Start the client, idle the main script and finally stop the client.
This is a convenience method that calls
stop()in sequence. It makes running a client less verbose, but is not suitable in case you want to run more than one client in a single main script, since idle() will block after starting the own client.
ConnectionError – In case you try to run an already started client.
from pyrogram import Client app = Client("my_account") ... # Set handlers up app.run()