mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
fix voice state updates (#461)
* fix voice state updates * use .has for backwards compatability and consistency
This commit is contained in:
@@ -274,7 +274,7 @@ var Server = (function (_Equality) {
|
|||||||
|
|
||||||
var chan = _ref3;
|
var chan = _ref3;
|
||||||
|
|
||||||
if (chan.members.has(user)) {
|
if (chan.members.has("id", user.id)) {
|
||||||
chan.members.remove(user);
|
chan.members.remove(user);
|
||||||
user.voiceChannel = null;
|
user.voiceChannel = null;
|
||||||
return chan;
|
return chan;
|
||||||
|
|||||||
@@ -6,23 +6,23 @@ exports.__esModule = true;
|
|||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
var TokenCacher = (function () {
|
var TokenCacher = (function () {
|
||||||
function TokenCacher() {
|
function TokenCacher() {
|
||||||
_classCallCheck(this, TokenCacher);
|
_classCallCheck(this, TokenCacher);
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenCacher.prototype.setToken = function setToken() {};
|
TokenCacher.prototype.setToken = function setToken() {};
|
||||||
|
|
||||||
TokenCacher.prototype.save = function save() {};
|
TokenCacher.prototype.save = function save() {};
|
||||||
|
|
||||||
TokenCacher.prototype.getToken = function getToken() {
|
TokenCacher.prototype.getToken = function getToken() {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
TokenCacher.prototype.init = function init(ind) {
|
TokenCacher.prototype.init = function init(ind) {
|
||||||
this.done = true;
|
this.done = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
return TokenCacher;
|
return TokenCacher;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
exports["default"] = TokenCacher;
|
exports["default"] = TokenCacher;
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export default class Server extends Equality {
|
|||||||
|
|
||||||
eventVoiceLeave(user) {
|
eventVoiceLeave(user) {
|
||||||
for (let chan of this.channels.getAll("type", "voice")) {
|
for (let chan of this.channels.getAll("type", "voice")) {
|
||||||
if (chan.members.has(user)) {
|
if (chan.members.has("id", user.id)) {
|
||||||
chan.members.remove(user);
|
chan.members.remove(user);
|
||||||
user.voiceChannel = null;
|
user.voiceChannel = null;
|
||||||
return chan;
|
return chan;
|
||||||
|
|||||||
Reference in New Issue
Block a user