Skip to content

Commit 9741906

Browse files
committed
fix: parse as plain text and stingified to text object
1 parent 92982cd commit 9741906

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

slack_sdk/models/blocks/basic_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def __init__(
558558
screen readers instead of the button `text` object.
559559
value (required): The button value. Maximum length for this field is 2000 characters.
560560
"""
561-
self._text: Optional[TextObject] = TextObject.parse(text, default_type=PlainTextObject.type)
561+
self._text: Optional[TextObject] = PlainTextObject.parse(text, default_type=PlainTextObject.type)
562562
self._accessibility_label: Optional[str] = accessibility_label
563563
self._value: Optional[str] = value
564564
show_unknown_key_warning(self, others)
@@ -575,7 +575,7 @@ def to_dict(self) -> Dict[str, Any]:
575575
self.validate_json()
576576
json = {}
577577
if self._text:
578-
json["text"] = self._text.text
578+
json["text"] = self._text.to_dict()
579579
if self._accessibility_label:
580580
json["accessibility_label"] = self._accessibility_label
581581
if self._value:

0 commit comments

Comments
 (0)