fix: pass chat_action from target config to Telegram client

chat_action was stored on NotificationTarget model but never injected
into the config dict passed to the dispatcher. Now injected in both
watcher and webhook handler, and read by the dispatcher to pass to
TelegramClient.send_notification().
This commit is contained in:
2026-03-22 23:04:33 +03:00
parent d8a1af0c9e
commit e90c128dca
3 changed files with 8 additions and 0 deletions
@@ -105,6 +105,7 @@ class NotificationDispatcher:
) -> dict[str, Any]:
bot_token = target.config.get("bot_token")
disable_preview = target.config.get("disable_url_preview", False)
chat_action = target.config.get("chat_action", "typing")
max_media = target.config.get("max_media_to_send", 50)
max_group = target.config.get("max_media_per_group", 10)
chunk_delay = target.config.get("media_delay", 500)
@@ -172,6 +173,7 @@ class NotificationDispatcher:
chunk_delay=chunk_delay,
max_asset_data_size=max_size,
send_large_photos_as_documents=send_large_as_docs,
chat_action=chat_action or None,
)
if not media_result.get("success"):
_LOGGER.warning("Text sent OK but media failed for chat %s: %s", chat_id, media_result.get("error"))