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)
while 'SpiceBot_Events' in bot.memory:
if len(bot.memory['SpiceBot_Events']["queue"]):
number = bot.memory['SpiceBot_Events']["queue"][0]["number"]
message = bot.memory['SpiceBot_Events']["queue"][0]["message"]
pretrigger = PreTrigger(
bot.nick,
":SpiceBot_Events " + str(number) + " " + str(bot.nick) + " :" + message
)
bot.dispatch(pretrigger)
del bot.memory['SpiceBot_Events']["queue"][0]
while True:
try:
if len(bot.memory['SpiceBot_Events']["queue"]):
number = bot.memory['SpiceBot_Events']["queue"][0]["number"]
message = bot.memory['SpiceBot_Events']["queue"][0]["message"]
pretrigger = PreTrigger(
bot.nick,
":SpiceBot_Events " + str(number) + " " + str(bot.nick) + " :" + message
)
bot.dispatch(pretrigger)
del bot.memory['SpiceBot_Events']["queue"][0]
except KeyError:
return
@sopel.module.event('1004')

View File

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