From 2f9c079f41fa15419d2044c7695aa868fff57bdb Mon Sep 17 00:00:00 2001 From: Caleb Mah Date: Mon, 10 Feb 2025 14:52:38 +0800 Subject: [PATCH] Add documentation for message_thread_id data attribute for telegram notify integration (#37381) * Add documentation and examples for message_thread_id data attribute * Remove trailing colon in headers * tiny tweak --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- source/_integrations/telegram.markdown | 6 ++++++ source/_integrations/telegram_bot.markdown | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/source/_integrations/telegram.markdown b/source/_integrations/telegram.markdown index 715d39c560b..63e92cba62e 100644 --- a/source/_integrations/telegram.markdown +++ b/source/_integrations/telegram.markdown @@ -454,6 +454,7 @@ actions: message_tag: "example_tag" disable_notification: True disable_web_page_preview: True + message_thread_id: 123 ``` {% configuration %} @@ -468,10 +469,15 @@ disable_notification: type: boolean disable_web_page_preview: description: True/false to display a webpage preview. + required: false default: false type: boolean message_tag: description: Tag for sent message. required: false type: string +message_thread_id: + description: Send the message to a specific topic or thread. + required: false + type: integer {% endconfiguration %} diff --git a/source/_integrations/telegram_bot.markdown b/source/_integrations/telegram_bot.markdown index 52b127a598b..62c35c8a72f 100644 --- a/source/_integrations/telegram_bot.markdown +++ b/source/_integrations/telegram_bot.markdown @@ -290,7 +290,7 @@ Remove the bot from the chat group where it was added. ## Telegram notification platform -The [`telegram` notification platform](/integrations/telegram) requires the `telegram_bot` integration to work with, and it's designed to generate a customized shortcut (`notify.USERNAME`) to send notifications (messages, photos, documents and locations) to a particular `chat_id` with the old syntax, allowing backward compatibility. The data attributes `parse_mode`, `disable_notification`, `message_tag` and `disable_web_page_preview` are also supported. +The [`telegram` notification platform](/integrations/telegram) requires the `telegram_bot` integration to work with, and it's designed to generate a customized shortcut (`notify.USERNAME`) to send notifications (messages, photos, documents, and locations) to a particular `chat_id` with the old syntax, allowing backward compatibility. The data attributes `parse_mode`, `disable_notification`, `message_tag`, `disable_web_page_preview`, and `message_thread_id` are also supported. The required YAML configuration now reduces to: @@ -598,7 +598,7 @@ actions: message_tag: "example_tag" ``` -## Example: send_message with disabled webpage preview: +## Example: send_message with disabled webpage preview ```yaml actions: @@ -611,6 +611,17 @@ actions: disable_web_page_preview: true ``` +## Example: send_message to a topic within a group + +```yaml +actions: +- action: notify.telegram + data: + message: "Message to a topic" + data: + message_thread_id: 123 +``` + ## Example: automation to send a message and delete after a delay {% raw %}