From aa7e347a95a7993e5fee8f4797ae8d78eabc8412 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Tue, 28 May 2024 17:48:00 -0400 Subject: [PATCH] fix(seautils): fix a keyerror --- seautils/seautils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seautils/seautils.py b/seautils/seautils.py index 6eaafa7..198a748 100644 --- a/seautils/seautils.py +++ b/seautils/seautils.py @@ -108,7 +108,6 @@ class SeaUtils(commands.Cog): if ctx.embed_requested(): embed = Embed( title="DNS Query Result", - description=f"Query for {response_data['QUESTION_SECTION'][0]}", color=await ctx.embed_color(), timestamp=message_data['response_time'] ) @@ -122,8 +121,9 @@ class SeaUtils(commands.Cog): question_section = "\n".join(response_data['QUESTION_SECTION']) embed.add_field(name="Question Section", value=f"```{question_section}```", inline=False) - answer_section = "\n".join(response_data['ANSWER_SECTION']) - embed.add_field(name="Answer Section", value=f"```{answer_section}```", inline=False) + if 'ANSWER_SECTION' in response_data: + answer_section = "\n".join(response_data['ANSWER_SECTION']) + embed.add_field(name="Answer Section", value=f"```{answer_section}```", inline=False) await ctx.send(embed=embed) else: await ctx.send(content=cf.box(text=stdout, lang='yaml'))