Stop the Client.
This method disconnects the client from Telegram and stops the underlying tasks.
bool, optional) – Blocks the code execution until the client has been stopped. It is useful with
block=Falsein case you want to stop the own client within a handler in order not to cause a deadlock. Defaults to True.
Client– The stopped client itself.
ConnectionError – In case you try to stop an already stopped client.
from pyrogram import Client app = Client("my_account") app.start() ... # Call API methods app.stop()