From 9874f79b498e1f8ae5ebec9a240963e908b645b0 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/wolframalpha.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/wolframalpha.py') diff --git a/modules/wolframalpha.py b/modules/wolframalpha.py index 059408d7..32de1e58 100644 --- a/modules/wolframalpha.py +++ b/modules/wolframalpha.py @@ -8,12 +8,12 @@ REGEX_CHARHEX = re.compile("\\\\:(\S{4})") class Module(object): _name = "Wolfram|Alpha" - def __init__(self, bot): - bot.events.on("received").on("command").on("wolframalpha", "wa" + def __init__(self, bot, events): + self.bot = bot + events.on("received").on("command").on("wolframalpha", "wa" ).hook(self.wa, min_args=1, help= "Evauate a given string on Wolfram|Alpha", usage="") - self.bot = bot def wa(self, event): soup = Utils.get_url(URL_WA, get_params={"input": event["args"], -- cgit v1.3.1-10-gc9f91