aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-05 14:18:41 +0100
committerGravatar jesopo2019-06-05 14:18:41 +0100
commit7e3375cfbd099915d80e9485bf9e423a13372ecb (patch)
tree110081cf9a7c8c4d37dd5c66f48e47f00d3fcd0d
parentDon't count JOINs towards duck-triggering messages (diff)
signature
Change duck-triggering to be through regex commands that catch ALL messages;
this will make is-silenced and ignores work automatically
-rw-r--r--modules/ducks.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/ducks.py b/modules/ducks.py
index 5a3d02db..ce4af8ca 100644
--- a/modules/ducks.py
+++ b/modules/ducks.py
@@ -44,16 +44,15 @@ class Module(ModuleManager.BaseModule):
if show_duck:
self._trigger_duck(channel)
- @utils.hook("received.message.channel",
- priority=EventManager.PRIORITY_MONITOR)
+ @utils.hook("command.regex")
def channel_message(self, event):
- self._activity(event["channel"])
+ """
+ :pattern: .+
+ :command: duck-trigger
+ """
+ self._activity(event["target"])
def _trigger_duck(self, channel):
- is_silenced_f = self.exports.get_one("is-silenced", lambda _: False)
- if is_silenced_f(channel):
- return
-
channel.duck_lines = 0
channel.duck_active = True
channel.send_message(DUCK)