Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions source/_integrations/telegram_bot.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Send a notification.
| `disable_web_page_preview`| yes | True/false for disable link previews for links in the message. |
| `keyboard` | yes | List of rows of commands, comma-separated, to make a custom keyboard. `[]` to reset to no custom keyboard. Example: `["/command1, /command2", "/command3"]` |
| `inline_keyboard` | yes | 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 btn1", "/button1"], ["Text btn2", "/button2"]], [["Text btn3", "/button3"]]]` |
| `message_tag` | yes | Tag for sent message. In `telegram_sent` event data: `{{trigger.event.data.message_tag}}` |

### Service `telegram_bot.send_photo` and `telegram_bot.send_sticker`

Expand All @@ -51,6 +52,7 @@ Send a photo.
| `timeout` | yes | Timeout for send photo. Will help with timeout errors (poor internet connection, etc) |
| `keyboard` | yes | List of rows of commands, comma-separated, to make a custom keyboard. `[]` to reset to no custom keyboard. Example: `["/command1, /command2", "/command3"]` |
| `inline_keyboard` | yes | 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 btn1", "/button1"], ["Text btn2", "/button2"]], [["Text btn3", "/button3"]]]` |
| `message_tag` | yes | Tag for sent message. In `telegram_sent` event data: `{{trigger.event.data.message_tag}}` |

### Service `telegram_bot.send_video`

Expand All @@ -70,6 +72,7 @@ Send a video.
| `timeout` | yes | Timeout for send video. Will help with timeout errors (poor internet connection, etc) |
| `keyboard` | yes | List of rows of commands, comma-separated, to make a custom keyboard. `[]` to reset to no custom keyboard. Example: `["/command1, /command2", "/command3"]` |
| `inline_keyboard` | yes | 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 btn1", "/button1"], ["Text btn2", "/button2"]], [["Text btn3", "/button3"]]]` |
| `message_tag` | yes | Tag for sent message. In `telegram_sent` event data: `{{trigger.event.data.message_tag}}` |

### Service `telegram_bot.send_document`

Expand All @@ -89,6 +92,7 @@ Send a document.
| `timeout` | yes | Timeout for send document. Will help with timeout errors (poor internet connection, etc) |
| `keyboard` | yes | List of rows of commands, comma-separated, to make a custom keyboard. `[]` to reset to no custom keyboard. Example: `["/command1, /command2", "/command3"]` |
| `inline_keyboard` | yes | 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 btn1", "/button1"], ["Text btn2", "/button2"]], [["Text btn3", "/button3"]]]` |
| `message_tag` | yes | Tag for sent message. In `telegram_sent` event data: `{{trigger.event.data.message_tag}}` |

### Service `telegram_bot.send_location`

Expand All @@ -102,6 +106,7 @@ Send a location.
| `disable_notification` | yes | True/false for send the message silently. iOS users and web users will not receive a notification, Android users will receive a notification with no sound. Defaults to False. |
| `keyboard` | yes | List of rows of commands, comma-separated, to make a custom keyboard. `[]` to reset to no custom keyboard. Example: `["/command1, /command2", "/command3"]` |
| `inline_keyboard` | yes | 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 btn1", "/button1"], ["Text btn2", "/button2"]], [["Text btn3", "/button3"]]]` |
| `message_tag` | yes | Tag for sent message. In `telegram_sent` event data: `{{trigger.event.data.message_tag}}` |

### Service `telegram_bot.edit_message`

Expand Down Expand Up @@ -424,3 +429,27 @@ Telegram callbacks also support arguments and commands the same way as normal me
{% endraw %}

In this case, having a callback with `/repeat 1 2 3` will pop a notification saying `I repeat: [1, 2, 3]`

Receiving `chat_id` and `message_id` identifiers of sent messages by the `telegram_bot`.

{% raw %}

```yaml
- alias: 'Notifications about messages sent by Telegram bot'
trigger:
platform: event
event_type: telegram_sent
event_data:
message_tag: "msg_start"
action:
- service: input_number.set_value
data_template:
entity_id: input_number.chat_id
value: '{{ trigger.event.data.chat_id }}'
- service: input_number.set_value
data_template:
entity_id: input_number.message_id
value: '{{ trigger.event.data.message_id }}'
```

{% endraw %}