diff --git a/mumbleBot.py b/mumbleBot.py index 763f048..e669f71 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -389,7 +389,7 @@ class MumbleBot: msg += '
!rbplay ID | Station Name |
---|---|
{stationid} | {stationname} | ' msg += '
%s | %s | ' % (stationid, stationname) - if len(msg) < 5000: + self.send_msg(msg, text) + else: + logging.debug('Result too long stage II') + msg = var.config.get('strings', 'rbqueryresult') + " :" + ' (shortened L2)' + msg += '!rbplay ID - Station Name' + for s in rb_stations: + stationid = s['id'] + stationname = s['stationname'][:12] + # msg += f'{stationid} - {stationname}' + msg += '%s - %s' % (stationid, stationname) + if len(msg) <= 5000: self.send_msg(msg, text) else: - logging.debug('Result too long stage II') - msg = var.config.get('strings', 'rbqueryresult') + " :" + ' (shortened L2)' - msg += '!rbplay ID - Station Name' - for s in rb_stations: - stationid = s['id'] - stationname = s['stationname'][:12] - # msg += f'{stationid} - {stationname}' - msg += '%s - %s' % (stationid, stationname) - if len(msg) < 5000: - self.send_msg(msg, text) - else: - self.send_msg('Query result too long to post (> 5000 characters), please try another query.', text) + self.send_msg('Query result too long to post (> 5000 characters), please try another query.', text) # Play a secific station (by id) from http://www.radio-browser.info API elif command == var.config.get('command', 'rb_play'): logging.debug('Play a station by ID')