From 3ee5f41d7e1e2a63c4f1678c53431a8036188be2 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 27 Dec 2020 11:35:15 -0800 Subject: [PATCH] Make the /solved command report to the hunt's channel So that there's a log in the main hunt channel for when each puzzle gets solved. --- TODO | 2 -- turbot/interaction.py | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 945708c..e62ffea 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -• Make /solved report to the main hunt channel - • Make /solved clear the state string for a puzzle. • Implement an /archive command to allow for easy archiving of a diff --git a/turbot/interaction.py b/turbot/interaction.py index bef4f42..d2514e5 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -453,6 +453,15 @@ def solved(turb, body, args): turb.slack_client, channel_id, "Puzzle mark solved by {}: `{}`".format(user_name, args)) + # Also report the solution to the hunt channel + (hunt, _) = get_table_item(turb, "hunts", "hunt_id", puzzle['hunt_id']) + slack_send_message( + turb.slack_client, hunt['channel_id'], + "Puzzle '<{}|{}>' has been solved!".format( + puzzle['channel_url'], + puzzle['name']) + ) + # And update the puzzle's description set_channel_topic(turb, puzzle) -- 2.43.0