messaging-api-slack
Advanced tools
Comparing version 0.2.3 to 0.2.4
{ | ||
"name": "messaging-api-slack", | ||
"description": "Messaging API client for Slack", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": ">=6" |
@@ -5,2 +5,4 @@ # messaging-api-slack | ||
<img src="https://cdn-images-1.medium.com/max/1200/1*TiKyhAN2gx4PpbOsiBhYcw.png" alt="Slack" width="150" /> | ||
## Table of Contents | ||
@@ -29,7 +31,9 @@ | ||
```js | ||
import { SlackClient } from 'messaging-api-slack'; | ||
const { SlackClient } = require('messaging-api-slack'); | ||
// get webhook URL by adding a Incoming Webhook integration to your team. | ||
// https://my.slack.com/services/new/incoming-webhook/ | ||
const client = SlackClient.connect('https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ'); | ||
const client = SlackClient.connect( | ||
'https://hooks.slack.com/services/XXXXXXXX/YYYYYYYY/zzzzzZZZZZ' | ||
); | ||
``` | ||
@@ -41,8 +45,10 @@ | ||
### Send API | ||
### Send API - [Official docs](https://api.slack.com/docs/messages) | ||
[Official docs](https://api.slack.com/docs/messages) | ||
#### sendRawBody(body) | ||
###### body | ||
Type: `Object` | ||
```js | ||
@@ -54,2 +60,6 @@ client.sendRawBody({ text: 'Hello!' }); | ||
###### text | ||
Type: `String` | ||
```js | ||
@@ -59,6 +69,8 @@ client.sendText('Hello!'); | ||
#### sendAttachments(attachments) | ||
#### sendAttachments(attachments) - [Official docs](https://api.slack.com/docs/message-attachments) | ||
[Official docs](https://api.slack.com/docs/message-attachments) | ||
###### attachments | ||
Type: `Array<Object>` | ||
```js | ||
@@ -89,10 +101,12 @@ client.sendAttachments([ | ||
], | ||
} | ||
}, | ||
]); | ||
``` | ||
#### sendAttachment(attachment) | ||
#### sendAttachment(attachment) - [Official docs](https://api.slack.com/docs/message-attachments) | ||
[Official docs](https://api.slack.com/docs/message-attachments) | ||
###### attachment | ||
Type: `Object` | ||
```js | ||
@@ -99,0 +113,0 @@ client.sendAttachment({ |
9020
120