@slack/client
Advanced tools
Comparing version 3.8.1 to 3.9.0
@@ -105,7 +105,6 @@ --- | ||
var RtmClient = require('@slack/client').RtmClient; | ||
var RTM_EVENTS = require('@slack/client').RTM_EVENTS; | ||
var bot_token = process.env.SLACK_BOT_TOKEN || ''; | ||
var rtm = new RtmClient(bot_token); | ||
rtm.start(); | ||
@@ -115,2 +114,4 @@ rtm.on(RTM_EVENTS.MESSAGE, function handleRtmMessage(message) { | ||
}); | ||
rtm.start(); | ||
``` | ||
@@ -117,0 +118,0 @@ |
@@ -32,2 +32,10 @@ /** | ||
} | ||
// For the web API, this should always be a JSON-encoded object, see: | ||
// https://api.slack.com/methods/chat.unfurl | ||
} else if (key === 'unfurls') { | ||
if (isString(val)) { | ||
target[key] = val; | ||
} else { | ||
target[key] = JSON.stringify(val); | ||
} | ||
} else if (key !== 'opts') { | ||
@@ -34,0 +42,0 @@ target[key] = val; |
@@ -126,3 +126,21 @@ /** | ||
/** | ||
* Unfurl a URL within a message by defining its message attachment. | ||
* @see {@link https://api.slack.com/methods/chat.unfurl|chat.unfurl} | ||
* | ||
* @param {?} ts - Timestamp of the message to be updated. | ||
* @param {?} channel - Channel of the message to be updated. | ||
* @param {string} unfurls - a map of URLs to structured message attachments | ||
* @param {function=} optCb Optional callback, if not using promises. | ||
*/ | ||
ChatFacet.prototype.unfurl = function unfurl(ts, channel, unfurls, optCb) { | ||
var requiredArgs = { | ||
ts: ts, | ||
channel: channel, | ||
unfurls: unfurls | ||
}; | ||
return this.makeAPICall('chat.unfurl', requiredArgs, {}, optCb); | ||
}; | ||
module.exports = ChatFacet; |
{ | ||
"name": "@slack/client", | ||
"version": "3.8.1", | ||
"version": "3.9.0", | ||
"description": "A library for creating a Slack client", | ||
@@ -5,0 +5,0 @@ "main": "./index", |
@@ -28,3 +28,3 @@ # Node Library for the Slack APIs | ||
to learn how to use {{ site.product_name }} to accomplish these tasks. Bots, on the other hand, are a bit more complex, | ||
so we have them covered in [Building Bots](bots.html). | ||
so we have them covered in [Building Bots](https://slackapi.github.io/node-slack-sdk/bots). | ||
@@ -31,0 +31,0 @@ # Some Examples |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
462449
178
7359
3