MCPcopy Index your code
hub / github.com/slackapi/python-slack-sdk / PlainTextObject

Class PlainTextObject

slack_sdk/models/blocks/basic_components.py:73–103  ·  view source on GitHub ↗

plain_text typed text object

Source from the content-addressed store, hash-verified

71
72
73class PlainTextObject(TextObject):
74 """plain_text typed text object"""
75
76 type = "plain_text"
77
78 @property
79 def attributes(self) -> Set[str]: # type: ignore[override]
80 return super().attributes.union({"emoji"})
81
82 def __init__(self, *, text: str, emoji: Optional[bool] = None):
83 """A plain text object, meaning markdown characters will not be parsed as
84 formatting information.
85 https://docs.slack.dev/reference/block-kit/composition-objects/text-object
86
87 Args:
88 text (required): The text for the block. This field accepts any of the standard text formatting markup
89 when type is mrkdwn.
90 emoji: Indicates whether emojis in a text field should be escaped into the colon emoji format.
91 This field is only usable when type is plain_text.
92 """
93 super().__init__(text=text, type=self.type)
94 self.emoji = emoji
95
96 @staticmethod
97 def from_str(text: str) -> "PlainTextObject":
98 return PlainTextObject(text=text, emoji=True)
99
100 @staticmethod
101 def direct_from_string(text: str) -> Dict[str, Any]:
102 """Transforms a string into the required object shape to act as a PlainTextObject"""
103 return PlainTextObject.from_str(text).to_dict()
104
105
106class MarkdownTextObject(TextObject):

Callers 15

open_modalFunction · 0.90
slack_appFunction · 0.90
test_with_blocksMethod · 0.90
test_with_blocksMethod · 0.90
test_basic_jsonMethod · 0.90
test_from_stringMethod · 0.90

Calls

no outgoing calls