--- /dev/null
+import turbot.views
+
+def app_home_opened(slack_client, body):
+ user_id = body['event']['user']
+ view = turbot.views.home(user_id, body)
+ slack_client.views_publish(user_id=user_id, view=view)
+ return "OK"
from turbot.rot import rot
import turbot.views
import turbot.actions
+import turbot.events
ssm = boto3.client('ssm')
type = body['event']['type']
if type == 'app_home_opened':
- return app_home_opened_handler(body)
+ return turbot.events.app_home_opened(slack_client, body)
return error("Unknown event type: {}".format(type))
-def app_home_opened_handler(body):
- user_id = body['event']['user']
- view = turbot.views.home(user_id, body)
- slack_client.views_publish(user_id=user_id, view=view)
- return "OK"
-
def turbot_interactive_or_slash_command(event, context):
"""Handler for Slack interactive things (buttons, shortcuts, etc.)
as well as slash commands.