mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
@@ -657,7 +657,7 @@ var InternalClient = (function () {
|
|||||||
return Promise.reject(new Error("Client is not logged in!"));
|
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) {
|
if (_this12.websocket) {
|
||||||
_this12.websocket.close(1000);
|
_this12.websocket.close(1000);
|
||||||
_this12.websocket = null;
|
_this12.websocket = null;
|
||||||
@@ -666,7 +666,14 @@ var InternalClient = (function () {
|
|||||||
_this12.email = null;
|
_this12.email = null;
|
||||||
_this12.password = null;
|
_this12.password = null;
|
||||||
_this12.state = _ConnectionState2["default"].DISCONNECTED;
|
_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
|
// def startPM
|
||||||
@@ -1591,7 +1598,9 @@ var InternalClient = (function () {
|
|||||||
return Promise.reject(new Error("Bitrate must be between 8-96kbps"));
|
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) {
|
return _this35.apiRequest("patch", _Constants.Endpoints.CHANNEL(channel.id), true, data).then(function (res) {
|
||||||
channel.name = data.name;
|
channel.name = data.name;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ var _crypto = require("crypto");
|
|||||||
|
|
||||||
var _crypto2 = _interopRequireDefault(_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";
|
var algo = "aes-256-ctr";
|
||||||
|
|
||||||
|
|||||||
@@ -555,8 +555,7 @@ export default class InternalClient {
|
|||||||
return Promise.reject(new Error("Client is not logged in!"));
|
return Promise.reject(new Error("Client is not logged in!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.apiRequest("post", Endpoints.LOGOUT, true)
|
var disconnect = () => {
|
||||||
.then(() => {
|
|
||||||
if (this.websocket) {
|
if (this.websocket) {
|
||||||
this.websocket.close(1000);
|
this.websocket.close(1000);
|
||||||
this.websocket = null;
|
this.websocket = null;
|
||||||
@@ -565,7 +564,15 @@ export default class InternalClient {
|
|||||||
this.email = null;
|
this.email = null;
|
||||||
this.password = null;
|
this.password = null;
|
||||||
this.state = ConnectionState.DISCONNECTED;
|
this.state = ConnectionState.DISCONNECTED;
|
||||||
});
|
return Promise.resolve();
|
||||||
|
};
|
||||||
|
|
||||||
|
if(!this.user.bot) {
|
||||||
|
return this.apiRequest("post", Endpoints.LOGOUT, true)
|
||||||
|
.then(disconnect);
|
||||||
|
} else {
|
||||||
|
disconnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// def startPM
|
// def startPM
|
||||||
@@ -1371,8 +1378,9 @@ export default class InternalClient {
|
|||||||
return Promise.reject(new Error("Bitrate must be between 8-96kbps"));
|
return Promise.reject(new Error("Bitrate must be between 8-96kbps"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.bitrate) {
|
||||||
data.bitrate *= 1000; // convert to bits before sending
|
data.bitrate *= 1000; // convert to bits before sending
|
||||||
|
}
|
||||||
|
|
||||||
return this.apiRequest("patch", Endpoints.CHANNEL(channel.id), true, data)
|
return this.apiRequest("patch", Endpoints.CHANNEL(channel.id), true, data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ import EventEmitter from "events";
|
|||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
|
|
||||||
var savePaths = [
|
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.env[(process.platform == "win32") ? "USERPROFILE" : "HOME"],
|
||||||
process.cwd()
|
process.cwd(),
|
||||||
|
"/tmp"
|
||||||
];
|
];
|
||||||
|
|
||||||
var algo = "aes-256-ctr";
|
var algo = "aes-256-ctr";
|
||||||
|
|||||||
Reference in New Issue
Block a user