Telegram Bot doc enhancements with callback queries and more notification options#2508
Conversation
Landrash
left a comment
There was a problem hiding this comment.
Looks really good in general.
Some minor clean up is preferred and then this can be merged after parent PR is merged.
| - **title** (*Optional*): Will be composed as '%title\n%message'. | ||
| - **parse_mode** (*Optional*): Parser for the message text: 'html' or 'markdown'. | ||
| - **timeout** (*Optional*): If this value is specified, use it as the definitive timeout (in seconds) for urlopen() operations. | ||
| - **disable_notification** (*Optional*): Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound. |
There was a problem hiding this comment.
Might be good to include what web users receive.
| ``` | ||
|
|
||
| - **edit_message** or **edit_caption** (*Required*): | ||
| - **message_id** or **inline_message_id** (*Required*): id of the message to be edited. |
There was a problem hiding this comment.
A bit of extra indentation here.
| To use notifications, please see the [getting started with automation page](/getting-started/automation/). | ||
|
|
||
| ### {% linkable_title Common message data parameters %} | ||
|
|
There was a problem hiding this comment.
Add
Configuration variables:
| callback_query_id: '{{ trigger.event.data.id }}' | ||
| show_alert: false | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Add
Configuration variables:
| - '/remove button' | ||
| ... | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Add
Configuration variables:
|
|
||
| Text repeater: | ||
| ```yaml | ||
| - alias: 'telegram bot that repeats text' |
There was a problem hiding this comment.
Preference of using capital letter of Telegram since it's used as a name throughout this documentation.
|
|
||
| Message editor: | ||
| ```yaml | ||
| - alias: 'telegram bot last sended msg edit' |
There was a problem hiding this comment.
Preference of using capital letter of Telegram since it's used as a name throughout this documentation.
|
|
||
| Keyboard editor: | ||
| ```yaml | ||
| - alias: 'telegram bot keyboard edit' |
There was a problem hiding this comment.
Preference of using capital letter of Telegram since it's used as a name throughout this documentation.
|
|
||
| Only acknowledges the 'NO' answer: | ||
| ```yaml | ||
| - alias: 'telegram bot simply acknowledges' |
There was a problem hiding this comment.
Preference of using capital letter of Telegram since it's used as a name throughout this documentation.
| show_alert: false | ||
| ``` | ||
|
|
||
| For a more complex usage of the `telegram_bot` capabilities, using [AppDaemon](https://home-assistant.io/docs/ecosystem/appdaemon/tutorial/) is advised. No newline at end of file |
There was a problem hiding this comment.
We wouldn't happen to have an example to link to except for the AppDaemon tool?
There was a problem hiding this comment.
Thanks a lot for your review. I'm going to try again.
On the AppDaemon tool, it is my intention to link or include in the documentation a simple example, perhaps with the same behavior of the yaml examples. My uses are too complex to use as examples...
Do you think the screenshots are necessary too? (home-assistant/core#7294)
Also, I think I need to close the smtp PR (was accidentally merged with this one) and make it again. I don't know how to remove files from the PR, sorry!!
Thanks a lot!
|
@Landrash, I think I'm finished. Waiting for the home-assistant review to validate the new doc. Do you want me to include the screenshots of the bot example? |
|
|
||
| A command looks like `/thecommand`, or `/othercommand with some args`. | ||
|
|
||
| When received by hass it will fire a `telegram_command` event on the event bus with the following `event_data`: |
There was a problem hiding this comment.
Avoid using hass an write out Home Assistant.
There's a few more examples but I won't mark them.
…ments with callback queries and more notification options Telegram Bot doc changes for pull request #7294: some required fixes and an example of an AppDaemon app. Telegram Bot doc changes for pull request #7294: fix Telegram Bot doc changes for pull request #7294: minimal clarification about disabling notifications for Telegram web users Telegram Bot doc changes for pull request #7294: added new notification services (like in the `mediaplayer` component doc); added a description to how operates now the `notify.telegram` platform; changed service calls from `notify/telegram_bot` to `telegram_bot/EXPLICIT_NEW_SERVICE` in some of the yaml examples and in the appdaemon example. Telegram Bot doc changes for pull request #7294: added `parse_mode` global config variable in webhooks and polling platforms; fixed links to /components/notify.telegram Telegram Bot doc changes for pull request #7294: removed complex usage of telegram_bot services (moved to the telegram_bot doc); removed api_key from required params; removed multiple target feature (it can be done with the telegram_bot services or simply defining more than one notifier); added keyboard and inline_keyboard config vars to every type of notification. Telegram Bot doc changes for pull request #7294: change 'hass' to 'Home Assistant'
|
Thanks! 🎉 |
| # Example configuration.yaml entry | ||
| # Example configuration.yaml entry for the Telegram Bot | ||
| telegram_bot: | ||
| platform: webhooks |
There was a problem hiding this comment.
I don't think we should assume that a user has exposed the install to the outside, which is required for webhooks. Better to suggest the polling platform.
| Use Telegram on your mobile device to send messages or commands to your Home Assistant. | ||
| Use Telegram on your mobile or desktop device to send and receive messages or commands to/from your Home Assistant. | ||
|
|
||
| This component creates notification services to send, or edit previously sent, messages from a [Telegram Bot account](https://core.telegram.org/bots) configured either with the [polling](/_components/telegram_bot.polling.markdown) method or with the [webhooks](/_components/telegram_bot.webhooks.markdown) one, and trigger events when receiving messages. |
There was a problem hiding this comment.
The links for polling and webhooks are incorrect. They should target:
/components/telegram_bot.polling/
/components/telegram_bot.webhooks/
Description:
Telegram Bot enhancements with callback queries and more notification options. Documentation of new parameters with yaml automation examples.
Pull request in home-assistant (if applicable): home-assistant/core#7294