From b7cf524e9869828ff85954cb731f7fee98bee8d9 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 31 Aug 2018 12:55:52 +0100 Subject: Give modules event objects with "context"s, to facilitate purging all the event hooks for a module --- modules/thesaurus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/thesaurus.py') diff --git a/modules/thesaurus.py b/modules/thesaurus.py index 2580c191..6f91cec4 100644 --- a/modules/thesaurus.py +++ b/modules/thesaurus.py @@ -5,9 +5,9 @@ import Utils URL_THESAURUS = "http://words.bighugelabs.com/api/2/%s/%s/json" class Module(object): - def __init__(self, bot): + def __init__(self, bot, events): self.bot = bot - bot.events.on("received").on("command").on("synonym", + events.on("received").on("command").on("synonym", "antonym").hook(self.thesaurus, min_args=1, help="Get synonyms/antonyms for a provided phrase", usage=" [type]") -- cgit v1.3.1-10-gc9f91