This commit is contained in:
parent
ad92caca30
commit
6417e326a5
4
bot.py
4
bot.py
@ -359,7 +359,7 @@ async def checkForSSLExpiry():
|
|||||||
cert_obj = x509.load_pem_x509_certificate(cert.encode("utf-8"), default_backend())
|
cert_obj = x509.load_pem_x509_certificate(cert.encode("utf-8"), default_backend())
|
||||||
expiry_date = cert_obj.not_valid_after
|
expiry_date = cert_obj.not_valid_after
|
||||||
if expiry_date < datetime.datetime.now() + datetime.timedelta(days=7):
|
if expiry_date < datetime.datetime.now() + datetime.timedelta(days=7):
|
||||||
user = client.fetch_user(int(userid))
|
user = await client.get_user(int(userid))
|
||||||
if user:
|
if user:
|
||||||
await user.send(f"SSL certificate for {domain} expires soon")
|
await user.send(f"SSL certificate for {domain} expires soon")
|
||||||
print(f"SSL certificate for {domain} expires soon", flush=True)
|
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)
|
print(f"User {userid} not found", flush=True)
|
||||||
else:
|
else:
|
||||||
# Test by sending a message
|
# Test by sending a message
|
||||||
user = client.fetch_user(int(userid))
|
user = await client.get_user(int(userid))
|
||||||
if user:
|
if user:
|
||||||
await user.send(f"SSL certificate for {domain} is valid")
|
await user.send(f"SSL certificate for {domain} is valid")
|
||||||
print(f"SSL certificate for {domain} is valid", flush=True)
|
print(f"SSL certificate for {domain} is valid", flush=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user