-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome.py
104 lines (104 loc) · 3.61 KB
/
home.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
def generate_home_view(client, event, logger, airtable):
view = {
"type": "home",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":celeste-madeline-normal04: Slackeline's Dashboard :celeste-madeline-normal04:",
"emoji": True,
},
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": f":waveline: Hiii <@{event['user']}>! What would you like me to do?",
},
},
{"type": "divider"},
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":celeste-madelineph-normal05: Make a call",
"emoji": True,
},
},
{
"type": "input",
"block_id": "username",
"element": {"type": "plain_text_input", "action_id": "username", "placeholder": {
"type": "plain_text",
"text": "Madeline",
}},
"label": {
"type": "plain_text",
"text": "Should I pretend to be someone else?",
"emoji": True,
},
},
{
"type": "input",
"block_id": "emoji",
"element": {"type": "plain_text_input", "action_id": "emoji", "placeholder": {
"type": "plain_text",
"text": ":celeste-madeline-normal04:",
}},
"label": {
"type": "plain_text",
"text": "What should I look like?",
"emoji": True,
},
},
{
"type": "input",
"block_id": "message_input",
"element": {
"type": "plain_text_input",
"multiline": True,
"action_id": "message_input",
"placeholder": {
"type": "plain_text",
"text": "Hi frens! :D",
}
},
"label": {"type": "plain_text", "text": "Call to make", "emoji": True},
},
{
"type": "input",
"block_id": "conversations_select",
"element": {
"type": "conversations_select",
"placeholder": {
"type": "plain_text",
"text": "Select conversation",
"emoji": True,
},
"action_id": "conversations_select-action",
},
"label": {
"type": "plain_text",
"text": "Who should I call?",
"emoji": True,
},
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Make the call",
"emoji": True,
},
"style": "primary",
"action_id": "submit_phone_call",
}
],
},
],
}
client.views_publish(user_id=event["user"], view=view)