Libraries refactor and add some sinks #4

Closed
m wants to merge 136 commits from library-refactor into master
1 changed files with 7 additions and 5 deletions
Showing only changes of commit 38425173b9 - Show all commits

View File

@ -1,6 +1,8 @@
# Other library imports # Other library imports
from json import dumps from json import dumps, loads
# Project imports
from settings import settings
class IRCCommands(object): class IRCCommands(object):
class trades(object): class trades(object):
@ -26,7 +28,7 @@ class IRCCommands(object):
class create(object): class create(object):
name = "create" name = "create"
authed = True authed = True
helptext = "Create an ad. Usage: create <country> <currency>" helptext = "Create an ad. Usage: create <XMR/BTC> <country> <currency>"
@staticmethod @staticmethod
def run(cmd, spl, length, authed, msg, agora, revolut, tx): def run(cmd, spl, length, authed, msg, agora, revolut, tx):
@ -89,7 +91,7 @@ class IRCCommands(object):
if x["success"]: if x["success"]:
msg(f"{x['response']['data']['message']}: {x['response']['data']['ad_id']}") msg(f"{x['response']['data']['message']}: {x['response']['data']['ad_id']}")
else: else:
msg(x["response"]["data"]["message"]) msg(dumps(x["response"]))
# class brute(object): # class brute(object):
# name = "brute" # name = "brute"
@ -198,7 +200,7 @@ class IRCCommands(object):
if not agora_wallet_xmr["success"]: if not agora_wallet_xmr["success"]:
msg("Error getting Agora XMR balance.") msg("Error getting Agora XMR balance.")
return return
agora_wallet_btc = agora.agora.wallet_balance_btc() agora_wallet_btc = agora.agora.wallet_balance()
if not agora_wallet_btc["success"]: if not agora_wallet_btc["success"]:
msg("Error getting Agora BTC balance.") msg("Error getting Agora BTC balance.")
return return
@ -371,7 +373,7 @@ class IRCCommands(object):
@staticmethod @staticmethod
def run(cmd, spl, length, authed, msg, agora, revolut, tx): def run(cmd, spl, length, authed, msg, agora, revolut, tx):
rtrn = agora._update_prices() rtrn = agora._update_prices()
msg(dumps(rtrn)) msg("Running cheat in thread.")
class ads(object): class ads(object):
name = "ads" name = "ads"