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/books.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/books.py') diff --git a/modules/books.py b/modules/books.py index 5f7c0627..9c94c656 100644 --- a/modules/books.py +++ b/modules/books.py @@ -7,12 +7,12 @@ REGEX_BOOKID = re.compile("id=([\w\-]+)") class Module(object): _name = "ISBN" - def __init__(self, bot): + def __init__(self, bot, events): self.bot = bot - bot.events.on("received").on("command").on("isbn").hook( + events.on("received").on("command").on("isbn").hook( self.isbn, help="Get book information from a provided ISBN", min_args=1, usage="") - bot.events.on("received").on("command").on("book").hook( + events.on("received").on("command").on("book").hook( self.book, help="Get book information from a provided title", min_args=1, usage="") -- cgit v1.3.1-10-gc9f91