mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
More docs
This commit is contained in:
@@ -591,13 +591,13 @@ var Client = (function (_EventEmitter) {
|
||||
|
||||
//def setChannelName
|
||||
|
||||
Client.prototype.setChannelName = function setChannelName(channel, topic) {
|
||||
Client.prototype.setChannelName = function setChannelName(channel, name) {
|
||||
var callback = arguments.length <= 2 || arguments[2] === undefined ? function (err) {} : arguments[2];
|
||||
|
||||
var self = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
self.internal.setChannelName(channel, topic).then(function () {
|
||||
self.internal.setChannelName(channel, name).then(function () {
|
||||
callback();
|
||||
resolve();
|
||||
})["catch"](function (e) {
|
||||
@@ -748,6 +748,23 @@ var Client = (function (_EventEmitter) {
|
||||
});
|
||||
};
|
||||
|
||||
// def leaveVoiceChannel
|
||||
|
||||
Client.prototype.leaveVoiceChannel = function leaveVoiceChannel() {
|
||||
var callback = arguments.length <= 0 || arguments[0] === undefined ? function (err) {} : arguments[0];
|
||||
|
||||
var self = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
self.internal.leaveVoiceChannel().then(function () {
|
||||
callback();
|
||||
resolve();
|
||||
})["catch"](function (err) {
|
||||
callback(err);
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
_createClass(Client, [{
|
||||
key: "users",
|
||||
get: function get() {
|
||||
|
||||
@@ -91,7 +91,9 @@ var InternalClient = (function () {
|
||||
endpoint = data.d.endpoint;
|
||||
var chan = self.voiceConnection = new VoiceConnection(channel, self.client, session, token, server, endpoint);
|
||||
|
||||
chan.on("ready", resolve);
|
||||
chan.on("ready", function () {
|
||||
return resolve(chan);
|
||||
});
|
||||
chan.on("error", reject);
|
||||
|
||||
self.client.emit("debug", "removed temporary voice websocket listeners");
|
||||
@@ -990,7 +992,7 @@ var InternalClient = (function () {
|
||||
request.patch(Endpoints.ME).set("authorization", self.token).send({
|
||||
avatar: self.resolver.resolveToBase64(data.avatar) || self.user.avatar,
|
||||
email: data.email || self.email,
|
||||
new_password: data.new_password || null,
|
||||
new_password: data.newPassword || null,
|
||||
password: data.password || self.password,
|
||||
username: data.username || self.user.username
|
||||
}).end(function (err) {
|
||||
|
||||
Reference in New Issue
Block a user