Voice States in READY packet now processed

Now there is full watching and coverage of voice states
This commit is contained in:
Amish Shah
2015-12-26 15:54:45 +00:00
parent 9c0e20947c
commit 9d97dfc95a
3 changed files with 61 additions and 18 deletions

View File

@@ -69,6 +69,18 @@ export default class Server extends Equality {
}
}
}
if (data.voice_states) {
for (var voiceState of data.voice_states) {
let user = this.members.get("id", voiceState.user_id);
let channel = this.channels.get("id", voiceState.channel_id);
if (user && channel) {
this.eventStartSpeaking(user, channel);
} else {
this.client.emit("warn", "user doesn't exist even though READY expects them to");
}
}
}
}
detailsOf(user) {