From 47743be6473a9ac905c190aec2c1259e55accb50 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 1 Oct 2023 22:47:23 +1100 Subject: [PATCH] bot: Test ssl check --- bot.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 81e1656..814ad85 100644 --- a/bot.py +++ b/bot.py @@ -359,8 +359,17 @@ def checkForSSLExpiry(): user = client.get_user(int(userid)) if user: user.send(f"SSL certificate for {domain} expires soon") - except: + else: + # Test by sending a message + user = client.get_user(int(userid)) + if user: + user.send(f"SSL certificate for {domain} is valid") + except Exception as e: + print(e, flush=True) continue + print("SSL check complete", flush=True) + + @tree.command(name="ssldomains", description="List domains with SSL certificates") async def ssldomains(ctx):