Fix some commands

This commit is contained in:
Mark Veidemanis 2021-12-29 14:49:29 +00:00
parent b160ac10e3
commit b1fa6182ef
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 8 additions and 3 deletions

View File

@ -157,8 +157,12 @@ class IRCCommands(object):
def run(cmd, spl, length, authed, msg, agora, revolut, tx): def run(cmd, spl, length, authed, msg, agora, revolut, tx):
if length > 2: if length > 2:
full_msg = " ".join(spl[2:]) full_msg = " ".join(spl[2:])
rtrn = agora.agora.contact_message_post(spl[1], full_msg) reference = tx.ref_to_tx(spl[1])
msg(f"Sent {full_msg} to {spl[1]}: {rtrn}") 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): class refs(object):
name = "refs" name = "refs"
@ -177,7 +181,8 @@ class IRCCommands(object):
if length == 2: if length == 2:
ref_data = tx.get_ref(spl[1]) ref_data = tx.get_ref(spl[1])
if not ref_data: 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)}") msg(f"{spl[1]}: {dumps(ref_data)}")
class delete(object): class delete(object):