Don't allow start() to be called more than once

This commit is contained in:
Dan 2018-04-03 11:45:19 +02:00
parent e69fea4bb5
commit 10452dc545

View File

@ -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]