diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/shakespeare.py | |
| parent | Also use docstrings to check if a command has help available, allow one-string (diff) | |
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/shakespeare.py')
| -rw-r--r-- | modules/shakespeare.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/shakespeare.py b/modules/shakespeare.py index bc4a9900..99d4ba2d 100644 --- a/modules/shakespeare.py +++ b/modules/shakespeare.py @@ -1,5 +1,5 @@ import random -from src import Utils +from src import ModuleManager, Utils INSULT_INTRO = ["Thou art a", "Ye", "Thou", "Thy", "Thee"] @@ -51,14 +51,8 @@ INSULT_PART_3 = ["apple-john", "baggage", "barnacle", "bladder", "boar-pig", "vassal", "whey-face", "wagtail"] -class Module(object): - - def __init__(self, bot, events, exports): - self.bot = bot - self.events = events - - events.on("received.command.insult").hook(self.dispense_insult) - +class Module(ModuleManager.BaseModule): + @Utils.hook("received.command.insult") def dispense_insult(self, event): insult = [random.choice(INSULT_INTRO), random.choice(INSULT_PART_1), random.choice(INSULT_PART_2), random.choice(INSULT_PART_3)] |
