fix: read Telegram caption field for media messages Telegram sends text in 'caption' field (not 'text') when message has media. Handle both cases: text or caption, with text taking priority.
This commit is contained in:
@@ -453,7 +453,8 @@ def _handle_callback(tg_cfg: TelegramConfig, cfg: Config, cb: dict):
|
|||||||
|
|
||||||
def _handle_message(tg_cfg: TelegramConfig, cfg: Config, msg: dict):
|
def _handle_message(tg_cfg: TelegramConfig, cfg: Config, msg: dict):
|
||||||
chat_id = msg["chat"]["id"]
|
chat_id = msg["chat"]["id"]
|
||||||
text = msg.get("text", "").strip()
|
text = msg.get("text") or msg.get("caption") or ""
|
||||||
|
text = text.strip()
|
||||||
conv = load_conversation(chat_id)
|
conv = load_conversation(chat_id)
|
||||||
|
|
||||||
if not conv:
|
if not conv:
|
||||||
|
|||||||
Reference in New Issue
Block a user