From 44d997ea20fe77552c4cc09e75f71f7f747dc5ec Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 29 Dec 2021 19:21:27 +0000 Subject: [PATCH] Add release funds command --- handler/commands.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/handler/commands.py b/handler/commands.py index 9ccfcf8..e4a00b9 100644 --- a/handler/commands.py +++ b/handler/commands.py @@ -73,8 +73,8 @@ class IRCCommands(object): @staticmethod def run(cmd, spl, length, authed, msg, agora, revolut, tx): # Distribute out our ad to all countries in the config - rtrn = agora.dist_countries() - msg(dumps(rtrn)) + for x in agora.dist_countries(): + msg(dumps(x)) class find(object): name = "find" @@ -198,3 +198,17 @@ class IRCCommands(object): return tx.del_ref(spl[1]) msg(f"Deleted reference: {spl[1]}") + + class release(object): + name = "release" + authed = True + + @staticmethod + def run(cmd, spl, length, authed, msg, agora, revolut, tx): + if length == 2: + tx = tx.ref_to_tx(spl[1]) + if not tx: + msg(f"No such reference: {spl[1]}") + return + rtrn = agora.release_funds(tx) + msg(dumps(rtrn))