mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
More if statements for bad state tracking
This commit is contained in:
@@ -156,14 +156,18 @@ var Server = (function (_Equality) {
|
|||||||
var voiceState = _ref2;
|
var voiceState = _ref2;
|
||||||
|
|
||||||
var _user = this.members.get("id", voiceState.user_id);
|
var _user = this.members.get("id", voiceState.user_id);
|
||||||
var channel = this.channels.get("id", voiceState.channel_id);
|
if (_user) {
|
||||||
this.memberMap[_user.id] = this.memberMap[_user.id] || {};
|
this.memberMap[_user.id] = this.memberMap[_user.id] || {};
|
||||||
this.memberMap[_user.id].mute = voiceState.mute || this.memberMap[_user.id].mute;
|
this.memberMap[_user.id].mute = voiceState.mute || this.memberMap[_user.id].mute;
|
||||||
this.memberMap[_user.id].selfMute = voiceState.self_mute === undefined ? this.memberMap[_user.id].selfMute : voiceState.self_mute;
|
this.memberMap[_user.id].selfMute = voiceState.self_mute === undefined ? this.memberMap[_user.id].selfMute : voiceState.self_mute;
|
||||||
this.memberMap[_user.id].deaf = voiceState.deaf || this.memberMap[_user.id].deaf;
|
this.memberMap[_user.id].deaf = voiceState.deaf || this.memberMap[_user.id].deaf;
|
||||||
this.memberMap[_user.id].selfDeaf = voiceState.self_deaf === undefined ? this.memberMap[_user.id].selfDeaf : voiceState.self_deaf;
|
this.memberMap[_user.id].selfDeaf = voiceState.self_deaf === undefined ? this.memberMap[_user.id].selfDeaf : voiceState.self_deaf;
|
||||||
if (_user && channel) {
|
var channel = this.channels.get("id", voiceState.channel_id);
|
||||||
this.eventVoiceJoin(_user, channel);
|
if (channel) {
|
||||||
|
this.eventVoiceJoin(_user, channel);
|
||||||
|
} else {
|
||||||
|
this.client.emit("warn", "channel doesn't exist even though READY expects them to");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.client.emit("warn", "user doesn't exist even though READY expects them to");
|
this.client.emit("warn", "user doesn't exist even though READY expects them to");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,14 +93,18 @@ export default class Server extends Equality {
|
|||||||
if (data.voice_states) {
|
if (data.voice_states) {
|
||||||
for (var voiceState of data.voice_states) {
|
for (var voiceState of data.voice_states) {
|
||||||
let user = this.members.get("id", voiceState.user_id);
|
let user = this.members.get("id", voiceState.user_id);
|
||||||
let channel = this.channels.get("id", voiceState.channel_id);
|
if (user) {
|
||||||
this.memberMap[user.id] = this.memberMap[user.id] || {};
|
this.memberMap[user.id] = this.memberMap[user.id] || {};
|
||||||
this.memberMap[user.id].mute = voiceState.mute || this.memberMap[user.id].mute;
|
this.memberMap[user.id].mute = voiceState.mute || this.memberMap[user.id].mute;
|
||||||
this.memberMap[user.id].selfMute = voiceState.self_mute === undefined ? this.memberMap[user.id].selfMute : voiceState.self_mute;
|
this.memberMap[user.id].selfMute = voiceState.self_mute === undefined ? this.memberMap[user.id].selfMute : voiceState.self_mute;
|
||||||
this.memberMap[user.id].deaf = voiceState.deaf || this.memberMap[user.id].deaf;
|
this.memberMap[user.id].deaf = voiceState.deaf || this.memberMap[user.id].deaf;
|
||||||
this.memberMap[user.id].selfDeaf = voiceState.self_deaf === undefined ? this.memberMap[user.id].selfDeaf : voiceState.self_deaf;
|
this.memberMap[user.id].selfDeaf = voiceState.self_deaf === undefined ? this.memberMap[user.id].selfDeaf : voiceState.self_deaf;
|
||||||
if (user && channel) {
|
let channel = this.channels.get("id", voiceState.channel_id);
|
||||||
this.eventVoiceJoin(user, channel);
|
if (channel) {
|
||||||
|
this.eventVoiceJoin(user, channel);
|
||||||
|
} else {
|
||||||
|
this.client.emit("warn", "channel doesn't exist even though READY expects them to");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.client.emit("warn", "user doesn't exist even though READY expects them to");
|
this.client.emit("warn", "user doesn't exist even though READY expects them to");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user