bot: Send user message if no ssl found
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
b5df6efead
commit
ae7d3e4d05
5
bot.py
5
bot.py
@ -334,6 +334,7 @@ async def checkForSSLExpiry():
|
|||||||
for record in response:
|
for record in response:
|
||||||
records.append(str(record))
|
records.append(str(record))
|
||||||
if not records:
|
if not records:
|
||||||
|
print(f"No A record found for {domain}", flush=True)
|
||||||
continue
|
continue
|
||||||
# Get the first A record
|
# Get the first A record
|
||||||
ip = records[0]
|
ip = records[0]
|
||||||
@ -366,6 +367,10 @@ async def checkForSSLExpiry():
|
|||||||
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)
|
||||||
|
else:
|
||||||
|
print(f"No certificate found for {domain}", flush=True)
|
||||||
|
await user.send(f"No certificate found for {domain}")
|
||||||
|
continue
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e, flush=True)
|
print(e, flush=True)
|
||||||
log(e)
|
log(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user