From 31c0b0a4e81fbd354e6bff3dee846ea5a27ac06d Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 1 Oct 2023 23:28:11 +1100 Subject: [PATCH] bot: Disable DM for valid ssl cert --- bot.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bot.py b/bot.py index 41dc492..641f15d 100644 --- a/bot.py +++ b/bot.py @@ -364,22 +364,14 @@ async def checkForSSLExpiry(): await user.send(f"SSL certificate for {domain} expires soon") print(f"SSL certificate for {domain} expires soon", flush=True) else: - print(f"User {userid} not found", flush=True) - else: - # Test by sending a message - user = await client.fetch_user(int(userid)) - 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"User {userid} not found", flush=True) + await log(f"User {userid} not found") 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) + await log(e) continue print("SSL check complete", flush=True)