From d0b549772554b07857f6e9f50451e28cce880068 Mon Sep 17 00:00:00 2001 From: sickprodigy Date: Mon, 17 Nov 2025 17:16:18 -0500 Subject: [PATCH] Add test_send script for debugging discord webhook functionality --- test_send.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test_send.py diff --git a/test_send.py b/test_send.py new file mode 100644 index 0000000..3688917 --- /dev/null +++ b/test_send.py @@ -0,0 +1,16 @@ +import ujson +# Reload discord module fresh and run the forced debug send once. +try: + # ensure we use latest module on device + import sys + if "scripts.discord_webhook" in sys.modules: + del sys.modules["scripts.discord_webhook"] + import scripts.discord_webhook as d + # load config.json to populate webhook URL + with open("config.json", "r") as f: + cfg = ujson.load(f) + d.set_config(cfg) + print("Running debug_force_send() — may trigger ENOMEM, run once only") + d.debug_force_send("memory test") +except Exception as e: + print("test_send error:", e) \ No newline at end of file