From ae7d3e4d0592b686f99a43be69f956a9eb933156 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 1 Oct 2023 23:08:01 +1100 Subject: [PATCH] bot: Send user message if no ssl found --- bot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bot.py b/bot.py index a693df4..233e71c 100644 --- a/bot.py +++ b/bot.py @@ -334,6 +334,7 @@ async def checkForSSLExpiry(): for record in response: records.append(str(record)) if not records: + print(f"No A record found for {domain}", flush=True) continue # Get the first A record ip = records[0] @@ -366,6 +367,10 @@ async def checkForSSLExpiry(): if user: await user.send(f"SSL certificate for {domain} is valid") print(f"SSL certificate for {domain} is valid", flush=True) + else: + print(f"No certificate found for {domain}", flush=True) + await user.send(f"No certificate found for {domain}") + continue except Exception as e: print(e, flush=True) log(e)