for newline in lines:
msg += br
br = linebreak
- if (len(msg) + len(newline)) > (bot.mumble.get_max_message_length() - 4) != 0: # 4 == len("<br>")
+ if bot.mumble.get_max_message_length()\
+ and (len(msg) + len(newline)) > (bot.mumble.get_max_message_length() - 4): # 4 == len("<br>")
bot.send_msg(msg, text)
msg = ""
msg += newline
var.cache.free_and_delete(id)
var.playlist.remove_by_id(id)
else:
- if var.playlist.current_item().type == 'url':
+ if var.playlist.current_item() and var.playlist.current_item().type == 'url':
item = var.playlist.current_item().item()
bot.mumble.users[text.actor].send_text_message(util.url_ban(util.get_url_from_input(item.url)))
var.cache.free_and_delete(item.id)
# the one you want
var.playlist.point_to(int(parameter) - 1 - 1)
- bot.interrupt()
+ if not bot.is_pause:
+ bot.interrupt()
+ else:
+ bot.is_pause = False
else:
bot.send_msg(constants.strings('invalid_index', index=parameter), text)
global log
bot.stop()
+ if var.playlist.mode == "one-shot":
+ var.playlist.clear()
+
if bot.channel:
bot.mumble.channels.find_by_name(bot.channel).move_in()
index = int(parameter) - 1
if index == var.playlist.current_index:
- removed = var.playlist.remove(index)
+ removed = var.playlist[index]
+ bot.send_msg(constants.strings('removing_item',
+ item=removed.format_short_string()), text)
+ log.info("cmd: delete from playlist: " + removed.format_debug_string())
+
+ var.playlist.remove(index)
if index < len(var.playlist):
if not bot.is_pause:
if not bot.is_pause:
bot.interrupt()
else:
- removed = var.playlist.remove(index)
-
- bot.send_msg(constants.strings('removing_item',
- item=removed.format_short_string()), text)
+ var.playlist.remove(index)
- log.info("cmd: delete from playlist: " + removed.format_debug_string())
else:
bot.send_msg(constants.strings('bad_parameter', command=command), text)