diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/wolframalpha.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/wolframalpha.py')
| -rw-r--r-- | modules/wolframalpha.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/wolframalpha.py b/modules/wolframalpha.py index 90bff060..6415639c 100644 --- a/modules/wolframalpha.py +++ b/modules/wolframalpha.py @@ -8,12 +8,12 @@ class Module(object): _name = "Wolfram|Alpha" def __init__(self, bot, events, exports): self.bot = bot - events.on("received.command").on("wolframalpha", "wa" - ).hook(self.wa, min_args=1, help= - "Evauate a given string on Wolfram|Alpha", - usage="<query>") + @Utils.hook("received.command.wolframalpha|wa", min_args=1, usage="<query>") def wa(self, event): + """ + Evauate a given string on Wolfram|Alpha + """ code, result = Utils.get_url(URL_WA, get_params={"i": event["args"], "appid": self.bot.config["wolframalpha-api-key"], "reinterpret": "true", "units": "metric"}, code=True) |
