Implement Receiver debug events

This commit is contained in:
Amish Shah
2018-01-19 22:47:01 +00:00
parent 83140f11b7
commit cb161a8a40
4 changed files with 11 additions and 11 deletions

View File

@@ -7,6 +7,12 @@ class VoiceReceiver extends EventEmitter {
super();
this.connection = connection;
this.packets = new PacketHandler(this);
/**
* Emitted whenever there is a warning
* @event VoiceReceiver#debug
* @param {Error|string} error The error or message to debug
*/
this.packets.on('error', err => this.emit('debug', err));
this.connection.sockets.udp.socket.on('message', buffer => this.packets.push(buffer));
}
@@ -21,10 +27,6 @@ class VoiceReceiver extends EventEmitter {
}
return stream;
}
stoppedSpeaking() {
return false;
}
}
module.exports = VoiceReceiver;