diff --git a/bot.py b/bot.py index e211c68..057a5ff 100644 --- a/bot.py +++ b/bot.py @@ -131,7 +131,7 @@ async def curl(ctx, url: str): await ctx.response.send_message(f"An error occurred: {e}") @tree.command(name="ssl", description="Check SSL certificate") -async def ssl(ctx, domain: str): +async def ssl(ctx, domain: str, showcert: bool = False): # Verify that the domain is valid if not domain: await ctx.response.send_message("Please provide a domain to check") @@ -184,7 +184,8 @@ async def ssl(ctx, domain: str): if certificates: cert = certificates[0] - message = message + "\n## Website Certificate:\n```\n" + cert + "\n```\n" + if showcert: + message = message + "\n## Website Certificate:\n```\n" + cert + "\n```\n" with tempfile.NamedTemporaryFile(mode="w", delete=False) as temp_cert_file: temp_cert_file.write(cert)