]> git.cworth.org Git - turbot/commitdiff
Make the /solved command report to the hunt's channel
authorCarl Worth <cworth@cworth.org>
Sun, 27 Dec 2020 19:35:15 +0000 (11:35 -0800)
committerCarl Worth <cworth@cworth.org>
Sun, 27 Dec 2020 20:23:28 +0000 (12:23 -0800)
So that there's a log in the main hunt channel for when each puzzle
gets solved.

TODO
turbot/interaction.py

diff --git a/TODO b/TODO
index 945708c66874224b36aae136f53b5eb53d191bb2..e62ffeaae83a75506b6ed5319f79e13cf79027b9 100644 (file)
--- 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
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)