RuslanUC / RemoteAuthClient

Async remote auth client for discord (Login with qr code)
MIT License
19 stars 4 forks source link

Attributerror: self-_heartbeatTask has no attribute cancel() #10

Closed FuckingToasters closed 1 year ago

FuckingToasters commented 1 year ago

Hello, a few weeks ago this code have worked fine, i don't think i changed anything on my side. This error happen when the QR Code should be generated. Seems like self-_heartbeatTask is somehow defined with None.

Anyone may got a solution for this issue?

class RemoteAuthClient:
    def __init__(self):
        self.initCrypto()
        self._heartbeatTask = None
        self.on_fingerprint = self.ev
        self.on_userdata = self.ev
        self.on_token = self.ev
        self.on_cancel = self.ev
        self.on_timeout = self.ev

if p["op"] == "hello":
    await self.send({"op": "init", "encoded_public_key": self.publicKeyString}, ws)
    self._heartbeatTask = asyncio.get_event_loop().create_task(self.sendHeartbeat(p["heartbeat_interval"], ws))

self._heartbeatTask.cancel()
RuslanUC commented 1 year ago

Update remoteauthclient to latest version (1.4.0b3)

FuckingToasters commented 1 year ago

Update remoteauthclient to latest version (1.4.0b3)

changed nothing... i even tried to install direclty from this github page by using pip install -U git+"https://github.com/RuslanUC/RemoteAuthClient"

RuslanUC commented 1 year ago

Are you importing the remoteauthclient class or do you have the RemoteAuthClient (and User) class in your code?

FuckingToasters commented 1 year ago

Are you importing the remoteauthclient class or do you have the RemoteAuthClient (and User) class in your code?

It's in the code i guess

RuslanUC commented 1 year ago

Remove RemoteAuthClient and User classes from code and add import (from remoteauthclient import RemoteAuthClient)

FuckingToasters commented 1 year ago

Issue solved after uninstalling remoteauthclient and installing again with a new version specified remoteauthclient==1.4.0b3