@slack/client
Version:
A library for creating a Slack client
52 lines (40 loc) • 1.39 kB
JavaScript
// Generated by CoffeeScript 1.10.0
(function() {
var Channel, DM, Message,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Message = require('./message');
Channel = require('./channel');
DM = (function(superClass) {
extend(DM, superClass);
function DM(_client, data) {
var u;
this._client = _client;
if (data == null) {
data = {};
}
this._onClose = bind(this._onClose, this);
DM.__super__.constructor.call(this, this._client, data);
if (this.user) {
u = this._client.getUserByID(this.user);
if (u) {
this.name = u.name;
}
}
}
DM.prototype.close = function() {
var params;
params = {
"channel": this.id
};
return this._client._apiCall('im.close', params, this._onClose);
};
DM.prototype._onClose = function(data) {
return this._client.logger.debug(data);
};
return DM;
})(Channel);
module.exports = DM;
}).call(this);
//# sourceMappingURL=dm.js.map