stop()

Client.stop()

Stop the Client.

This method disconnects the client from Telegram and stops the underlying tasks.

Returns

Client – The stopped client itself.

Raises

ConnectionError – In case you try to stop an already stopped client.

Example

from pyrogram import Client

app = Client("my_account")
app.start()

...  # Call API methods

app.stop()