fix(seautils): prevent duplicates in dig
This commit is contained in:
parent
8608e6a34e
commit
cb6ddabb4d
1 changed files with 8 additions and 3 deletions
|
@ -135,12 +135,17 @@ 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']:
|
||||||
|
if question not in questions:
|
||||||
questions.append(question)
|
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']:
|
||||||
|
if answer not in answers:
|
||||||
answers.append(answer)
|
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']:
|
||||||
|
if authority not in authorities:
|
||||||
authorities.append(authority)
|
authorities.append(authority)
|
||||||
|
|
||||||
question_section = "\n".join(questions)
|
question_section = "\n".join(questions)
|
||||||
|
|
Loading…
Reference in a new issue