From cb6ddabb4dfe506d959386d27762131cfbf23456 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Tue, 28 May 2024 19:10:15 -0400 Subject: [PATCH] fix(seautils): prevent duplicates in dig --- seautils/seautils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/seautils/seautils.py b/seautils/seautils.py index 2d44336..dedb4e3 100644 --- a/seautils/seautils.py +++ b/seautils/seautils.py @@ -135,13 +135,18 @@ class SeaUtils(commands.Cog): response = m['message']['response_message_data'] if 'QUESTION_SECTION' in response: for question in response['QUESTION_SECTION']: - questions.append(question) + if question not in questions: + questions.append(question) + if 'ANSWER_SECTION' in response: for answer in response['ANSWER_SECTION']: - answers.append(answer) + if answer not in answers: + answers.append(answer) + if 'AUTHORITY_SECTION' in response: for authority in response['AUTHORITY_SECTION']: - authorities.append(authority) + if authority not in authorities: + authorities.append(authority) question_section = "\n".join(questions) embed.add_field(name="Question Section", value=f"{cf.box(question_section)}", inline=False)