Added setTopic implementation

This commit is contained in:
hydrabolt
2015-11-06 20:07:28 +00:00
parent 81a8771063
commit 98a62eb94e
4 changed files with 95 additions and 0 deletions

View File

@@ -460,6 +460,24 @@ var Client = (function (_EventEmitter) {
});
};
// def setTopic
Client.prototype.setTopic = function setTopic(channel, topic) {
var callback = arguments.length <= 2 || arguments[2] === undefined ? function (err) {} : arguments[2];
var self = this;
return new Promise(function (resolve, reject) {
self.internal.setTopic(channel, topic).then(function () {
callback();
resolve();
})["catch"](function (e) {
callback(e);
reject(e);
});
});
};
_createClass(Client, [{
key: "users",
get: function get() {