From 71025ab4a2a05898ddb29fb41844fb6d7e646600 Mon Sep 17 00:00:00 2001 From: Ryan Chen Date: Fri, 26 Sep 2025 10:37:00 -0400 Subject: [PATCH] I terrify myself --- main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 9847878..7f9799b 100644 --- a/main.py +++ b/main.py @@ -6,10 +6,10 @@ app = Flask(__name__) def populate_webhook_lookup(): lookup = {} - with open("./lookup.txt") as file: + with open("lookup.txt", "r") as file: for line in file: split_line = line.split(",") - lookup[split_line[0]]: split_line[1] + lookup[split_line[0]]= split_line[1] return lookup UUID_TO_WEBHOOK_LOOKUP = populate_webhook_lookup() @@ -48,9 +48,10 @@ def home(): @app.route("/hook/", methods=["POST"]) def convert(uuid): - webhook = UUID_TO_WEBHOOK_LOOKUP.get(uuid) + lookup = populate_webhook_lookup() + webhook = lookup.get(uuid) + print(lookup) ghost_payload = request.get_json() - print(ghost_payload) discord_payload = convert_ghost_to_discord(ghost_payload) httpx.post(webhook, data=discord_payload) @@ -61,6 +62,9 @@ def convert(uuid): def main(): print("Hello from webhookproxy!") + with open("lookup.txt", "r") as file: + for line in file: + print(line.split(',')) if __name__ == "__main__":