-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrich_text_list.py
More file actions
94 lines (89 loc) · 2.93 KB
/
Copy pathrich_text_list.py
File metadata and controls
94 lines (89 loc) · 2.93 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
from slack_sdk.models.blocks import RichTextBlock
from slack_sdk.models.blocks.block_elements import (
RichTextElementParts,
RichTextListElement,
RichTextSectionElement,
)
def example01() -> RichTextBlock:
"""
Displays a list of rich text items.
https://docs.slack.dev/reference/block-kit/block-elements/rich-text-list-element/
A rich text block with a bulleted list.
"""
block = RichTextBlock(
block_id="block1",
elements=[
RichTextSectionElement(
elements=[
RichTextElementParts.Text(
text="My favorite Slack features (in no particular order):"
),
]
),
RichTextListElement(
style="bullet",
indent=0,
border=1,
elements=[
RichTextSectionElement(
elements=[RichTextElementParts.Text(text="Huddles")]
),
RichTextSectionElement(
elements=[RichTextElementParts.Text(text="Canvas")]
),
RichTextSectionElement(
elements=[
RichTextElementParts.Text(text="Developing with Block Kit")
]
),
],
),
],
)
return block
def example02() -> RichTextBlock:
"""
A rich text block with nested bulleted lists using indent.
"""
block = RichTextBlock(
block_id="block1",
elements=[
RichTextSectionElement(
elements=[RichTextElementParts.Text(text="Breakfast foods I enjoy:")]
),
RichTextListElement(
style="bullet",
elements=[
RichTextSectionElement(
elements=[RichTextElementParts.Text(text="Hashbrowns")]
),
RichTextSectionElement(
elements=[RichTextElementParts.Text(text="Eggs")]
),
],
),
RichTextListElement(
style="bullet",
indent=1,
elements=[
RichTextSectionElement(
elements=[RichTextElementParts.Text(text="Scrambled")]
),
RichTextSectionElement(
elements=[RichTextElementParts.Text(text="Over easy")]
),
],
),
RichTextListElement(
style="bullet",
elements=[
RichTextSectionElement(
elements=[
RichTextElementParts.Text(text="Pancakes, extra syrup")
]
),
],
),
],
)
return block