diff options
| author | 2019-06-26 14:37:26 +0100 | |
|---|---|---|
| committer | 2019-06-26 14:37:41 +0100 | |
| commit | c5785a2d1484a98616b0fb8b5a7cb728eb094435 (patch) | |
| tree | 470ace2c509805fb9b723592df196b4e9e0edb46 /modules/imgur.py | |
| parent | Update IRCBot `except queue.Empty` comment (diff) | |
| signature | ||
implement @utils.kwarg() magic, use it for command.regex hooks
Diffstat (limited to 'modules/imgur.py')
| -rw-r--r-- | modules/imgur.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/imgur.py b/modules/imgur.py index 2cccaac6..fd68ed00 100644 --- a/modules/imgur.py +++ b/modules/imgur.py @@ -28,19 +28,20 @@ class Module(ModuleManager.BaseModule): text += "%s " % data["account_url"] return text - @utils.hook("command.regex", pattern=REGEX_IMAGE, ignore_action=False) + @utils.hook("command.regex") + @utils.kwarg("ignore_action", False) + @utils.kwarg("command", "imgur") + @utils.kwarg("pattern", REGEX_IMAGE) def _regex_image(self, event): - """ - :command: imgur - """ if event["target"].get_setting("auto-imgur", False): event["stdout"].write(self._parse_image(event["match"].group(1))) event.eat() - @utils.hook("command.regex", pattern=REGEX_GALLERY, ignore_action=False) + + @utils.hook("command.regex") + @utils.kwarg("ignore_action", False) + @utils.kwarg("command", "imgur") + @utils.kwarg("pattern", REGEX_GALLERY) def _regex_gallery(self, event): - """ - :command: imgur - """ if event["target"].get_setting("auto-imgur", False): event["stdout"].write(self._parse_gallery(event["match"].group(1))) event.eat() |
