+ type = payload['type']
+
+ if type == 'block_actions':
+ return turbot_block_action(payload)
+ return error("Unrecognized interactive type: {}".format(type))
+
+def turbot_block_action(payload):
+ """Handler for Slack interactive block actions
+
+ Specifically, those that have a payload type of 'block_actions'"""
+
+ actions = payload['actions']
+
+ if len(actions) != 1:
+ return error("No support for multiple actions ({}) in a single request"
+ .format(len(actions)))
+
+ action = actions[0]
+
+ atype = action['type']
+ avalue = action['value']
+
+ if atype == 'button' and avalue == 'new_hunt':
+ return turbot.actions.new_hunt(payload)
+ return error("Unknown action of type/value: {}/{}".format(atype, avalue))