shutdown method breaks

This commit is contained in:
deathbybandaid 2019-05-06 14:36:09 -04:00
parent f65212c2c3
commit e54e3666dd
2 changed files with 20 additions and 14 deletions

View File

@ -50,16 +50,19 @@ def bot_events_connected(bot, trigger):
bot_events_setup_check(bot) bot_events_setup_check(bot)
while 'SpiceBot_Events' in bot.memory: while True:
if len(bot.memory['SpiceBot_Events']["queue"]): try:
number = bot.memory['SpiceBot_Events']["queue"][0]["number"] if len(bot.memory['SpiceBot_Events']["queue"]):
message = bot.memory['SpiceBot_Events']["queue"][0]["message"] number = bot.memory['SpiceBot_Events']["queue"][0]["number"]
pretrigger = PreTrigger( message = bot.memory['SpiceBot_Events']["queue"][0]["message"]
bot.nick, pretrigger = PreTrigger(
":SpiceBot_Events " + str(number) + " " + str(bot.nick) + " :" + message bot.nick,
) ":SpiceBot_Events " + str(number) + " " + str(bot.nick) + " :" + message
bot.dispatch(pretrigger) )
del bot.memory['SpiceBot_Events']["queue"][0] bot.dispatch(pretrigger)
del bot.memory['SpiceBot_Events']["queue"][0]
except KeyError:
return
@sopel.module.event('1004') @sopel.module.event('1004')

View File

@ -53,10 +53,13 @@ def join_log_channel(bot, trigger):
bot_logs_setup_check(bot) bot_logs_setup_check(bot)
while 'SpiceBot_Logs' in bot.memory: while True:
if len(bot.memory['SpiceBot_Logs']["queue"]): try:
bot.say(str(bot.memory['SpiceBot_Logs']["queue"][0]), channel) if len(bot.memory['SpiceBot_Logs']["queue"]):
del bot.memory['SpiceBot_Logs']["queue"][0] bot.say(str(bot.memory['SpiceBot_Logs']["queue"][0]), channel)
del bot.memory['SpiceBot_Logs']["queue"][0]
except KeyError:
return
@sopel.module.event('2004') @sopel.module.event('2004')