From c5785a2d1484a98616b0fb8b5a7cb728eb094435 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 26 Jun 2019 14:37:26 +0100 Subject: implement @utils.kwarg() magic, use it for command.regex hooks --- modules/title.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'modules/title.py') diff --git a/modules/title.py b/modules/title.py index 184b3393..a6e924cc 100644 --- a/modules/title.py +++ b/modules/title.py @@ -47,13 +47,12 @@ class Module(ModuleManager.BaseModule): else: return None - @utils.hook("command.regex", ignore_action=False, - priority=EventManager.PRIORITY_MONITOR) + @utils.hook("command.regex") + @utils.kwarg("ignore_action", False) + @utils.kwarg("priority", EventManager.PRIORITY_MONITOR) + @utils.kwarg("command", "title") + @utils.kwarg("pattern", utils.http.REGEX_URL) def channel_message(self, event): - """ - :command: title - :pattern-url: 1 - """ if event["target"].get_setting("auto-title", False): event.eat() url = event["match"].group(0) -- cgit v1.3.1-10-gc9f91