This commit is contained in:
reality 2014-09-18 03:33:40 +00:00
parent 6b52141245
commit 9733fa6185

View File

@ -21,6 +21,7 @@ var radio = function(dbot) {
stream.on('response', function(res) { stream.on('response', function(res) {
this.data = res.headers; this.data = res.headers;
if(res.headers['icy-name']) {
_.each(this.config.announce, function(a) { _.each(this.config.announce, function(a) {
dbot.say(a.server, a.name, dbot.t('now_online', { dbot.say(a.server, a.name, dbot.t('now_online', {
'name': res.headers['icy-name'], 'name': res.headers['icy-name'],
@ -28,6 +29,7 @@ var radio = function(dbot) {
'url': res.headers['icy-url'] 'url': res.headers['icy-url']
})); }));
}); });
}
}.bind(this)); }.bind(this));
stream.on('metadata', function(metadata) { stream.on('metadata', function(metadata) {