3
0
mirror of https://github.com/reality/dbot.git synced 2025-01-11 20:42:37 +01:00

fix the radio

This commit is contained in:
reality 2014-02-20 17:38:58 +00:00
parent 3beee89f00
commit 9ec94c889a

View File

@ -42,24 +42,22 @@ var radio = function(dbot) {
}.bind(this));
stream.on('end', function() {
this.stream.end();
this.listening = false;
}.bind(this));
}.bind(this),
'getRadio': function() {
dbot.api.timers.addTimer(20000, function() {
if(this.listening == false) {
this.internalAPI.startRadio();
}
}.bind(this));
}.bind(this)
};
this.onLoad = function() {
this.internalAPI.getRadio();
this.internalAPI.startRadio();
dbot.api.timers.addTimer(20000, function() {
if(this.listening == false) {
this.internalAPI.startRadio();
}
}.bind(this));
}.bind(this);
this.onDestroy = function() {
this.stream.abort();
this.stream.end();
this.stream.destroy();
}.bind(this);
};