From b1fa6182ef711a90591dc2d33763391f37e99b6c Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 29 Dec 2021 14:49:29 +0000 Subject: [PATCH] Fix some commands --- handler/commands.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/handler/commands.py b/handler/commands.py index 2b4d613..9ccfcf8 100644 --- a/handler/commands.py +++ b/handler/commands.py @@ -157,8 +157,12 @@ class IRCCommands(object): def run(cmd, spl, length, authed, msg, agora, revolut, tx): if length > 2: full_msg = " ".join(spl[2:]) - rtrn = agora.agora.contact_message_post(spl[1], full_msg) - msg(f"Sent {full_msg} to {spl[1]}: {rtrn}") + reference = tx.ref_to_tx(spl[1]) + if not reference: + msg(f"No such reference: {spl[1]}") + return + rtrn = agora.agora.contact_message_post(reference, full_msg) + msg(f"Sent {full_msg} to {reference}: {rtrn}") class refs(object): name = "refs" @@ -177,7 +181,8 @@ class IRCCommands(object): if length == 2: ref_data = tx.get_ref(spl[1]) if not ref_data: - msg("No such reference: {spl[1]}") + msg(f"No such reference: {spl[1]}") + return msg(f"{spl[1]}: {dumps(ref_data)}") class delete(object):