-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurl_source.py
More file actions
38 lines (33 loc) · 1.01 KB
/
Copy pathurl_source.py
File metadata and controls
38 lines (33 loc) · 1.01 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
from slack_sdk.models.blocks import TaskCardBlock
from slack_sdk.models.blocks.block_elements import UrlSourceElement
def example01() -> UrlSourceElement:
"""
Displays a URL source for referencing within a task card block.
https://docs.slack.dev/reference/block-kit/block-elements/url-source-element/
A URL source element.
"""
element = UrlSourceElement(
url="https://docs.slack.dev/",
text="Slack API docs",
)
return element
def example02() -> TaskCardBlock:
"""
A task card block with URL source elements.
"""
block = TaskCardBlock(
task_id="task_1",
title="Scientific findings",
status="complete",
sources=[
UrlSourceElement(
url="https://docs.example.com/",
text="Tracy's delightful docs",
),
UrlSourceElement(
url="https://research.example.com/",
text="Haley's resourceful research",
),
],
)
return block