mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
voiceStateUpdate stored per-server, some docs
This commit is contained in:
@@ -1710,22 +1710,7 @@ var InternalClient = (function () {
|
||||
// in voice channel
|
||||
var channel = self.channels.get("id", data.channel_id);
|
||||
if (channel && channel.type === "voice") {
|
||||
var oldState = {
|
||||
mute: user.voiceState.mute,
|
||||
self_mute: user.voiceState.self_mute,
|
||||
deaf: user.voiceState.deaf,
|
||||
self_deaf: user.voiceState.self_deaf
|
||||
};
|
||||
user.voiceState.mute = data.mute;
|
||||
user.voiceState.self_mute = data.self_mute;
|
||||
user.voiceState.deaf = data.deaf;
|
||||
user.voiceState.self_deaf = data.self_deaf;
|
||||
if ((oldState.mute != user.voiceState.mute || oldState.self_mute != user.voiceState.self_mute || oldState.deaf != user.voiceState.deaf || oldState.self_deaf != user.voiceState.self_deaf) && oldState.mute !== undefined) {
|
||||
client.emit("voiceStateUpdate", channel, user, oldState);
|
||||
} else {
|
||||
server.eventVoiceJoin(user, channel);
|
||||
client.emit("voiceJoin", channel, user);
|
||||
}
|
||||
server.eventVoiceStateUpdate(channel, user, data);
|
||||
} else {
|
||||
client.emit("warn", "voice state channel not in cache");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user