New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

messaging-api-slack

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

messaging-api-slack - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

2

package.json
{
"name": "messaging-api-slack",
"description": "Messaging API client for Slack",
"version": "0.3.3",
"version": "0.3.4",
"engines": {

@@ -6,0 +6,0 @@ "node": ">=6"

@@ -59,11 +59,8 @@ # messaging-api-slack

###### method
Param | Type | Description
------ | -------- | -----------
method | `String` | One of <code>`chat.postMessage` &#124; `channels.info` &#124; `channels.list` &#124; `users.info` &#124; `users.list`</code>
body | `Object` | Body that the method needs.
Type: `String`
Value: One of `chat.postMessage | 'channels.info' | 'channels.list' | 'users.info' | 'users.list`
###### body
Type: `Object`
Example:
```js

@@ -77,22 +74,13 @@ client.callMethod('chat.postMessage', { channel: 'C8763', text: 'Hello!' });

## `postMessage(channel, text, options?)` - [Official docs](https://api.slack.com/methods/chat.postMessage)
## `postMessage(channel, text [, options])` - [Official docs](https://api.slack.com/methods/chat.postMessage)
Sends a message to a channel.
###### channel
Param | Type | Description
------- | -------- | -----------
channel | `String` | Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
text | `String` | Text of the message to be sent.
options | `Object` | Other optional parameters.
Type: `String`
###### text
Type: `String`
###### options
Type: `Object`
###### options.as_user
Type: `Boolean`
Example:
```js

@@ -111,6 +99,7 @@ client.postMessage('C8763', 'Hello!');

###### cursor
Param | Type | Description
------ | -------- | -----------
cursor | `String` | Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`.
Type: `String`
Example:
```js

@@ -135,2 +124,3 @@ client.getUserList(cursor).then(res => {

Example:
```js

@@ -152,6 +142,7 @@ client.getAllUserList().then(res => {

###### userId
Param | Type | Description
------ | -------- | -----------
userId | `String` | User to get info on.
Type: `String`
Example:
```js

@@ -176,2 +167,3 @@ client.getUserInfo(userId).then(res => {

Example:
```js

@@ -191,6 +183,7 @@ client.getChannelList().then(res => {

###### channelId
Param | Type | Description
--------- | -------- | -----------
channelId | `String` | Channel to get info on.
Type: `String`
Example:
```js

@@ -211,3 +204,3 @@ client.getChannelInfo(channelId).then(res => {

### Usage
## Usage

@@ -228,3 +221,3 @@ Get your webhook url by adding a [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integreation to your team or setup Incoming Webhooks function to your app.

### API Reference
## API Reference

@@ -235,10 +228,11 @@ All methods return a Promise.

#### Send API - [Official docs](https://api.slack.com/docs/messages)
### Send API - [Official docs](https://api.slack.com/docs/messages)
## `sendRawBody(body)`
###### body
Param | Type | Description
----- | -------- | -----------
body | `Object` | Raw data to be sent.
Type: `Object`
Example:
```js

@@ -252,6 +246,7 @@ client.sendRawBody({ text: 'Hello!' });

###### text
Param | Type | Description
----- | -------- | -----------
text | `String` | Text of the message to be sent.
Type: `String`
Example:
```js

@@ -265,6 +260,9 @@ client.sendText('Hello!');

###### attachments
Send multiple attachments which let you add more context to a message.
Type: `Array<Object>`
Param | Type | Description
----------- | --------------- | -----------
attachments | `Array<Object>` | Messages are attachments, defined as an array. Each object contains the parameters to customize the appearance of a message attachment.
Example:
```js

@@ -303,6 +301,9 @@ client.sendAttachments([

###### attachment
Send only one attachment.
Type: `Object`
Param | Type | Description
----------- | -------- | -----------
attachments | `Object` | Message is an attachment. The object contains the parameters to customize the appearance of a message attachment.
Example:
```js

@@ -309,0 +310,0 @@ client.sendAttachment({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc