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/thesaurus.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/thesaurus.py') diff --git a/modules/thesaurus.py b/modules/thesaurus.py index 9328a330..3791d609 100644 --- a/modules/thesaurus.py +++ b/modules/thesaurus.py @@ -7,11 +7,13 @@ URL_THESAURUS = "http://words.bighugelabs.com/api/2/%s/%s/json" class Module(object): def __init__(self, bot, events, exports): self.bot = bot - events.on("received.command").on("synonym", "antonym").hook( - self.thesaurus, min_args=1, usage=" [type]", - help="Get synonyms/antonyms for a provided phrase") + @Utils.hook("received.command.synonym|antonym", min_args=1, + usage=" [type]") def thesaurus(self, event): + """ + Get synonyms/antonyms for a provided phrase + """ phrase = event["args_split"][0] page = Utils.get_url(URL_THESAURUS % (self.bot.config[ "bighugethesaurus-api-key"], phrase), json=True) -- cgit v1.3.1-10-gc9f91