Fix decoys stacking up and attempting to take over irc.

This commit is contained in:
dngfx 2018-08-31 14:10:15 +01:00
parent 67d8aceca9
commit 0bb3ae9273

View file

@ -12,6 +12,7 @@ class Module(object):
self.bot = bot
self.events = events
self.active_duck = 0
self.decoy_hooked = 0
events.on("received.command.bef").hook(self.duck_bef,
help="Befriend a duck!")
@ -199,7 +200,11 @@ class Module(object):
channel = event["target"]
next_decoy_time = self.decoy_time()
self.events.on("timer").on("duck-decoy").hook(self.duck_decoy)
if self.decoy_hooked == 0:
self.events.on("timer").on("duck-decoy").hook(self.duck_decoy)
self.decoy_hooked = 1
self.bot.add_timer("duck-decoy", next_decoy_time, None, None, False,
channel=channel)