fix: always use MarkdownV2 for all message types
This commit is contained in:
@@ -23,17 +23,13 @@ def send_summary(tg_cfg: TelegramConfig, chat_id: str, summary_text: str,
|
||||
original_reply_to: str = "", account_email: str = "") -> int:
|
||||
can_reply = summary_data.get("can_reply", True)
|
||||
is_promotion = summary_data.get("category") == "promotion"
|
||||
is_verification = summary_data.get("category") == "notification" and summary_data.get("verification_code")
|
||||
plain_text = is_promotion or is_verification
|
||||
links = summary_data.get("links", [])
|
||||
msg_payload = {
|
||||
result = _tg_req(tg_cfg, "sendMessage", {
|
||||
"chat_id": chat_id,
|
||||
"text": summary_text,
|
||||
"parse_mode": "MarkdownV2",
|
||||
"reply_markup": _summary_keyboard(can_reply, is_promotion, links),
|
||||
}
|
||||
if not plain_text:
|
||||
msg_payload["parse_mode"] = "MarkdownV2"
|
||||
result = _tg_req(tg_cfg, "sendMessage", msg_payload)
|
||||
})
|
||||
msg_id = result["result"]["message_id"]
|
||||
_email_contexts[msg_id] = {
|
||||
"summary_text": summary_text,
|
||||
|
||||
Reference in New Issue
Block a user