Less verbose /check command
This commit is contained in:
parent
7382c1748b
commit
af4545b583
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue