mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
grunt default does weird things to lib
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user