serverMemberUpdated clarification and crash fix

This commit is contained in:
abalabahaha
2016-05-17 22:31:35 -07:00
parent 43b1cc1d56
commit e1808804c9
3 changed files with 3 additions and 3 deletions

View File

@@ -869,7 +869,7 @@ Emitted when a member is removed from a server. Supplies a Server_ object and a
serverMemberUpdated
~~~~~~~~~~~~~~~~~~~
Emitted when a member in a server is updated. Supplies a Server_ object and 2 User_ objects, the first being the new, updated user, the second being the old one.
Emitted when a member in a server is updated. Supplies a Server_ object and 2 User_ objects, the first being the new, updated user, the second being the old one. The old user object could be null if the bot didn't previously have the member cached.
presence
~~~~~~~~

View File

@@ -2252,7 +2252,7 @@ var InternalClient = (function () {
// only for detecting self user movements for connections.
var connection = self.voiceConnections.get("server", server);
// existing connection, perhaps channel moved
if (connection && connection.voiceChannel.id !== data.channel_id) {
if (connection && connection.voiceChannel && 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

View File

@@ -1957,7 +1957,7 @@ export default class InternalClient {
if (user && 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 && connection.voiceChannel.id !== data.channel_id) {
if (connection && connection.voiceChannel && 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