Fix discord user is connected with pypresence
This commit is contained in:
@@ -3,6 +3,7 @@ import psutil
|
||||
from pypresence import Presence
|
||||
from tools.get_server_token import GetServerTokenForDiscord
|
||||
from tools.constants import Urls
|
||||
from tools.discord_oauth import CLIENT_ID
|
||||
|
||||
class DiscordToken:
|
||||
@staticmethod
|
||||
@@ -23,15 +24,15 @@ class CheckDiscord:
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def isuserconnected(clientid: str) -> bool:
|
||||
rpc = Presence(clientid)
|
||||
def isuserconnected() -> bool:
|
||||
rpc = Presence(CLIENT_ID)
|
||||
try:
|
||||
rpc.connect()
|
||||
return True
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
return False
|
||||
finally:
|
||||
try:
|
||||
rpc.close()
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user