grunt default does weird things to lib

This commit is contained in:
abalabahaha
2015-11-15 11:45:54 -08:00
parent 7af104a892
commit cabb170aee
23 changed files with 157 additions and 39 deletions

View File

@@ -509,6 +509,49 @@ var Client = (function (_EventEmitter) {
});
};
//def setStatus
Client.prototype.setStatus = function setStatus(idleStatus, gameID) {
var callback = arguments.length <= 2 || arguments[2] === undefined ? function (err) {} : arguments[2];
var self = this;
return new Promise(function (resolve, reject) {
if (typeof gameID === "function") {
// gameID is the callback
callback = gameID;
} else if (typeof idleStatus === "function") {
// idleStatus is the callback
callback = idleStatus;
}
self.internal.setStatus(idleStatus, gameID).then(function () {
callback();
resolve();
})["catch"](function (e) {
callback(e);
reject(e);
});
});
};
//def sendTyping
Client.prototype.sendTyping = function sendTyping(channel) {
var callback = arguments.length <= 1 || arguments[1] === undefined ? function (err) {} : arguments[1];
var self = this;
return new Promise(function (resolve, reject) {
self.internal.sendTyping(channel).then(function () {
callback();
resolve();
})["catch"](function (e) {
callback(e);
reject(e);
});
});
};
// def setTopic
Client.prototype.setTopic = function setTopic(channel, topic) {
@@ -624,9 +667,19 @@ var Client = (function (_EventEmitter) {
get: function get() {
return this.internal.voiceConnection;
}
}, {
key: "readyTime",
get: function get() {
return this.internal.readyTime;
}
}, {
key: "uptime",
get: function get() {
return this.internal.uptime;
}
}]);
return Client;
})(EventEmitter);
module.exports = Client;
module.exports = Client;