Post message to IRC if there are no trades/messages
This commit is contained in:
parent
2f274390a8
commit
9991813209
|
@ -78,6 +78,8 @@ class IRCBot(irc.IRCClient):
|
||||||
elif cmd == "messages" and host in self.admins and len(spl) == 1:
|
elif cmd == "messages" and host in self.admins and len(spl) == 1:
|
||||||
# Get all messages for all open trades
|
# Get all messages for all open trades
|
||||||
messages = self.agora.get_all_messages()
|
messages = self.agora.get_all_messages()
|
||||||
|
if not messages:
|
||||||
|
self.msg(channel, "No messages.")
|
||||||
for message_id in messages:
|
for message_id in messages:
|
||||||
for message in messages[message_id]:
|
for message in messages[message_id]:
|
||||||
self.msg(channel, f"{message_id}: {message}")
|
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:
|
elif cmd == "messages" and host in self.admins and len(spl) == 2:
|
||||||
# Get all messages for a given trade
|
# Get all messages for a given trade
|
||||||
messages = self.agora.get_messages(spl[1], send_irc=False)
|
messages = self.agora.get_messages(spl[1], send_irc=False)
|
||||||
|
if not messages:
|
||||||
|
self.msg(channel, "No messages.")
|
||||||
for message in messages:
|
for message in messages:
|
||||||
self.msg(channel, f"{spl[1]}: {message}")
|
self.msg(channel, f"{spl[1]}: {message}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue