Stop processing at close

This commit is contained in:
deathbybandaid 2019-05-06 14:41:50 -04:00
parent e54e3666dd
commit d589161481

View File

@ -81,27 +81,30 @@ def trigger_channel_list_initial(bot, trigger):
if "*" in bot.memory['SpiceBot_Channels']['channels']: if "*" in bot.memory['SpiceBot_Channels']['channels']:
del bot.memory['SpiceBot_Channels']['channels']["*"] del bot.memory['SpiceBot_Channels']['channels']["*"]
while 'SpiceBot_Channels' in bot.memory: while True:
time.sleep(1800) try:
oldlist = list(bot.memory['SpiceBot_Channels']['channels'].keys()) time.sleep(1800)
bot.write(['LIST']) oldlist = list(bot.memory['SpiceBot_Channels']['channels'].keys())
bot.memory['SpiceBot_Channels']['ProcessLock'] = True bot.write(['LIST'])
bot.memory['SpiceBot_Channels']['ProcessLock'] = True
while bot.memory['SpiceBot_Channels']['ProcessLock']: while bot.memory['SpiceBot_Channels']['ProcessLock']:
pass pass
newlist = [item.lower() for item in oldlist if item.lower() not in bot.memory['SpiceBot_Channels']['channels']] newlist = [item.lower() for item in oldlist if item.lower() not in bot.memory['SpiceBot_Channels']['channels']]
if "*" in newlist: if "*" in newlist:
newlist.remove("*") newlist.remove("*")
if len(newlist) and bot.config.SpiceBot_Channels.announcenew: if len(newlist) and bot.config.SpiceBot_Channels.announcenew:
bot.osd(["The Following channel(s) are new:", spicemanip.main(newlist, 'andlist')], bot.channels.keys()) bot.osd(["The Following channel(s) are new:", spicemanip.main(newlist, 'andlist')], bot.channels.keys())
join_all_channels(bot) join_all_channels(bot)
chanadmin_all_channels(bot) chanadmin_all_channels(bot)
if "*" in bot.memory['SpiceBot_Channels']['channels']: if "*" in bot.memory['SpiceBot_Channels']['channels']:
del bot.memory['SpiceBot_Channels']['channels']["*"] del bot.memory['SpiceBot_Channels']['channels']["*"]
except KeyError:
return
@sopel.module.event('2001') @sopel.module.event('2001')