# First, we have to properly respond to url_verification
# challenges or else Slack won't let us configure our URL as an
# First, we have to properly respond to url_verification
# challenges or else Slack won't let us configure our URL as an
type = body['event']['type']
if type in turbot.events.events:
return turbot.events.events[type](turb, body)
return error("Unknown event type: {}".format(type))
type = body['event']['type']
if type in turbot.events.events:
return turbot.events.events[type](turb, body)
return error("Unknown event type: {}".format(type))
"""Handler for Slack interactive things (buttons, shortcuts, etc.)
as well as slash commands.
"""Handler for Slack interactive things (buttons, shortcuts, etc.)
as well as slash commands.
# The difference is that an interactive thingy has a 'payload'
# while a slash command has a 'command'
if 'payload' in body:
# The difference is that an interactive thingy has a 'payload'
# while a slash command has a 'command'
if 'payload' in body:
"""Handler for Slack interactive requests
These are the things that come from a user interacting with a button
"""Handler for Slack interactive requests
These are the things that come from a user interacting with a button
"""Handler for Slack interactive block actions
Specifically, those that have a payload type of 'block_actions'"""
"""Handler for Slack interactive block actions
Specifically, those that have a payload type of 'block_actions'"""