From d89c051374955f08413759f3138b42f517f3059b Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 1 Oct 2023 23:22:45 +1100 Subject: [PATCH] bot: Try await with fetch --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 3d64ac3..41dc492 100644 --- a/bot.py +++ b/bot.py @@ -359,7 +359,7 @@ async def checkForSSLExpiry(): cert_obj = x509.load_pem_x509_certificate(cert.encode("utf-8"), default_backend()) expiry_date = cert_obj.not_valid_after if expiry_date < datetime.datetime.now() + datetime.timedelta(days=7): - user = await client.get_user(int(userid)) + user = await client.fetch_user(int(userid)) if user: await user.send(f"SSL certificate for {domain} expires soon") print(f"SSL certificate for {domain} expires soon", flush=True) @@ -367,7 +367,7 @@ async def checkForSSLExpiry(): print(f"User {userid} not found", flush=True) else: # Test by sending a message - user = await client.get_user(int(userid)) + 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)