]> git.cworth.org Git - turbot/blob - turbot/views.py
stash
[turbot] / turbot / views.py
1 def home(user_id, body):
2     """Returns a view to be published as the turbot home tab for user_id
3
4     The body argument is a dictionary as provided by the Slack request.
5     The return value is a dictionary suitable to be published to the
6     Slack views_publish API."""
7
8     return {
9         "type": "home",
10         "blocks": [
11             {
12                 "type": "section",
13                 "text": {
14                     "type": "mrkdwn",
15                     "text": "A simple stack of blocks for the simple sample Block Kit Home tab."
16                 }
17             },
18             {
19                 "type": "actions",
20                 "elements": [
21                 {
22                     "type": "button",
23                     "text": {
24                         "type": "plain_text",
25                         "text": "Action A",
26                         "emoji": True
27                     }
28                 },
29                     {
30                         "type": "button",
31                         "text": {
32                         "type": "plain_text",
33                             "text": "Action B",
34                             "emoji": True
35                         }
36                     }
37                 ]
38             }
39         ]
40     }