aboutsummaryrefslogtreecommitdiff
path: root/modules/books.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-08-31 12:55:52 +0100
committerGravatar jesopo2018-08-31 12:55:52 +0100
commit9874f79b498e1f8ae5ebec9a240963e908b645b0 (patch)
treed5d887ac82f3e50f0ea295953981363c1c5e7c5a /modules/books.py
parentMerge pull request #7 from dngfx/master (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.py6
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>")