X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/ba9320289e158c2d3b8461fe6b2f97e0ee60cccd..4477123de1254afa80243f7f9eab62c5cbf7b786:/modules/coins.py diff --git a/modules/coins.py b/modules/coins.py index c5d99ab..8653667 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -1,4 +1,5 @@ # Erebus IRC bot - Author: Erebus Team +# vim: fileencoding=utf-8 # simple coin module # This file is released into the public domain; see http://unlicense.org/ @@ -6,8 +7,9 @@ modinfo = { 'author': 'Erebus Team', 'license': 'public domain', - 'compatible': [1], # compatible module API versions - 'depends': [], # other modules required to work properly? + 'compatible': [0], + 'depends': [], + 'softdeps': [], } # preamble @@ -35,8 +37,8 @@ def get_coin_price(pairs): response = requests.post(url, data = {'pairs': pairs}) return json.loads(response.text) -@lib.hook('btc') -def cmd_gtest(bot, user, chan, realtarget, *args): +@lib.hook() +def btc(bot, user, chan, realtarget, *args): if len(args) > 0: try: response = get_coin_price('btc_eur') @@ -49,8 +51,8 @@ def cmd_gtest(bot, user, chan, realtarget, *args): price = str(float(response[0]['price'])) bot.msg(chan, "1 BTC = %s EUR" % price) -@lib.hook('doge') -def cmd_gtest(bot, user, chan, realtarget, *args): +@lib.hook() +def doge(bot, user, chan, realtarget, *args): if len(args) > 0: try: doge_btc = get_coin_price('doge_btc') @@ -65,8 +67,8 @@ def cmd_gtest(bot, user, chan, realtarget, *args): price = str(float(doge_btc[0]['price']) * float(btc_eur[0]['price'])) bot.msg(chan, "1 DOGE = %s EUR" % price) -@lib.hook('ltc') -def cmd_gtest(bot, user, chan, realtarget, *args): +@lib.hook() +def ltc(bot, user, chan, realtarget, *args): if len(args) > 0: try: ltc_btc = get_coin_price('ltc_btc') @@ -99,9 +101,6 @@ def privmsg_hook(bot, line): a = a.replace(",", ".") a = a.replace(" ", "") - print a - print f - print t if 'btc' in line or 'bitcoin' in line or 'doge' in line or 'dogecoin' in line: for r in coin_regex: @@ -127,7 +126,3 @@ def privmsg_hook(bot, line): bot.msg(chan, "%s DOGE = %s EUR" % (amount, price)) except: bot.msg(chan, "Invalid amount.") - - - print amount - print coin