Added banMember method

This commit is contained in:
hydrabolt
2015-11-02 17:43:44 +00:00
parent 0629b9c06d
commit ca6f582853
4 changed files with 82 additions and 0 deletions

View File

@@ -304,6 +304,27 @@ var Client = (function (_EventEmitter) {
});
};
//def banMember
Client.prototype.banMember = function banMember(user, server) {
var length = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];
var callback = arguments.length <= 3 || arguments[3] === undefined ? function (err) {} : arguments[3];
var self = this;
return new Promise(function (resolve, reject) {
if (typeof length === "function") {
// length is the callback
callback = length;
}
self.internal.banMember(user, server, length).then(function () {
callback();
resolve();
})["catch"](function (e) {
callback(e);reject(e);
});
});
};
return Client;
})(EventEmitter);