-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcarousel.py
More file actions
104 lines (101 loc) · 3.74 KB
/
Copy pathcarousel.py
File metadata and controls
104 lines (101 loc) · 3.74 KB
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
from slack_sdk.models.blocks import CardBlock, CarouselBlock
from slack_sdk.models.blocks.basic_components import MarkdownTextObject, PlainTextObject
from slack_sdk.models.blocks.block_elements import ButtonElement, ImageElement
def example01() -> CarouselBlock:
"""
Displays related card blocks in a horizontally-scrolling container.
https://docs.slack.dev/reference/block-kit/blocks/carousel-block/
A sample carousel block.
"""
block = CarouselBlock(
elements=[
CardBlock(
block_id="carousel-card-1",
icon=ImageElement(
image_url="https://picsum.photos/36/36",
alt_text="Icon",
),
title=MarkdownTextObject(
text="MDR",
verbatim=False,
),
subtitle=MarkdownTextObject(
text="Refining data files",
verbatim=False,
),
hero_image=ImageElement(
image_url="https://picsum.photos/400/300",
alt_text="Sample hero image",
),
body=MarkdownTextObject(
text="Blue badge required to gain access.",
verbatim=False,
),
actions=[
ButtonElement(
text=PlainTextObject(text="Action Button", emoji=False),
action_id="button_action_1",
)
],
),
CardBlock(
block_id="carousel-card-2",
icon=ImageElement(
image_url="https://picsum.photos/36/36",
alt_text="Icon",
),
title=MarkdownTextObject(
text="O&D",
verbatim=False,
),
subtitle=MarkdownTextObject(
text="Storage, maintenance, and rotation of art pieces",
verbatim=False,
),
hero_image=ImageElement(
image_url="https://picsum.photos/400/300",
alt_text="Sample hero image",
),
body=MarkdownTextObject(
text="Green badge required to gain access.",
verbatim=False,
),
actions=[
ButtonElement(
text=PlainTextObject(text="Action Button", emoji=False),
action_id="button_action_2",
)
],
),
CardBlock(
block_id="carousel-card-3",
icon=ImageElement(
image_url="https://picsum.photos/36/36",
alt_text="Icon",
),
title=MarkdownTextObject(
text="Wellness Center",
verbatim=False,
),
subtitle=MarkdownTextObject(
text="Wellness sessions",
verbatim=False,
),
hero_image=ImageElement(
image_url="https://picsum.photos/400/300",
alt_text="Sample hero image",
),
body=MarkdownTextObject(
text="Please take a seat in the waiting room until called.",
verbatim=False,
),
actions=[
ButtonElement(
text=PlainTextObject(text="Action Button", emoji=False),
action_id="button_action_3",
)
],
),
],
)
return block