fix(seautils): fix a keyerror
Some checks failed
Actions / Build Documentation (MkDocs) (push) Successful in 25s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 38s

This commit is contained in:
Seaswimmer 2024-05-28 17:48:00 -04:00
parent 93f358cfad
commit aa7e347a95
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -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'))