slack-client
Advanced tools
Comparing version 1.3.1 to 1.4.0
{ | ||
"name": "slack-client", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "A library for creating a full Slack client", | ||
"main": "./index", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "mocha --compilers coffee:coffee-script/register --reporter spec", | ||
"prepublish": "grunt prepublish" | ||
@@ -28,3 +28,3 @@ }, | ||
"dependencies": { | ||
"coffee-script": "1.6.3", | ||
"coffee-script": "~1.9.0", | ||
"ws": "0.4.31", | ||
@@ -38,8 +38,10 @@ "log": "1.4.0" | ||
"grunt-release": "~0.6.0", | ||
"grunt-shell": "~0.5.0" | ||
"grunt-shell": "~0.5.0", | ||
"should": "~2.0.2", | ||
"mocha": "~1.13.0" | ||
}, | ||
"engines": { | ||
"node": ">= 0.8.x", | ||
"node": ">= 0.10.x", | ||
"npm": ">= 1.1.x" | ||
} | ||
} |
@@ -197,3 +197,3 @@ var Bot, Channel, Client, DM, EventEmitter, Group, Log, Message, Team, User, WebSocket, https, querystring, | ||
Client.prototype.joinChannel = function(name) { | ||
Client.prototype.joinChannel = function(name, callback) { | ||
var params; | ||
@@ -203,3 +203,8 @@ params = { | ||
}; | ||
return this._apiCall('channels.join', params, this._onJoinChannel); | ||
return this._apiCall('channels.join', params, (function(_this) { | ||
return function() { | ||
_this._onJoinChannel.apply(_this, arguments); | ||
return typeof callback === "function" ? callback.apply(null, arguments) : void 0; | ||
}; | ||
})(this)); | ||
}; | ||
@@ -211,3 +216,3 @@ | ||
Client.prototype.openDM = function(user_id) { | ||
Client.prototype.openDM = function(user_id, callback) { | ||
var params; | ||
@@ -217,3 +222,8 @@ params = { | ||
}; | ||
return this._apiCall('im.open', params, this._onOpenDM); | ||
return this._apiCall('im.open', params, (function(_this) { | ||
return function() { | ||
_this._onOpenDM.apply(_this, arguments); | ||
return typeof callback === "function" ? callback.apply(null, arguments) : void 0; | ||
}; | ||
})(this)); | ||
}; | ||
@@ -225,3 +235,3 @@ | ||
Client.prototype.createGroup = function(name) { | ||
Client.prototype.createGroup = function(name, callback) { | ||
var params; | ||
@@ -231,3 +241,8 @@ params = { | ||
}; | ||
return this._apiCall('groups.create', params, this._onCreateGroup); | ||
return this._apiCall('groups.create', params, (function(_this) { | ||
return function() { | ||
_this._onCreateGroup.apply(_this, arguments); | ||
return typeof callback === "function" ? callback.apply(null, arguments) : void 0; | ||
}; | ||
})(this)); | ||
}; | ||
@@ -239,3 +254,3 @@ | ||
Client.prototype.setPresence = function(presence) { | ||
Client.prototype.setPresence = function(presence, callback) { | ||
var params; | ||
@@ -248,3 +263,8 @@ if (presence === !'away' && presence === !'active') { | ||
}; | ||
return this._apiCall('presence.set', params, this._onSetPresence); | ||
return this._apiCall('presence.set', params, (function(_this) { | ||
return function() { | ||
_this._onSetPresence.apply(_this, arguments); | ||
return typeof callback === "function" ? callback.apply(null, arguments) : void 0; | ||
}; | ||
})(this)); | ||
}; | ||
@@ -256,6 +276,11 @@ | ||
Client.prototype.setActive = function() { | ||
Client.prototype.setActive = function(callback) { | ||
var params; | ||
params = {}; | ||
return this._apiCall('users.setActive', params, this._onSetActive); | ||
return this._apiCall('users.setActive', params, (function(_this) { | ||
return function() { | ||
_this._onSetActive.apply(_this, arguments); | ||
return typeof callback === "function" ? callback.apply(null, arguments) : void 0; | ||
}; | ||
})(this)); | ||
}; | ||
@@ -267,3 +292,3 @@ | ||
Client.prototype.setStatus = function(status) { | ||
Client.prototype.setStatus = function(status, callback) { | ||
var params; | ||
@@ -273,3 +298,8 @@ params = { | ||
}; | ||
return this._apiCall('status.set', params, this._onSetStatus); | ||
return this._apiCall('status.set', params, (function(_this) { | ||
return function() { | ||
_this._onSetStatus.apply(_this, arguments); | ||
return callback.apply(null, arguments); | ||
}; | ||
})(this)); | ||
}; | ||
@@ -300,2 +330,3 @@ | ||
var k; | ||
name = name.replace(/^#/, ''); | ||
for (k in this.channels) { | ||
@@ -415,2 +446,10 @@ if (this.channels[k].name === name) { | ||
Client.prototype.onStarAdded = function(data) { | ||
return this.emit('star_added', data); | ||
}; | ||
Client.prototype.onStarRemoved = function(data) { | ||
return this.emit('star_removed', data); | ||
}; | ||
Client.prototype.onMessage = function(message) { | ||
@@ -571,2 +610,6 @@ var channel, k, m, u, user, _ref, _results; | ||
break; | ||
case 'star_added': | ||
return this.emit('star_added', message); | ||
case 'star_removed': | ||
return this.emit('star_removed', message); | ||
default: | ||
@@ -573,0 +616,0 @@ if (message.reply_to) { |
@@ -9,2 +9,3 @@ var Team; | ||
this.domain = domain; | ||
this.prefs = {}; | ||
} | ||
@@ -11,0 +12,0 @@ |
Sorry, the diff of this file is not supported yet
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
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
46579
17
1264
1
1
7
+ Addedcoffee-script@1.9.3(transitive)
- Removedcoffee-script@1.6.3(transitive)
Updatedcoffee-script@~1.9.0