diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/title.py | |
| parent | Also use docstrings to check if a command has help available, allow one-string (diff) | |
| signature | ||
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/title.py')
| -rw-r--r-- | modules/title.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/title.py b/modules/title.py index 6dc4cc4e..80b450f8 100644 --- a/modules/title.py +++ b/modules/title.py @@ -1,14 +1,14 @@ import re -from src import Utils +from src import ModuleManager, Utils REGEX_URL = re.compile("https?://\S+", re.I) -class Module(object): - def __init__(self, bot, events, exports): - events.on("received.command").on("title", "t").hook(self.title, - help="Get the title of a URL", usage="[URL]") - +class Module(ModuleManager.BaseModule): + @Utils.hook("received.command.title|t", usage="[URL]") def title(self, event): + """ + Get the title of a URL + """ url = None if len(event["args"]) > 0: url = event["args_split"][0] |
