-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrigger.py
More file actions
42 lines (39 loc) · 1.44 KB
/
Copy pathtrigger.py
File metadata and controls
42 lines (39 loc) · 1.44 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
from slack_sdk.models.blocks import SectionBlock
from slack_sdk.models.blocks.basic_components import (
MarkdownTextObject,
PlainTextObject,
Workflow,
WorkflowTrigger,
)
from slack_sdk.models.blocks.block_elements import WorkflowButtonElement
def example01() -> SectionBlock:
"""
Defines an object containing trigger information.
https://docs.slack.dev/reference/block-kit/composition-objects/trigger-object/
A section block with a workflow button whose trigger carries customizable input parameters.
"""
block = SectionBlock(
text=MarkdownTextObject(
text="A message *with some bold text* and _some italicized text_."
),
accessory=WorkflowButtonElement(
text=PlainTextObject(text="Run Workflow"),
action_id="workflowbutton123",
workflow=Workflow(
trigger=WorkflowTrigger(
url="https://slack.com/shortcuts/Ft0123ABC456/xyz...zyx",
customizable_input_parameters=[
{
"name": "input_parameter_a",
"value": "Value for input param A",
},
{
"name": "input_parameter_b",
"value": "Value for input param B",
},
],
),
),
),
)
return block