from slack.errors import SlackApiError
from turbot.blocks import input_block, section_block, text_block
+from turbot.hunt import find_hunt_for_hunt_id
import turbot.rot
import turbot.sheets
import turbot.slack
return response['Items'][0]
-def find_hunt_for_hunt_id(turb, hunt_id):
- """Given a hunt ID find the database for for that hunt
-
- Returns None if hunt ID is not found, otherwise a
- dictionary with all fields from the hunt's row in the table,
- (channel_id, active, hunt_id, name, url, sheet_url, etc.).
-
- """
- turbot_table = turb.db.Table("turbot")
-
- response = turbot_table.get_item(Key={'hunt_id': hunt_id})
-
- if 'Item' in response:
- return response['Item']
- else:
- return None
-
def find_hunt_for_channel(turb, channel_id, channel_name):
"""Given a channel ID/name find the id/name of the hunt for this channel