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