aboutsummaryrefslogtreecommitdiff
path: root/modules/ducks.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-26 14:37:26 +0100
committerGravatar jesopo2019-06-26 14:37:41 +0100
commitc5785a2d1484a98616b0fb8b5a7cb728eb094435 (patch)
tree470ace2c509805fb9b723592df196b4e9e0edb46 /modules/ducks.py
parentUpdate IRCBot `except queue.Empty` comment (diff)
signature
implement @utils.kwarg() magic, use it for command.regex hooks
Diffstat (limited to 'modules/ducks.py')
-rw-r--r--modules/ducks.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/ducks.py b/modules/ducks.py
index 6b2f07d6..037c602b 100644
--- a/modules/ducks.py
+++ b/modules/ducks.py
@@ -1,7 +1,7 @@
#--depends-on commands
#--depends-on config
-import random, time
+import random, re, time
from src import EventManager, ModuleManager, utils
DUCK = "・゜゜・。。・゜゜\_o< QUACK!"
@@ -44,12 +44,12 @@ class Module(ModuleManager.BaseModule):
if show_duck:
self._trigger_duck(channel)
- @utils.hook("command.regex", expect_output=False, ignore_action=False)
+ @utils.hook("command.regex")
+ @utils.kwarg("expect_output", False)
+ @utils.kwarg("ignore_action", False)
+ @utils.kwarg("command", "duck-trigger")
+ @utils.kwarg("patern", re.compile(".+"))
def channel_message(self, event):
- """
- :pattern: .+
- :command: duck-trigger
- """
self._activity(event["target"])
def _trigger_duck(self, channel):