-
Notifications
You must be signed in to change notification settings - Fork 0
/
blocks.py
76 lines (72 loc) · 2.38 KB
/
blocks.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
icon = 'https://img.icons8.com/emoji/96/000000/penguin--v2.png'
def divider(slack_client,channel):
"""
Divider blocks class
"""
slack_client.api_call(
"chat.postMessage",
channel=channel,
text= "",
icon_url=icon,
blocks= [
{
"type": "divider"
}
])
def reminder(slack_client, user):
"""
Remainder message blocks
"""
slack_client.api_call(
"chat.postMessage",
as_user=True,
channel= user,
icon_url=icon,
text=f"Hey <@{user}>!, :wave: Fill in what you've done today",
attachments=[{
"text": "",
"callback_id": "workform",
"color": "#3AA3E3",
"attachment_type": "default",
"actions": [{
"name": "workform",
"text": "Submit Today\'s report",
"type": "button",
"value": "Work_data"
}]
}]
)
slack_client.api_call(
"chat.postMessage",
as_user=True,
channel= user,
icon_url=icon,
text="Glad, I\'m here to help in submitting your work data",
blocks= [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Other quick actions"
},
"accessory": {
"type": "static_select",
"placeholder": {
"type": "plain_text",
"emoji": True,
"text": "Manage"
},
"options": [
{
"text": {
"type": "plain_text",
"emoji": True,
"text": "Request for a day-off"
},
"value": "dayoff"
}
]
}
}
]
)