bot: Trim certs
All checks were successful
Build Docker / Build Docker (push) Successful in 16s

This commit is contained in:
Nathan Woodburn 2023-09-27 17:38:56 +10:00
parent b7819f6f98
commit d3c82b6c05
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

3
bot.py
View File

@ -175,6 +175,9 @@ async def ssl(ctx, domain: str):
certificates.append(current_cert) certificates.append(current_cert)
current_cert = "" current_cert = ""
# Remove anything before -----BEGIN CERTIFICATE-----
certificates = [cert[cert.find("-----BEGIN CERTIFICATE-----"):] for cert in certificates]
if certificates: if certificates:
cert = certificates[0] cert = certificates[0]
message = message + "\n## Website Certificate:\n`" + cert + "`\n" message = message + "\n## Website Certificate:\n`" + cert + "`\n"