mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
@@ -657,7 +657,7 @@ var InternalClient = (function () {
|
||||
return Promise.reject(new Error("Client is not logged in!"));
|
||||
}
|
||||
|
||||
return this.apiRequest("post", _Constants.Endpoints.LOGOUT, true).then(function () {
|
||||
var disconnect = function disconnect() {
|
||||
if (_this12.websocket) {
|
||||
_this12.websocket.close(1000);
|
||||
_this12.websocket = null;
|
||||
@@ -666,7 +666,14 @@ var InternalClient = (function () {
|
||||
_this12.email = null;
|
||||
_this12.password = null;
|
||||
_this12.state = _ConnectionState2["default"].DISCONNECTED;
|
||||
});
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
if (!this.user.bot) {
|
||||
return this.apiRequest("post", _Constants.Endpoints.LOGOUT, true).then(disconnect);
|
||||
} else {
|
||||
disconnect();
|
||||
}
|
||||
};
|
||||
|
||||
// def startPM
|
||||
@@ -1591,7 +1598,9 @@ var InternalClient = (function () {
|
||||
return Promise.reject(new Error("Bitrate must be between 8-96kbps"));
|
||||
}
|
||||
|
||||
data.bitrate *= 1000; // convert to bits before sending
|
||||
if (data.bitrate) {
|
||||
data.bitrate *= 1000; // convert to bits before sending
|
||||
}
|
||||
|
||||
return _this35.apiRequest("patch", _Constants.Endpoints.CHANNEL(channel.id), true, data).then(function (res) {
|
||||
channel.name = data.name;
|
||||
|
||||
Reference in New Issue
Block a user