From a88376555db4f65c1113b74e35dd9a68d99147aa Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 27 Sep 2023 18:14:34 +1000 Subject: [PATCH] bot: Catch more dig errors --- bot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 89a4583..079bb65 100644 --- a/bot.py +++ b/bot.py @@ -141,6 +141,7 @@ async def ssl(ctx, domain: str): await ctx.response.send_message("Please provide a valid domain to check") return + ctx.response.send_message(f"Checking SSL certificate for {domain}...") message = "" resolver = dns.resolver.Resolver() resolver.nameservers = ["100.74.29.146"] @@ -156,7 +157,7 @@ async def ssl(ctx, domain: str): if not records: - await ctx.response.send_message(f"No A record found for {domain}") + await ctx.channel.send(f"No A record found for {domain}") return # Get the first A record @@ -230,16 +231,16 @@ async def ssl(ctx, domain: str): message2 = message[len(message1):] - await ctx.response.send_message(message1) + await ctx.channel.send(message1) await ctx.channel.send(message2) else: - await ctx.response.send_message(message) + await ctx.channel.send(message) # Catch all exceptions except Exception as e: - await ctx.response.send_message(f"An error occurred: {e}") + await ctx.channel.send(f"An error occurred: {e}") @tree.command(name="invite", description="Invite me to your server")