diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 0788374c3..a2e10c6b0 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -2083,9 +2083,11 @@ var InternalClient = (function () { client.emit("warn", "voice state update but user or server not in cache"); } - if (connection) { + if (user.id === self.user.id) { + // only for detecting self user movements for connections. + var connection = self.voiceConnections.get("server", server); // existing connection, perhaps channel moved - if (connection.voiceChannel.id !== data.channel_id) { + if (connection && connection.voiceChannel.id !== data.channel_id) { // moved, update info connection.voiceChannel = self.channels.get("id", data.channel_id); client.emit("voiceMoved", connection.voiceChannel); // Moved to a new channel diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index 2eaaa44ab..931b49927 100644 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -1771,9 +1771,10 @@ export default class InternalClient { client.emit("warn", "voice state update but user or server not in cache"); } - if (connection) { + if (user.id === self.user.id) { // only for detecting self user movements for connections. + var connection = self.voiceConnections.get("server", server); // existing connection, perhaps channel moved - if (connection.voiceChannel.id !== data.channel_id) { + if (connection && connection.voiceChannel.id !== data.channel_id) { // moved, update info connection.voiceChannel = self.channels.get("id", data.channel_id); client.emit("voiceMoved", connection.voiceChannel); // Moved to a new channel