aboutsummaryrefslogtreecommitdiff
path: root/modules/quotes.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-08-31 12:55:52 +0100
committerGravatar dongfix2018-08-31 13:44:39 +0100
commitb7cf524e9869828ff85954cb731f7fee98bee8d9 (patch)
treed5d887ac82f3e50f0ea295953981363c1c5e7c5a /modules/quotes.py
parentRevert "Reformat" (diff)
signature
Give modules event objects with "context"s, to facilitate purging all the event
hooks for a module
Diffstat (limited to 'modules/quotes.py')
-rw-r--r--modules/quotes.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/quotes.py b/modules/quotes.py
index d09bba58..69b1d79b 100644
--- a/modules/quotes.py
+++ b/modules/quotes.py
@@ -1,21 +1,21 @@
import random, time
class Module(object):
- def __init__(self, bot):
+ def __init__(self, bot, events):
self.bot = bot
- bot.events.on("received").on("command").on("quoteadd",
+ events.on("received").on("command").on("quoteadd",
"qadd").hook(self.quote_add, min_args=1,
help="Added a quote to a category",
usage="<category> = <quote>")
- bot.events.on("received").on("command").on("quoteget",
+ events.on("received").on("command").on("quoteget",
"qget").hook(self.quote_get, min_args=1,
help="Find a quote within a category",
usage="<category> = <search>")
- bot.events.on("received").on("command").on("quotedel",
+ events.on("received").on("command").on("quotedel",
"qdel").hook(self.quote_del, min_args=1,
help="Delete a quote from a category",
usage="<category> = <quote>")
- bot.events.on("received").on("command").on("quote",
+ events.on("received").on("command").on("quote",
"q").hook(self.quote, min_args=1,
help="Get a random quote from a category",
usage="<category>")