Fix text in poll bridging

This commit is contained in:
Tulir Asokan
2025-03-09 13:07:29 +02:00
parent caefda582b
commit 88c3a93526
@@ -763,18 +763,18 @@ class TelegramMessageConverter:
_n += 1
return _n
text_answers = "\n".join(f"{n()}. {answer.text}" for answer in poll.answers)
html_answers = "\n".join(f"<li>{answer.text}</li>" for answer in poll.answers)
text_answers = "\n".join(f"{n()}. {answer.text.text}" for answer in poll.answers)
html_answers = "\n".join(f"<li>{answer.text.text}</li>" for answer in poll.answers)
vote_command = f"{self.command_prefix} vote {poll_id}"
content = TextMessageEventContent(
msgtype=MessageType.TEXT,
format=Format.HTML,
body=(
f"Poll: {poll.question}\n{text_answers}\n"
f"Poll: {poll.question.text}\n{text_answers}\n"
f"Vote with {vote_command} <choice number>"
),
formatted_body=(
f"<strong>Poll</strong>: {poll.question}<br/>\n"
f"<strong>Poll</strong>: {poll.question.text}<br/>\n"
f"<ol>{html_answers}</ol>\n"
f"Vote with <code>{vote_command} &lt;choice number&gt;</code>"
),