Add message command

This commit is contained in:
Mark Veidemanis 2021-12-28 15:28:56 +00:00
parent 1699dc5593
commit 906048a797
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 12 additions and 1 deletions

View File

@ -121,7 +121,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):
total_usd = revolut.get_total_usd() total_usd = revolut.get_total_usd()
if not total_usd: if total_usd is False:
msg("Error getting total balance.") msg("Error getting total balance.")
msg(f"Total: {round(total_usd, 2)}USD") msg(f"Total: {round(total_usd, 2)}USD")
@ -144,3 +144,14 @@ class IRCCommands(object):
msg("No trades.") msg("No trades.")
for trade in trades: for trade in trades:
msg(trade) msg(trade)
class message(object):
name = "msg"
authed = True
@staticmethod
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}")