bot: Disable DM for valid ssl cert
All checks were successful
Build Docker / Build Docker (push) Successful in 16s
All checks were successful
Build Docker / Build Docker (push) Successful in 16s
This commit is contained in:
parent
d89c051374
commit
31c0b0a4e8
12
bot.py
12
bot.py
@ -364,22 +364,14 @@ async def checkForSSLExpiry():
|
|||||||
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)
|
||||||
else:
|
else:
|
||||||
print(f"User {userid} not found", flush=True)
|
await log(f"User {userid} not found")
|
||||||
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)
|
|
||||||
else:
|
else:
|
||||||
print(f"No certificate found for {domain}", flush=True)
|
print(f"No certificate found for {domain}", flush=True)
|
||||||
await user.send(f"No certificate found for {domain}")
|
await user.send(f"No certificate found for {domain}")
|
||||||
continue
|
continue
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e, flush=True)
|
print(e, flush=True)
|
||||||
log(e)
|
await log(e)
|
||||||
continue
|
continue
|
||||||
print("SSL check complete", flush=True)
|
print("SSL check complete", flush=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user