Reply if query is empty
This commit is contained in:
parent
23b10a05f7
commit
e9a46a14f8
11
mumbleBot.py
11
mumbleBot.py
@ -374,10 +374,13 @@ class MumbleBot:
|
|||||||
rb_stations = radiobrowser.getstations_byname(parameter)
|
rb_stations = radiobrowser.getstations_byname(parameter)
|
||||||
msg = var.config.get('strings', 'rbqueryresult') + " :"
|
msg = var.config.get('strings', 'rbqueryresult') + " :"
|
||||||
msg += '\n<table><tr><th>ID</th><th>Station Name</th></tr>'
|
msg += '\n<table><tr><th>ID</th><th>Station Name</th></tr>'
|
||||||
for s in rb_stations:
|
if not rb_stations:
|
||||||
msg += '<tr><td>' + s['id'] + '</td><td>' + s['stationname'] + '</td></tr>'
|
self.send_msg('No results for ' + parameter, text)
|
||||||
msg += '</table>'
|
else:
|
||||||
self.send_msg(msg, text)
|
for s in rb_stations:
|
||||||
|
msg += '<tr><td>' + s['id'] + '</td><td>' + s['stationname'] + '</td></tr>'
|
||||||
|
msg += '</table>'
|
||||||
|
self.send_msg(msg, text)
|
||||||
# Play a secific station (by id) from http://www.radio-browser.info API
|
# Play a secific station (by id) from http://www.radio-browser.info API
|
||||||
elif command == var.config.get('command', 'rb_play'):
|
elif command == var.config.get('command', 'rb_play'):
|
||||||
logging.debug('Play a station by ID')
|
logging.debug('Play a station by ID')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user