pubbot: Don't send updates with 0 increase

These double messages happen occasionally, we want to just ignore them.
pull/388/merge
Mike Lang 3 days ago
parent eb05d37319
commit f0fb2fb281

@ -133,7 +133,8 @@ def main(conf_file, message_log_file, name=socket.gethostname()):
log["giveaway_entries"] = entries
entries_str = " ({} entries of ${:.2f})".format(entries, giveaway_amount)
logging.info("New donation total: {}{}{}".format(msg["d"], increase_str, entries_str))
client.send_to_stream("bot-spam", "Donation Firehose", "Donation total is now ${:.2f}{}{}".format(msg["d"], increase_str, entries_str))
if increase is not None and increase > 0:
client.send_to_stream("bot-spam", "Donation Firehose", "Donation total is now ${:.2f}{}{}".format(msg["d"], increase_str, entries_str))
if increase is not None and increase >= 500:
client.send_to_stream("bot-spam", "Notable Donations", "Large donation of ${:.2f} (total ${:.2f}){}".format(increase, msg['d'], entries_str))
total = msg["d"]

Loading…
Cancel
Save