return lambda_ok
commands["/state"] = state
+
+def solved(turb, body, args):
+ """Implementation of the /solved command
+
+ The args string should be a confirmed solution."""
+
+ channel_id = body['channel_id'][0]
+ channel_name = body['channel_name'][0]
+
+ (puzzle, table) = channel_is_puzzle(turb, channel_id, channel_name)
+
+ if not puzzle:
+ return bot_reply("Sorry, this is not a puzzle channel.")
+
+ # Set the status and solution fields in the database
+ puzzle['status'] = 'solved'
+ puzzle['solution'].append(args)
+ table.put_item(Item=puzzle)
+
+ return lambda_ok
+
+commands["/solved"] = solved