Less verbose /check command

This commit is contained in:
Casey 2024-11-15 11:32:30 +03:00
parent 7382c1748b
commit af4545b583
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 5 additions and 2 deletions

View File

@ -41,9 +41,12 @@ async def on_check(message: Message):
data = (await client.get(entity.url)).text data = (await client.get(entity.url)).text
total_score = 0 total_score = 0
results.append(f"<b>{sanitize_link(entity.url)}</b>") results.append(f"<b>{sanitize_link(entity.url)}</b>")
for score, explanation, match in explain_verification(data): counts = {}
results.append(f"{match.span()}: {explanation}") for score, explanation, _ in explain_verification(data):
counts[explanation] = counts.get(explanation, 0) + 1
total_score += score total_score += score
for explanation, count in counts.items():
results.append(f"<i>{explanation}</i>: <b>x{count}</b>")
results.append(f"<b>Total score: {total_score}</b>") results.append(f"<b>Total score: {total_score}</b>")
results.append("") results.append("")
if results: if results: