diff options
| author | 2019-06-26 14:37:26 +0100 | |
|---|---|---|
| committer | 2019-06-26 14:37:41 +0100 | |
| commit | c5785a2d1484a98616b0fb8b5a7cb728eb094435 (patch) | |
| tree | 470ace2c509805fb9b723592df196b4e9e0edb46 /modules/ducks.py | |
| parent | Update 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.py | 12 |
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): |
