fix(seautils): prevent duplicates in dig

This commit is contained in:
Seaswimmer 2024-05-28 19:10:15 -04:00
parent 8608e6a34e
commit cb6ddabb4d
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -135,13 +135,18 @@ class SeaUtils(commands.Cog):
response = m['message']['response_message_data'] response = m['message']['response_message_data']
if 'QUESTION_SECTION' in response: if 'QUESTION_SECTION' in response:
for question in response['QUESTION_SECTION']: for question in response['QUESTION_SECTION']:
questions.append(question) if question not in questions:
questions.append(question)
if 'ANSWER_SECTION' in response: if 'ANSWER_SECTION' in response:
for answer in response['ANSWER_SECTION']: for answer in response['ANSWER_SECTION']:
answers.append(answer) if answer not in answers:
answers.append(answer)
if 'AUTHORITY_SECTION' in response: if 'AUTHORITY_SECTION' in response:
for authority in response['AUTHORITY_SECTION']: for authority in response['AUTHORITY_SECTION']:
authorities.append(authority) if authority not in authorities:
authorities.append(authority)
question_section = "\n".join(questions) question_section = "\n".join(questions)
embed.add_field(name="Question Section", value=f"{cf.box(question_section)}", inline=False) embed.add_field(name="Question Section", value=f"{cf.box(question_section)}", inline=False)