slack_send_message(
turb.slack_client, channel_id,
"Welcome to the channel for the {} hunt! ".format(hunt['name'])
- + "Please wait a minute or two while I create some backend resources.")
+ + "Please wait a moment or two while I create some backend resources.")
# Create a new folder within Google drive for the hunt
hunt['folder_id'] = sheets_create_folder(turb, hunt['hunt_id'])
slack_send_message(
turb.slack_client, channel_id,
"Thank you for waiting. This hunt is now ready to begin! "
- + "Use `/puzzle` to create puzzles for the hunt.")
+ + "Type `/puzzle new` to create puzzles for the hunt.")
return lambda_success
.format(channel_id, puzzle['sheet_url']))
return lambda_success
+ # We need hunt from the database to know which folder to create
+ # the sheet in.
+ hunt = find_hunt_for_hunt_id(turb, puzzle['hunt_id'])
+
# Before launching into sheet creation, indicate that we're doing this
# in the database. This way, if we take too long to create the sheet
# and Slack retries the event, that next event will see this 'pending'
turb.table.put_item(Item=puzzle)
# Create a sheet for the puzzle
- sheet = sheets_create_for_puzzle(turb, puzzle)
+ sheet = sheets_create_for_puzzle(turb, puzzle, hunt['folder_id'])
# Update the database with the URL of the sheet
puzzle['sheet_url'] = sheet['url']