summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-08-30 01:27:02 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-08-30 01:27:02 +0800
commit1b496addee65b770691d09ba924fb662427213f8 (patch)
treec119635e3e0c2b813860ef8a6b1861a07f0724c8 /main.py
parentd86e13b183d1724f0931a7320b07333c5fefebf1 (diff)
update fix
Diffstat (limited to 'main.py')
-rw-r--r--main.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/main.py b/main.py
index c80d9e7..861a9b4 100644
--- a/main.py
+++ b/main.py
@@ -167,6 +167,24 @@ while True:
except KeyboardInterrupt:
continue
continue
+ elif localcmd[1] == 'lock' or localcmd[1] == 'lockscreen':
+ if ossystem('osascript -e \'tell application "System Events" to keystroke "q" using {command down, control down}\'') == 0:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```computer going to lockscreen, cya...```")
+ old_command = command
+ except:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start lockingscreen```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start lockingscreen```")
+ except KeyboardInterrupt:
+ continue
+ continue
+
except:
continue
@@ -198,7 +216,7 @@ while True:
continue
elif localcmd[1] == 'notify' or localcmd[1] == 'notification':
if localcmd[4>len(localcmd)]:
- if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'"):
+ if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'") == 0:
try:
post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Notified successfully```")
old_command = command
@@ -248,7 +266,7 @@ while True:
continue
elif localcmd[1] == 'quit' or localcmd[1] == 'close':
if localcmd[2<len(localcmd)]:
- if ossystem(f'sudo osascript -e \'tell app "{localcmd[2]}" to quit\'') == 0:
+ if ossystem(f'osascript -e \'tell app "{localcmd[2]}" to quit\'') == 0:
try:
post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Successfully quitted {localcmd[2]}```")
old_command = command
@@ -265,7 +283,7 @@ while True:
-
+ continue
except:
try: