-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrich_text_input.py
More file actions
30 lines (27 loc) · 1.09 KB
/
Copy pathrich_text_input.py
File metadata and controls
30 lines (27 loc) · 1.09 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
from slack_sdk.models.blocks import InputBlock
from slack_sdk.models.blocks.basic_components import PlainTextObject
from slack_sdk.models.blocks.block_elements import RichTextInputElement
from slack_sdk.models.views import View
def example01() -> View:
"""
Allows users to enter formatted text in a WYSIWYG composer, offering the same messaging writing experience as in Slack.
https://docs.slack.dev/reference/block-kit/block-elements/rich-text-input-element/
A home view with an input block containing a rich text input element.
"""
view = View(
type="home",
blocks=[
InputBlock(
element=RichTextInputElement(
action_id="rich_text_input-action",
dispatch_action_config={
"trigger_actions_on": ["on_character_entered"],
},
focus_on_load=True,
placeholder=PlainTextObject(text="Enter text"),
),
label=PlainTextObject(text="Label", emoji=True),
),
],
)
return view