bootstrap old channels for ducks.py
This commit is contained in:
parent
5bfffc25e9
commit
2fd92ce2fa
1 changed files with 9 additions and 2 deletions
|
@ -15,11 +15,18 @@ NO_DUCK = "There was no duck!"
|
|||
class Module(ModuleManager.BaseModule):
|
||||
@utils.hook("new.channel")
|
||||
def new_channel(self, event):
|
||||
self.bootstrap_channel(event["channel"])
|
||||
|
||||
def bootstrap_channel(self, channel):
|
||||
if not hasattr(event["channel"], "duck_active"):
|
||||
event["channel"].duck_active = False
|
||||
event["channel"].duck_lines = 0
|
||||
|
||||
def _activity(self, channel):
|
||||
self.bootstrap_channel(channel)
|
||||
|
||||
ducks_enabled = channel.get_setting("ducks-enabled", False)
|
||||
|
||||
if ducks_enabled and not channel.duck_active:
|
||||
channel.duck_lines += 1
|
||||
min_lines = channel.get_setting("ducks-min-messages", 20)
|
||||
|
|
Loading…
Reference in a new issue