mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 14:25:55 +00:00
Don't try to stop a non-started Client
This commit is contained in:
@@ -245,6 +245,9 @@ class Client:
|
|||||||
"""Use this method to manually stop the Client.
|
"""Use this method to manually stop the Client.
|
||||||
Requires no parameters.
|
Requires no parameters.
|
||||||
"""
|
"""
|
||||||
|
if not self.is_started:
|
||||||
|
raise ConnectionError("Client is already stopped")
|
||||||
|
|
||||||
self.is_started = False
|
self.is_started = False
|
||||||
self.session.stop()
|
self.session.stop()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user