run()¶
-
Client.run()¶ Start the client, idle the main script and finally stop the client.
This is a convenience method that calls
start(),idle()andstop()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, sinceidle()will block after starting the own client.- Raises
ConnectionError – In case you try to run an already started client.
Example
from pyrogram import Client app = Client("my_account") ... # Set handlers up app.run()