diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/hash.py | |
| parent | Also 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/hash.py')
| -rw-r--r-- | modules/hash.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/hash.py b/modules/hash.py index e123da9a..4508d613 100644 --- a/modules/hash.py +++ b/modules/hash.py @@ -1,12 +1,12 @@ import hashlib +from src import ModuleManager, Utils -class Module(object): - def __init__(self, bot, events, exports): - self.bot = bot - events.on("received.command.hash").hook(self.hash, min_args=2, - help="Hash a string", usage="<algo> <string>") - +class Module(ModuleManager.BaseModule): + @Utils.hook("received.command.hash", min_args=2, usage="<algo> <string>") def hash(self, event): + """ + Hash a given string with a given algorithm + """ algorithm = event["args_split"][0].lower() if algorithm in hashlib.algorithms_available: phrase = " ".join(event["args_split"][1:]) |
