aboutsummaryrefslogtreecommitdiff
path: root/modules/quit.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-26 18:27:17 +0100
committerGravatar jesopo2018-09-26 18:27:17 +0100
commit51a52e2b0e54031cce5876f54d1d48c268b5441c (patch)
treea4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/quit.py
parentAlso use docstrings to check if a command has help available, allow one-string (diff)
signature
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/quit.py')
-rw-r--r--modules/quit.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/quit.py b/modules/quit.py
index 5d40a718..817bb041 100644
--- a/modules/quit.py
+++ b/modules/quit.py
@@ -1,4 +1,5 @@
import random
+from src import ModuleManager, Utils
QUOTES = {
"You can build a throne with bayonets, but it's difficult to sit on it." : "Boris Yeltsin",
@@ -54,10 +55,8 @@ QUOTES = {
"I don’t need to understand how encryption works" : "Amber Rudd",
}
-class Module(object):
- def __init__(self, bot, events, exports):
- events.on("get.quit-quote").hook(self.quote)
-
+class Module(ModuleManager.BaseModule):
+ @Utils.hook("get.quit-quote")
def quote(self, event):
quote = random.choice(list(QUOTES.items()))
return (" - " if quote[1] else "").join(quote)