Don't allow start() to be called more than once
This commit is contained in:
parent
e69fea4bb5
commit
10452dc545
@ -194,6 +194,9 @@ class Client:
|
||||
Raises:
|
||||
:class:`Error <pyrogram.Error>`
|
||||
"""
|
||||
if self.is_started:
|
||||
raise ConnectionError("Client has already been started")
|
||||
|
||||
if self.BOT_TOKEN_RE.match(self.session_name):
|
||||
self.token = self.session_name
|
||||
self.session_name = self.session_name.split(":")[0]
|
||||
|
Loading…
Reference in New Issue
Block a user