channel_id = response['channel']['id']
# Create a sheet for the channel
- turbot.sheets.sheets_create(turb, slug)
+ sheet = turbot.sheets.sheets_create(turb, slug)
# Insert the newly-created hunt into the database
turb.hunts_table = turb.db.Table("hunts")
"active": True,
"name": name,
"slug": slug,
- "url": url
+ "url": url,
+ "sheet_url": sheet['url']
}
)
# Invite the initiating user to the channel
turb.slack_client.conversations_invite(channel=channel_id, users=user_id)
+ # Message the channel with the URL of the sheet
+ turb.slack_client.chat_postMessage(channel=channel_id,
+ text="Sheet created for this hunt: {}"
+ .format(sheet['url']))
+
return {
'statusCode': 200,
}