mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Don't allow start() to be called more than once
This commit is contained in:
parent
e69fea4bb5
commit
10452dc545
1 changed files with 3 additions and 0 deletions
|
|
@ -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 a new issue