puzzle['sheet_url'] = meta['sheet_url']
state = payload['view']['state']['values']
+ user_id = payload['user']['id']
puzzle['name'] = state['name']['name']['value']
url = state['url']['url']['value']
# Update the puzzle in the database
turb.table.put_item(Item=puzzle)
+ # Inform the puzzle channel about the edit
+ edit_message = "Puzzle edited by <@{}>".format(user_id)
+ blocks = ([section_block(text_block(edit_message+":\n"))] +
+ puzzle_blocks(puzzle, include_rounds=True))
+ slack_send_message(
+ turb.slack_client, puzzle['channel_id'],
+ edit_message, blocks=blocks)
+
# We need to set the channel topic if any of puzzle name, url,
# state, status, or solution, has changed. Let's just do that
# unconditionally here.