Repository navigation
Expand file tree
/
Copy pathoverflow_menu.py
More file actions
46 lines (43 loc) · 1.52 KB
/
Copy pathoverflow_menu.py
File metadata and controls
46 lines (43 loc) · 1.52 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
from slack_sdk.models.blocks import SectionBlock
from slack_sdk.models.blocks.basic_components import (
MarkdownTextObject,
Option,
PlainTextObject,
)
from slack_sdk.models.blocks.block_elements import OverflowMenuElement
def example01() -> SectionBlock:
"""
Allows users to press a button to view a list of options.
https://docs.slack.dev/reference/block-kit/block-elements/overflow-menu-element/
A section block with an overflow menu accessory.
"""
block = SectionBlock(
block_id="section 890",
text=MarkdownTextObject(text="This is a section block with an overflow menu."),
accessory=OverflowMenuElement(
action_id="overflow",
options=[
Option(
text=PlainTextObject(text="*this is plain_text text*"),
value="value-0",
),
Option(
text=PlainTextObject(text="*this is plain_text text*"),
value="value-1",
),
Option(
text=PlainTextObject(text="*this is plain_text text*"),
value="value-2",
),
Option(
text=PlainTextObject(text="*this is plain_text text*"),
value="value-3",
),
Option(
text=PlainTextObject(text="*this is plain_text text*"),
value="value-4",
),
],
),
)
return block