2017-10-30 20:39:12 +00:00
# Describes the format for available Telegram bot services
2017-05-10 04:42:17 +00:00
2017-10-30 20:39:12 +00:00
send_message :
description : Send a notification.
2017-05-10 04:42:17 +00:00
fields :
message :
description : Message body of the notification.
example : The garage door has been open for 10 minutes.
title :
description : Optional title for your notification. Will be composed as '%title\n%message'
2020-04-05 15:27:16 +00:00
example : "Your Garage Door Friend"
2017-05-10 04:42:17 +00:00
target :
description : An array of pre-authorized chat_ids to send the notification to. If not present, first allowed chat_id is the default.
2020-04-05 15:27:16 +00:00
example : "[12345, 67890] or 12345"
2017-05-10 04:42:17 +00:00
parse_mode :
description : "Parser for the message text: `html` or `markdown`."
2020-04-05 15:27:16 +00:00
example : "html"
2017-05-10 04:42:17 +00:00
disable_notification :
description : Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example : true
disable_web_page_preview :
description : Disables link previews for links in the message.
example : true
2020-02-03 20:23:58 +00:00
timeout :
description : Timeout for send message. Will help with timeout errors (poor internet connection, etc)
2020-04-05 15:27:16 +00:00
example : "1000"
2017-05-10 04:42:17 +00:00
keyboard :
2019-05-02 19:14:40 +00:00
description : List of rows of commands, comma-separated, to make a custom keyboard. Empty list clears a previously set keyboard.
2017-05-10 04:42:17 +00:00
example : '["/command1, /command2", "/command3"]'
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
Fix Telegram Bot send file to multiple targets, snapshots of HA cameras, variable templating, digest auth (#7771)
* fix double template rendering when messages come from notify.telegram
* fix 'chat' information not present in callback queries
* better inline keyboards with yaml
To make a row of InlineKeyboardButtons you pass:
- a list of tuples like: `[(text_b1, data_callback_b1), (text_b2, data_callback_b2), ...]
- a string like: `/cmd1, /cmd2, /cmd3`
- or a string like: `text_b1:/cmd1, text_b2:/cmd2`
Example:
```yaml
data:
message: 'TV is off'
disable_notification: true
inline_keyboard:
- TV ON:/service_call switch.turn_on switch.tv, Other:/othercmd
- /help, /init
```
* fix send file to multiple targets
* fix message templating, multiple file targets, HA cameras
- Allow templating for caption, url, file, longitude and latitude fields
- Fix send a file to multiple targets
- Load data with some retrying for HA cameras, which return 500 one or two times sometimes (generic cams, always!).
- Doc in services for new inline keyboards yaml syntax: `Text button:/command`
* HttpDigest authentication as proposed in #7396
* review changes
- Don't use `file` as variable name.
- For loop
- Simplify filter allowed `chat_id`s.
* Don't use `file` as variable name!
* make params outside the while loop
* fix chat_id validation when editing sent messages
2017-05-26 19:05:12 +00:00
example : '["/button1, /button2", "/button3"] or ["Text button1:/button1, Text button2:/button2", "Text button3:/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
2020-10-29 22:55:25 +00:00
message_tag :
description: 'Tag for sent message. In telegram_sent event data : {{trigger.event.data.message_tag}}'
example : "msg_to_edit"
2017-05-10 04:42:17 +00:00
send_photo :
2017-10-30 20:39:12 +00:00
description : Send a photo.
2017-05-10 04:42:17 +00:00
fields :
url :
description : Remote path to an image.
2020-04-05 15:27:16 +00:00
example : "http://example.org/path/to/the/image.png"
2017-05-10 04:42:17 +00:00
file :
description : Local path to an image.
2020-04-05 15:27:16 +00:00
example : "/path/to/the/image.png"
2017-05-10 04:42:17 +00:00
caption :
description : The title of the image.
2020-04-05 15:27:16 +00:00
example : "My image"
2017-05-10 04:42:17 +00:00
username :
description : Username for a URL which require HTTP basic authentication.
example : myuser
password :
description : Password for a URL which require HTTP basic authentication.
2018-03-23 18:16:57 +00:00
example : myuser_pwd
target :
description : An array of pre-authorized chat_ids to send the document to. If not present, first allowed chat_id is the default.
2020-04-05 15:27:16 +00:00
example : "[12345, 67890] or 12345"
2018-03-23 18:16:57 +00:00
disable_notification :
description : Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example : true
2019-03-16 01:18:10 +00:00
verify_ssl :
description : Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example : false
2020-02-03 20:23:58 +00:00
timeout :
description : Timeout for send photo. Will help with timeout errors (poor internet connection, etc)
2020-04-05 15:27:16 +00:00
example : "1000"
2018-03-23 18:16:57 +00:00
keyboard :
description : List of rows of commands, comma-separated, to make a custom keyboard.
example : '["/command1, /command2", "/command3"]'
inline_keyboard :
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
2020-10-29 22:55:25 +00:00
message_tag :
description: 'Tag for sent message. In telegram_sent event data : {{trigger.event.data.message_tag}}'
example : "msg_to_edit"
2018-03-23 18:16:57 +00:00
send_sticker :
description : Send a sticker.
fields :
url :
description : Remote path to an webp sticker.
2020-04-05 15:27:16 +00:00
example : "http://example.org/path/to/the/sticker.webp"
2018-03-23 18:16:57 +00:00
file :
description : Local path to an webp sticker.
2020-04-05 15:27:16 +00:00
example : "/path/to/the/sticker.webp"
2018-03-23 18:16:57 +00:00
username :
description : Username for a URL which require HTTP basic authentication.
example : myuser
password :
description : Password for a URL which require HTTP basic authentication.
2017-05-10 04:42:17 +00:00
example : myuser_pwd
target :
description : An array of pre-authorized chat_ids to send the document to. If not present, first allowed chat_id is the default.
2020-04-05 15:27:16 +00:00
example : "[12345, 67890] or 12345"
2017-05-10 04:42:17 +00:00
disable_notification :
description : Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example : true
2019-03-16 01:18:10 +00:00
verify_ssl :
description : Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example : false
2020-02-03 20:23:58 +00:00
timeout :
description : Timeout for send sticker. Will help with timeout errors (poor internet connection, etc)
2020-04-05 15:27:16 +00:00
example : "1000"
2017-05-10 04:42:17 +00:00
keyboard :
description : List of rows of commands, comma-separated, to make a custom keyboard.
example : '["/command1, /command2", "/command3"]'
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
2017-11-11 23:13:35 +00:00
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
2020-10-29 22:55:25 +00:00
message_tag :
description: 'Tag for sent message. In telegram_sent event data : {{trigger.event.data.message_tag}}'
example : "msg_to_edit"
2017-11-11 23:13:35 +00:00
send_video :
description : Send a video.
fields :
url :
description : Remote path to a video.
2020-04-05 15:27:16 +00:00
example : "http://example.org/path/to/the/video.mp4"
2017-11-11 23:13:35 +00:00
file :
description : Local path to an image.
2020-04-05 15:27:16 +00:00
example : "/path/to/the/video.mp4"
2017-11-11 23:13:35 +00:00
caption :
description : The title of the video.
2020-04-05 15:27:16 +00:00
example : "My video"
2017-11-11 23:13:35 +00:00
username :
description : Username for a URL which require HTTP basic authentication.
example : myuser
password :
description : Password for a URL which require HTTP basic authentication.
example : myuser_pwd
target :
description : An array of pre-authorized chat_ids to send the document to. If not present, first allowed chat_id is the default.
2020-04-05 15:27:16 +00:00
example : "[12345, 67890] or 12345"
2017-11-11 23:13:35 +00:00
disable_notification :
description : Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example : true
2019-03-16 01:18:10 +00:00
verify_ssl :
description : Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example : false
2020-02-03 20:23:58 +00:00
timeout :
description : Timeout for send video. Will help with timeout errors (poor internet connection, etc)
2020-04-05 15:27:16 +00:00
example : "1000"
2017-11-11 23:13:35 +00:00
keyboard :
description : List of rows of commands, comma-separated, to make a custom keyboard.
example : '["/command1, /command2", "/command3"]'
2020-12-02 19:44:02 +00:00
inline_keyboard :
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
message_tag :
description: 'Tag for sent message. In telegram_sent event data : {{trigger.event.data.message_tag}}'
example : "msg_to_edit"
send_voice :
description : Send a voice message.
fields :
url :
description : Remote path to a voice message.
example : "http://example.org/path/to/the/voice.opus"
file :
description : Local path to a voice message.
example : "/path/to/the/voice.opus"
caption :
description : The title of the voice message.
example : "My microphone recording"
username :
description : Username for a URL which require HTTP basic authentication.
example : myuser
password :
description : Password for a URL which require HTTP basic authentication.
example : myuser_pwd
target :
description : An array of pre-authorized chat_ids to send the document to. If not present, first allowed chat_id is the default.
example : "[12345, 67890] or 12345"
disable_notification :
description : Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example : true
verify_ssl :
description : Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example : false
timeout :
description : Timeout for send voice. Will help with timeout errors (poor internet connection, etc)
example : "1000"
keyboard :
description : List of rows of commands, comma-separated, to make a custom keyboard.
example : '["/command1, /command2", "/command3"]'
2017-11-11 23:13:35 +00:00
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
2017-05-10 04:42:17 +00:00
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
2020-10-29 22:55:25 +00:00
message_tag :
description: 'Tag for sent message. In telegram_sent event data : {{trigger.event.data.message_tag}}'
example : "msg_to_edit"
2017-05-10 04:42:17 +00:00
send_document :
2017-10-30 20:39:12 +00:00
description : Send a document.
2017-05-10 04:42:17 +00:00
fields :
url :
description : Remote path to a document.
2020-04-05 15:27:16 +00:00
example : "http://example.org/path/to/the/document.odf"
2017-05-10 04:42:17 +00:00
file :
description : Local path to a document.
2020-04-05 15:27:16 +00:00
example : "/tmp/whatever.odf"
2017-05-10 04:42:17 +00:00
caption :
description : The title of the document.
example : Document Title xy
username :
description : Username for a URL which require HTTP basic authentication.
example : myuser
password :
description : Password for a URL which require HTTP basic authentication.
example : myuser_pwd
target :
description : An array of pre-authorized chat_ids to send the document to. If not present, first allowed chat_id is the default.
2020-04-05 15:27:16 +00:00
example : "[12345, 67890] or 12345"
2017-05-10 04:42:17 +00:00
disable_notification :
description : Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example : true
2019-03-16 01:18:10 +00:00
verify_ssl :
description : Enable or disable SSL certificate verification. Set to false if you're downloading the file from a URL and you don't want to validate the SSL certificate of the server.
example : false
2020-02-03 20:23:58 +00:00
timeout :
description : Timeout for send document. Will help with timeout errors (poor internet connection, etc)
2020-04-05 15:27:16 +00:00
example : "1000"
2017-05-10 04:42:17 +00:00
keyboard :
description : List of rows of commands, comma-separated, to make a custom keyboard.
example : '["/command1, /command2", "/command3"]'
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
2017-05-10 04:42:17 +00:00
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
2020-10-29 22:55:25 +00:00
message_tag :
description: 'Tag for sent message. In telegram_sent event data : {{trigger.event.data.message_tag}}'
example : "msg_to_edit"
2017-05-10 04:42:17 +00:00
send_location :
2017-10-30 20:39:12 +00:00
description : Send a location.
2017-05-10 04:42:17 +00:00
fields :
latitude :
description : The latitude to send.
example : -15.123
longitude :
description : The longitude to send.
example : 38.123
target :
description : An array of pre-authorized chat_ids to send the location to. If not present, first allowed chat_id is the default.
2020-04-05 15:27:16 +00:00
example : "[12345, 67890] or 12345"
2017-05-10 04:42:17 +00:00
disable_notification :
description : Sends the message silently. iOS users and Web users will not receive a notification, Android users will receive a notification with no sound.
example : true
2020-02-03 20:23:58 +00:00
timeout :
description : Timeout for send photo. Will help with timeout errors (poor internet connection, etc)
2020-04-05 15:27:16 +00:00
example : "1000"
2017-05-10 04:42:17 +00:00
keyboard :
description : List of rows of commands, comma-separated, to make a custom keyboard.
example : '["/command1, /command2", "/command3"]'
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
2017-05-10 04:42:17 +00:00
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
2020-10-29 22:55:25 +00:00
message_tag :
description: 'Tag for sent message. In telegram_sent event data : {{trigger.event.data.message_tag}}'
example : "msg_to_edit"
2017-05-10 04:42:17 +00:00
edit_message :
2020-10-04 20:52:02 +00:00
description : Edit a previously sent message.
2017-05-10 04:42:17 +00:00
fields :
message_id :
description : id of the message to edit.
2020-04-05 15:27:16 +00:00
example : "{{ trigger.event.data.message.message_id }}"
2017-05-10 04:42:17 +00:00
chat_id :
description : The chat_id where to edit the message.
example : 12345
message :
description : Message body of the notification.
example : The garage door has been open for 10 minutes.
title :
description : Optional title for your notification. Will be composed as '%title\n%message'
2020-04-05 15:27:16 +00:00
example : "Your Garage Door Friend"
2017-05-10 04:42:17 +00:00
parse_mode :
description : "Parser for the message text: `html` or `markdown`."
2020-04-05 15:27:16 +00:00
example : "html"
2017-05-10 04:42:17 +00:00
disable_web_page_preview :
description : Disables link previews for links in the message.
example : true
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
2017-05-10 04:42:17 +00:00
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
edit_caption :
2020-10-04 20:52:02 +00:00
description : Edit the caption of a previously sent message.
2017-05-10 04:42:17 +00:00
fields :
message_id :
description : id of the message to edit.
2020-04-05 15:27:16 +00:00
example : "{{ trigger.event.data.message.message_id }}"
2017-05-10 04:42:17 +00:00
chat_id :
description : The chat_id where to edit the caption.
example : 12345
caption :
description : Message body of the notification.
example : The garage door has been open for 10 minutes.
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
2017-05-10 04:42:17 +00:00
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
edit_replymarkup :
2020-10-04 20:52:02 +00:00
description : Edit the inline keyboard of a previously sent message.
2017-05-10 04:42:17 +00:00
fields :
message_id :
description : id of the message to edit.
2020-04-05 15:27:16 +00:00
example : "{{ trigger.event.data.message.message_id }}"
2017-05-10 04:42:17 +00:00
chat_id :
description : The chat_id where to edit the reply_markup.
example : 12345
inline_keyboard :
2018-01-27 19:58:27 +00:00
description : List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with associated callback data.
2017-05-10 04:42:17 +00:00
example : '["/button1, /button2", "/button3"] or [[["Text button1", "/button1"], ["Text button2", "/button2"]], [["Text button3", "/button3"]]]'
answer_callback_query :
description : Respond to a callback query originated by clicking on an online keyboard button. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
fields :
message :
description : Unformatted text message body of the notification.
example : "OK, I'm listening"
callback_query_id :
description : Unique id of the callback response.
2020-04-05 15:27:16 +00:00
example : "{{ trigger.event.data.id }}"
2017-05-10 04:42:17 +00:00
show_alert :
description : Show a permanent notification.
example : true
2017-06-22 13:03:11 +00:00
delete_message :
2020-04-05 15:27:16 +00:00
description : Delete a previously sent message.
2017-06-22 13:03:11 +00:00
fields :
message_id :
description : id of the message to delete.
2020-04-05 15:27:16 +00:00
example : "{{ trigger.event.data.message.message_id }}"
2017-06-22 13:03:11 +00:00
chat_id :
description : The chat_id where to delete the message.
example : 12345