diff --git a/modules/commands.py b/modules/commands.py index f0068c57..9df70ffc 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -29,7 +29,8 @@ class Out(object): ].decode("utf8").lstrip()) else: self._text = "" - self.target.send_message(text, prefix="[%s] " % self.prefix()) + self.target.send_message(text, prefix=Utils.FONT_RESET + "[%s] " % + self.prefix()) def set_prefix(self, prefix): self.module_name = prefix def has_text(self): diff --git a/modules/ducks.py b/modules/ducks.py index 7fa32910..ebef9006 100644 --- a/modules/ducks.py +++ b/modules/ducks.py @@ -100,6 +100,7 @@ class Module(object): def clear_ducks(self, channel): rand_time = self.generate_next_duck_time() + del channel.games["ducks"] channel.games["ducks"] = {'messages': 0, 'duck_spawned': 0, 'unique_users': [], 'next_duck_time': rand_time, @@ -126,10 +127,11 @@ class Module(object): rand_time = random.randint(int(time()) + 1, int(time()) + 2) return rand_time - def is_duck_visible(self, event): + def is_duck_visible(self, event, decoy=False): channel = event["target"] - visible = channel.games["ducks"]["duck_spawned"] + visible = channel.games["ducks"]["decoy_spawned"] if \ + decoy else channel.games["ducks"]["duck_spawned"] return visible def should_kick(self, event): @@ -259,11 +261,12 @@ class Module(object): if self.is_duck_channel(channel) == False: return - if self.is_duck_visible(event) == False: + if self.is_duck_visible(event, False) == False: if self.should_kick(event): self.kick_bef(event) - self.clear_ducks(channel) event.eat() + + self.clear_ducks(channel) return channel.games["ducks"][ @@ -293,11 +296,12 @@ class Module(object): if self.is_duck_channel(channel) == False: return - if self.is_duck_visible(event) == False: + if self.is_duck_visible(event, False) == False: if self.should_kick(event): self.kick_bang(event) - self.clear_ducks(channel) event.eat() + + self.clear_ducks(channel) return channel.games["ducks"][