diff options
| author | 2018-08-31 12:55:52 +0100 | |
|---|---|---|
| committer | 2018-08-31 13:44:39 +0100 | |
| commit | b7cf524e9869828ff85954cb731f7fee98bee8d9 (patch) | |
| tree | d5d887ac82f3e50f0ea295953981363c1c5e7c5a /modules/books.py | |
| parent | Revert "Reformat" (diff) | |
Give modules event objects with "context"s, to facilitate purging all the event
hooks for a module
Diffstat (limited to 'modules/books.py')
| -rw-r--r-- | modules/books.py | 6 |
1 files changed, 3 insertions, 3 deletions
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="<isbn>") - 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="<book title>") |
