From c67a9149703428e19c3cdea11e7cd01a39dafd2a Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 1 Oct 2023 23:14:37 +1100 Subject: [PATCH] bot: Check for user existance --- bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot.py b/bot.py index 74f9c90..08d8c79 100644 --- a/bot.py +++ b/bot.py @@ -363,12 +363,16 @@ async def checkForSSLExpiry(): if user: 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 = client.get_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) else: print(f"No certificate found for {domain}", flush=True) await user.send(f"No certificate found for {domain}")