Send query result to channel
This commit is contained in:
		@@ -371,7 +371,7 @@ class MumbleBot:
 | 
			
		||||
                    logging.info('Found query parameter: ' + parameter)
 | 
			
		||||
                    stations = getstations_byname(parameter)
 | 
			
		||||
                    for s in stations:
 | 
			
		||||
                        msg += "<br />" + s
 | 
			
		||||
                        msg += "<br />" + s['id'] + s['stationname'] + ': '
 | 
			
		||||
                    self.send_msg(msg, text)
 | 
			
		||||
 | 
			
		||||
            elif command == var.config.get('command', 'help'):
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
from rbRadios import RadioBrowser
 | 
			
		||||
from radios import RadioBrowser
 | 
			
		||||
 | 
			
		||||
rb = RadioBrowser()
 | 
			
		||||
 | 
			
		||||
@@ -8,7 +8,7 @@ def getstations_byname(query):
 | 
			
		||||
    for st in results:
 | 
			
		||||
        try:
 | 
			
		||||
            url = rb.playable_station(st['id'])['url']
 | 
			
		||||
            station = {'stationname': st['name'], 'url': url}
 | 
			
		||||
            station = {'stationname': st['name'], 'url': url, 'id':st['id']}
 | 
			
		||||
            stations.append(station)
 | 
			
		||||
        except:
 | 
			
		||||
            pass
 | 
			
		||||
@@ -17,4 +17,4 @@ def getstations_byname(query):
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    r = getstations_byname('r.sh')
 | 
			
		||||
    pass
 | 
			
		||||
    pass
 | 
			
		||||
		Reference in New Issue
	
	Block a user