From e794b0cf7d4267609dffcf1b12277d9a0de2f405 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Tue, 12 Nov 2024 22:37:44 +1100 Subject: [PATCH] prizebot fixes --- docker-compose.jsonnet | 2 +- zulip_bots/zulip_bots/prizebot.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.jsonnet b/docker-compose.jsonnet index 216475a..3031ee9 100644 --- a/docker-compose.jsonnet +++ b/docker-compose.jsonnet @@ -356,7 +356,7 @@ // Path in host fs for the state file. // Must exist and be initialized to "{}" state_path:: "./prizebot_state.json", - } + }, // template for donation data urls donation_url_template:: "https://example.com/DB{}/DB{}.json", diff --git a/zulip_bots/zulip_bots/prizebot.py b/zulip_bots/zulip_bots/prizebot.py index b41f456..933c480 100644 --- a/zulip_bots/zulip_bots/prizebot.py +++ b/zulip_bots/zulip_bots/prizebot.py @@ -83,10 +83,10 @@ def main(config_file, test=False, all=False, once=False, interval=60): for type in ('live', 'silent', 'giveaway'): prizes = get_prizes(type) for prize in prizes: + logging.info(f"Got prize: {prize}") if prize.state == "sold" and (all or state.get(prize.id, "sold") != "sold"): send_message(client, prize, test=test) state[prize.id] = prize.state - print(state) if not test: with open(config['state'], 'w') as f: f.write(json.dumps(state) + '\n')