Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main.py
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -19,5 +19,8 @@
|
|||||||
"terminal.integrated.hideOnStartup": "always",
|
"terminal.integrated.hideOnStartup": "always",
|
||||||
"[jsonc]": {
|
"[jsonc]": {
|
||||||
"editor.defaultFormatter": "vscode.json-language-features"
|
"editor.defaultFormatter": "vscode.json-language-features"
|
||||||
|
},
|
||||||
|
"files.exclude": {
|
||||||
|
"**/__pycache__": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ class CheckDiscord:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def isdiscordrunning() -> bool:
|
def isdiscordrunning() -> bool:
|
||||||
for process in psutil.process_iter(["name"]):
|
for process in psutil.process_iter(["name"]):
|
||||||
if process.info["name"].lower() == "discord.exe":
|
if (process.info["name"].lower() == "discord.exe" or
|
||||||
|
process.info["name"].lower() == "discordcanary.exe" or
|
||||||
|
process.info["name"].lower() == "discord" or
|
||||||
|
process.info["name"].lower() == "discord canary"):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -23,6 +26,7 @@ class CheckDiscord:
|
|||||||
def isuserconnected(clientid: str) -> bool:
|
def isuserconnected(clientid: str) -> bool:
|
||||||
rpc = Presence(clientid)
|
rpc = Presence(clientid)
|
||||||
try:
|
try:
|
||||||
|
rpc.connect()
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user