From 906048a797c052e357637f451b6cff8b2b7f738c Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 28 Dec 2021 15:28:56 +0000 Subject: [PATCH] Add message command --- handler/commands.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/handler/commands.py b/handler/commands.py index dee12b3..b1a924a 100644 --- a/handler/commands.py +++ b/handler/commands.py @@ -121,7 +121,7 @@ class IRCCommands(object): @staticmethod def run(cmd, spl, length, authed, msg, agora, revolut, tx): total_usd = revolut.get_total_usd() - if not total_usd: + if total_usd is False: msg("Error getting total balance.") msg(f"Total: {round(total_usd, 2)}USD") @@ -144,3 +144,14 @@ class IRCCommands(object): msg("No trades.") for trade in trades: 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}")