mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
serverMemberUpdated clarification and crash fix
This commit is contained in:
@@ -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
|
||||
~~~~~~~~
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user