Stop creating connections for unauthenticated users at startup

This commit is contained in:
Tulir Asokan
2018-06-25 21:30:54 +03:00
parent 0f8a2e7c51
commit 371c6813de
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -59,8 +59,8 @@ class Bot(AbstractUser):
if isinstance(id, int):
self.tg_whitelist.append(id)
async def start(self):
await super().start()
async def start(self, delete_unless_authenticated=False):
await super().start(delete_unless_authenticated)
if not await self.is_logged_in():
await self.client.sign_in(bot_token=self.token)
await self.post_login()