fix: omit parse_mode from payload when None instead of sending null

This commit is contained in:
2026-07-13 08:27:16 +08:00
parent bd5b824a6a
commit 98147e6a6c

View File

@@ -69,8 +69,10 @@ def edit_message(tg_cfg: TelegramConfig, chat_id: str, msg_id: int,
text: str, reply_markup: dict = None, parse_mode: str = "MarkdownV2"):
payload = {
"chat_id": chat_id, "message_id": msg_id,
"text": text, "parse_mode": parse_mode,
"text": text,
}
if parse_mode:
payload["parse_mode"] = parse_mode
if reply_markup:
payload["reply_markup"] = reply_markup
_tg_req(tg_cfg, "editMessageText", payload)