diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/bitcoin.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/bitcoin.py')
| -rw-r--r-- | modules/bitcoin.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/bitcoin.py b/modules/bitcoin.py index c85e6bf1..1c88c0bb 100644 --- a/modules/bitcoin.py +++ b/modules/bitcoin.py @@ -1,13 +1,13 @@ -from src import Utils +from src import ModuleManager, Utils -class Module(object): +class Module(ModuleManager.BaseModule): _name = "BTC" - def __init__(self, bot, events, exports): - self.bot = bot - events.on("received.command.btc").hook(self.btc, - help="Get the exchange rate of bitcoins", usage="[currency]") + @Utils.hook("received.command.btc", usage="[currency]") def btc(self, event): + """ + Get the exchange rate of bitcoins + """ currency = (event["args"] or "USD").upper() page = Utils.get_url("https://blockchain.info/ticker", json=True) |
