mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
fantasy: don't error when bots are removed while processing (e.g. on shutdown)
This commit is contained in:
parent
e2747839d1
commit
aacc3149ce
@ -22,7 +22,9 @@ def handle_fantasy(irc, source, command, args):
|
||||
# 3) The message starts with one of our fantasy prefixes.
|
||||
# 4) The sender is NOT a PyLink client (this prevents infinite
|
||||
# message loops).
|
||||
for botname, sbot in world.services.items():
|
||||
for botname, sbot in world.services.copy().items():
|
||||
if botname not in world.services: # Bot was removed during iteration
|
||||
continue
|
||||
log.debug('(%s) fantasy: checking bot %s', irc.name, botname)
|
||||
servuid = sbot.uids.get(irc.name)
|
||||
if servuid in irc.channels[channel].users:
|
||||
|
Loading…
Reference in New Issue
Block a user