From 99918132094fbb41dec1afe8b5b5a648a1b96057 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 28 Dec 2021 11:31:15 +0000 Subject: [PATCH] Post message to IRC if there are no trades/messages --- handler/irc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handler/irc.py b/handler/irc.py index 1456958..b129d21 100644 --- a/handler/irc.py +++ b/handler/irc.py @@ -78,6 +78,8 @@ class IRCBot(irc.IRCClient): elif cmd == "messages" and host in self.admins and len(spl) == 1: # Get all messages for all open trades messages = self.agora.get_all_messages() + if not messages: + self.msg(channel, "No messages.") for message_id in messages: for message in messages[message_id]: self.msg(channel, f"{message_id}: {message}") @@ -87,6 +89,8 @@ class IRCBot(irc.IRCClient): elif cmd == "messages" and host in self.admins and len(spl) == 2: # Get all messages for a given trade messages = self.agora.get_messages(spl[1], send_irc=False) + if not messages: + self.msg(channel, "No messages.") for message in messages: self.msg(channel, f"{spl[1]}: {message}")