mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
Stop processing at close
This commit is contained in:
parent
e54e3666dd
commit
d589161481
@ -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')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user