]> git.cworth.org Git - turbot/blobdiff - turbot/interaction.py
Make the /solved command report to the hunt's channel
[turbot] / turbot / interaction.py
index bef4f42ee7ad52200fa9b10d63abf59dd4d6f802..d2514e5d6543878b58483e582eea381db24e3313 100644 (file)
@@ -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)