Basic fixes, added test script

This commit is contained in:
hydrabolt
2015-11-07 22:02:33 +00:00
parent 67d5f9d63e
commit 0dfc747b1b
5 changed files with 95 additions and 75 deletions

View File

@@ -25,6 +25,7 @@ var VoiceConnection = (function (_EventEmitter) {
if (!Opus) {
console.log("HEY! WATCH OUT\n\n discord.js needs node-opus, you don't have it installed.");
}
this.id = channel.id;
this.voiceChannel = channel;
this.client = client;
this.session = session;
@@ -64,13 +65,13 @@ var VoiceConnection = (function (_EventEmitter) {
if (self.playingIntent) {
self.stopPlaying();
}
self.playing = true;
var retStream = new StreamIntent();
var onWarning = false;
self.playingIntent = retStream;
function send() {
if (!self.playingIntent) {
if (!self.playingIntent || !self.playing) {
self.setSpeaking(false);
retStream.emit("end");
return;