def login(self): """ Login to tinychat. :return: True if logged in, else False. :rtype: bool """ account = acc.Account(account=self.account, password=self.password) if self.account and self.password: if account.is_logged_in(): return True account.login() return account.is_logged_in()
async def login(self): """ Login to tinychat. :return: True if logged in, else False. :rtype: bool """ # TODO this can handle errors better account = acc.Account(account=self.account, password=self.password) if self.account and self.password: if await account.is_logged_in(): return True await account.login() return await account.is_logged_in()