aboutsummaryrefslogtreecommitdiff
path: root/modules/title.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-26 18:27:17 +0100
committerGravatar jesopo2018-09-26 18:27:17 +0100
commit51a52e2b0e54031cce5876f54d1d48c268b5441c (patch)
treea4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/title.py
parentAlso 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.py12
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]