github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/content/en/docs/plugins/notify/slack.md (about) 1 2 --- 3 title: "Slack" 4 linkTitle: "slack" 5 date: 2021-10-20 6 description: > 7 8 --- 9 10 To send notifications to Slack chat, you'll need to configure the following settings: 11 12 ### Configuration: 13 - Token 14 - User name 15 16 ### JavaScript Properties: 17 18 ---------------- 19 20 New Message: 21 22 Creates a message object. 23 24 ```coffeescript 25 msg = notifr.newMessage(); 26 msg.entity_id = 'slack.name'; 27 msg.attributes = { 28 'channel': '#ch', 29 'text': 'some text' 30 }; 31 ``` 32 33 | Value | Description | 34 |-------|-------------| 35 | newMessage() | Method | 36 | msg | Type: Object (Message) | 37 38 ---------------- 39 40 ### Code Example: 41 42 ```coffeescript 43 # slack 44 # ################################## 45 46 sendMsg =(body)-> 47 msg = notifr.newMessage(); 48 msg.entity_id = 'slack.name'; 49 msg.attributes = { 50 'channel': '#ch', 51 'text': 'some text' 52 }; 53 notifr.send(msg); 54 ``` 55