Just like the previous two commits.
view = turbot.views.home(user_id, body)
slack_client.views_publish(user_id=user_id, view=view)
return "OK"
+
+events = {
+ "app_home_opened": app_home_opened
+}
def event_callback_handler(body):
type = body['event']['type']
- if type == 'app_home_opened':
- return turbot.events.app_home_opened(slack_client, body)
+ if type in turbot.events.events:
+ return turbot.events.events[type](slack_client, body)
return error("Unknown event type: {}".format(type))
def turbot_interactive_or_slash_command(event, context):