From 51a52e2b0e54031cce5876f54d1d48c268b5441c Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 26 Sep 2018 18:27:17 +0100 Subject: Switch to using @Utils.hook and docstrings for event hooks --- modules/title.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/title.py') 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] -- cgit v1.3.1-10-gc9f91