aboutsummaryrefslogtreecommitdiff
path: root/modules/bitcoin.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/bitcoin.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/bitcoin.py')
-rw-r--r--modules/bitcoin.py12
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)