From: Carl Worth Date: Sun, 27 Dec 2020 19:35:15 +0000 (-0800) Subject: Make the /solved command report to the hunt's channel X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=3ee5f41d7e1e2a63c4f1678c53431a8036188be2;p=turbot 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. --- 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)