From 8a40d9d10295799388b267b41a5d9f133a76b6a7 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Wed, 28 Feb 2024 04:27:00 -0600 Subject: [PATCH] Mods --- main.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index ac19ce2..7887486 100644 --- a/main.py +++ b/main.py @@ -95,8 +95,26 @@ def string_to_number(input_string): return scaled_number +def clean_string(string): + return string.replace(""", '"') + + +def escape_quotes(string): + return string.replace('"', '\\"') + + +def remove_char(string, char): + return string.replace(char, "") + + +def clean_gifmaker(arg): + arg = clean_string(arg) + arg = remove_char(arg, ";") + return arg + + def join_command(command): - return " ".join(f"\"{arg}\"" for arg in command) + return " ".join(f'"{arg}"' for arg in command) def gifmaker_command(args): @@ -181,12 +199,14 @@ async def on_message(ws, message): if len(args) >= 1: update_time() arg = " ".join(clean_list(args)) + arg = clean_gifmaker(arg) await gif_describe(arg, room_id) elif cmd == "wins" or cmd == "win": if len(args) >= 1: update_time() arg = " ".join(clean_list(args)) + arg = clean_gifmaker(arg) await gif_wins(arg, room_id) elif cmd == "numbers" or cmd == "number" or cmd == "nums" or cmd == "num": @@ -197,6 +217,7 @@ async def on_message(ws, message): else: arg = None + arg = clean_gifmaker(arg) await gif_numbers(arg, room_id) elif cmd == "date" or cmd == "data" or cmd == "time" or cmd == "datetime":