]> git.cworth.org Git - turbot/blobdiff - turbot/interaction.py
Remove a line of dead code
[turbot] / turbot / interaction.py
index 1f5d11f4b4218b9a92680088d87521d69c6cd74b..23467d6874b5e83aa0470e889a99b6e449fdd230 100644 (file)
@@ -112,8 +112,6 @@ def edit_puzzle_command(turb, body):
 
     return edit_puzzle(turb, puzzle, trigger_id)
 
-    return lambda_ok
-
 def edit_puzzle_button(turb, payload):
     """Handler for the action of user pressing an edit_puzzle button"""
 
@@ -686,7 +684,7 @@ def puzzle(turb, body, args):
 
     # For a meta puzzle, also display the titles and solutions for all
     # puzzles in the same round.
-    if puzzle['type'] == 'meta':
+    if puzzle.get('type', 'plain') == 'meta':
         puzzles = hunt_puzzles_for_hunt_id(turb, puzzle['hunt_id'])
 
         # Drop this puzzle itself from the report
@@ -927,8 +925,8 @@ def tag(turb, body, args):
     tag = tag.upper()
 
     # Reject a tag that is not alphabetic or underscore A-Z_
-    if not re.match(r'^[A-Z_]*$', tag):
-        return bot_reply("Sorry, tags can only contain letters "
+    if not re.match(r'^[A-Z0-9_]*$', tag):
+        return bot_reply("Sorry, tags can only contain letters, numbers, "
                          + "and the underscore character.")
 
     if action == 'remove':
@@ -967,7 +965,7 @@ def solved(turb, body, args):
     The args string should be a confirmed solution."""
 
     channel_id = body['channel_id'][0]
-    user_name = body['user_name'][0]
+    user_id = body['user_id'][0]
 
     old_puzzle = puzzle_for_channel(turb, channel_id)
 
@@ -991,7 +989,7 @@ def solved(turb, body, args):
     # Report the solution to the puzzle's channel
     slack_send_message(
         turb.slack_client, channel_id,
-        "Puzzle mark solved by {}: `{}`".format(user_name, args))
+        "Puzzle mark solved by <@{}>: `{}`".format(user_id, args))
 
     # Also report the solution to the hunt channel
     hunt = find_hunt_for_hunt_id(turb, puzzle['hunt_id'])