github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/content/ru/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  Отправка уведомлений в чат slack
    11  
    12  ### Настройка
    13  * Token
    14  * User name
    15  
    16  ### javascript свойства
    17  
    18  ----------------
    19  
    20  ### Новое сообщение
    21  
    22  создает объект сообщения
    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  |  значение  | описание  |
    34  |-------------|---------|
    35  | newMessage() |    метод   |
    36  | msg |   type: Object (Message)  |
    37  
    38  ----------------
    39  
    40  ### пример кода
    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