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;
|
||||
|
||||
@@ -21,7 +21,7 @@ var _crypto = require("crypto");
|
||||
|
||||
var _crypto2 = _interopRequireDefault(_crypto);
|
||||
|
||||
var savePaths = [process.env.APPDATA || (process.platform == "darwin" ? process.env.HOME + "Library/Preference" : "/var/local"), process.env[process.platform == "win32" ? "USERPROFILE" : "HOME"], process.cwd()];
|
||||
var savePaths = [process.env.APPDATA || (process.platform == "darwin" ? process.env.HOME + "Library/Preferences" : "/var/local"), process.env[process.platform == "win32" ? "USERPROFILE" : "HOME"], process.cwd(), "/tmp"];
|
||||
|
||||
var algo = "aes-256-ctr";
|
||||
|
||||
|
||||
@@ -555,8 +555,7 @@ export default class InternalClient {
|
||||
return Promise.reject(new Error("Client is not logged in!"));
|
||||
}
|
||||
|
||||
return this.apiRequest("post", Endpoints.LOGOUT, true)
|
||||
.then(() => {
|
||||
var disconnect = () => {
|
||||
if (this.websocket) {
|
||||
this.websocket.close(1000);
|
||||
this.websocket = null;
|
||||
@@ -565,7 +564,15 @@ export default class InternalClient {
|
||||
this.email = null;
|
||||
this.password = null;
|
||||
this.state = ConnectionState.DISCONNECTED;
|
||||
});
|
||||
return Promise.resolve();
|
||||
};
|
||||
|
||||
if(!this.user.bot) {
|
||||
return this.apiRequest("post", Endpoints.LOGOUT, true)
|
||||
.then(disconnect);
|
||||
} else {
|
||||
disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
// def startPM
|
||||
@@ -1371,8 +1378,9 @@ export default class InternalClient {
|
||||
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 this.apiRequest("patch", Endpoints.CHANNEL(channel.id), true, data)
|
||||
.then(res => {
|
||||
|
||||
@@ -6,9 +6,10 @@ import EventEmitter from "events";
|
||||
import crypto from "crypto";
|
||||
|
||||
var savePaths = [
|
||||
process.env.APPDATA || (process.platform == "darwin" ? process.env.HOME + "Library/Preference" : "/var/local"),
|
||||
process.env.APPDATA || (process.platform == "darwin" ? process.env.HOME + "Library/Preferences" : "/var/local"),
|
||||
process.env[(process.platform == "win32") ? "USERPROFILE" : "HOME"],
|
||||
process.cwd()
|
||||
process.cwd(),
|
||||
"/tmp"
|
||||
];
|
||||
|
||||
var algo = "aes-256-ctr";
|
||||
|
||||
Reference in New Issue
Block a user