Handle result message > 5000 chars
This commit is contained in:
parent
9201937728
commit
9df4d98d12
@ -388,7 +388,10 @@ class MumbleBot:
|
|||||||
homepage = s['homepage']
|
homepage = s['homepage']
|
||||||
msg += f'<tr><td>{stationid}</td><td>{stationname}</td><td>{genre}</td><td>{codec}/{bitrate}</td><td>{country}</td><td>{homepage}/</td></tr>'
|
msg += f'<tr><td>{stationid}</td><td>{stationname}</td><td>{genre}</td><td>{codec}/{bitrate}</td><td>{country}</td><td>{homepage}/</td></tr>'
|
||||||
msg += '</table>'
|
msg += '</table>'
|
||||||
|
if len(msg) < 5000:
|
||||||
self.send_msg(msg, text)
|
self.send_msg(msg, text)
|
||||||
|
else:
|
||||||
|
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
|
# 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