voice: replace self.xyz events

This commit is contained in:
Amish Shah
2019-02-11 18:03:35 +00:00
parent 810b5a5f71
commit 375706beac
3 changed files with 2 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ class VoiceStateUpdate extends Action {
// Emit event
if (member && member.user.id === client.user.id && data.channel_id) {
client.emit('debug', `[VOICE] received voice state update: ${JSON.stringify(data)}`);
client.emit('self.voiceStateUpdate', data);
client.voice.onVoiceStateUpdate(data);
}
/**

View File

@@ -22,9 +22,6 @@ class ClientVoiceManager {
* @type {Collection<Snowflake, VoiceConnection>}
*/
this.connections = new Collection();
this.client.on('self.voiceServer', this.onVoiceServer.bind(this));
this.client.on('self.voiceStateUpdate', this.onVoiceStateUpdate.bind(this));
}
onVoiceServer({ guild_id, token, endpoint }) {

View File

@@ -2,5 +2,5 @@
module.exports = (client, packet) => {
client.emit('debug', `[VOICE] received voice server: ${JSON.stringify(packet)}`);
client.emit('self.voiceServer', packet.d);
client.voice.onVoiceServer(packet.d);
};