Update Slack docs to include on-the-fly username/icon changes (#14281)

This commit is contained in:
Aaron Bach 2020-08-21 08:37:59 -06:00 committed by GitHub
parent fffe014db0
commit 9fffd278f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,12 +69,21 @@ icon:
type: string
{% endconfiguration %}
<div class='note'>
Note that in order to modify your Slack bot's username and icon, you must ensure your Slack app has the `chat:write.customize` OAuth scope. See [the Slack API documentation](https://api.slack.com/methods/chat.postMessage#authorship) for more information.
</div>
### Slack Service Data
The following attributes can be placed inside the `data` key of the service call for extended functionality:
| Attribute | Optional | Description |
| ---------------------- | -------- | ----------- |
| `username` | yes | The username of the Slack bot.
| `icon` | yes | The icon of the Slack bot.
| `file` | yes | A file to include with the message; see below.
| `file` | yes | A file to include with the message; see below.
| `blocks` | yes | Array of [Slack blocks](https://api.slack.com/messaging/composing/layouts). *NOTE*: if using `blocks`, they are shown **in place of** the `message` (note that the `message` is required nonetheless).
| `blocks_template` | yes | The same as `blocks`, but able to support [templates](https://www.home-assistant.io/docs/configuration/templating).