diff --git a/slack_sdk/models/blocks/block_elements.py b/slack_sdk/models/blocks/block_elements.py index b38cf21e0..d176cfb24 100644 --- a/slack_sdk/models/blocks/block_elements.py +++ b/slack_sdk/models/blocks/block_elements.py @@ -2032,11 +2032,13 @@ def __init__( italic: Optional[bool] = None, strike: Optional[bool] = None, code: Optional[bool] = None, + underline: Optional[bool] = None, ): self.bold = bold self.italic = italic self.strike = strike self.code = code + self.underline = underline def to_dict(self, *args) -> dict: result = { @@ -2044,6 +2046,7 @@ def to_dict(self, *args) -> dict: "italic": self.italic, "strike": self.strike, "code": self.code, + "underline": self.underline, } return {k: v for k, v in result.items() if v is not None} diff --git a/tests/slack_sdk/models/test_blocks.py b/tests/slack_sdk/models/test_blocks.py index adacf1427..a07ce11b8 100644 --- a/tests/slack_sdk/models/test_blocks.py +++ b/tests/slack_sdk/models/test_blocks.py @@ -1037,6 +1037,8 @@ def test_complex(self): {"type": "text", "text": "block", "style": {"code": True}}, {"type": "text", "text": " "}, {"type": "text", "text": "test", "style": {"italic": True}}, + {"type": "text", "text": " "}, + {"type": "text", "text": "links", "style": {"underline": True}}, {"type": "link", "url": "https://slack.com", "text": "Slack website!"}, ], }, @@ -1138,6 +1140,8 @@ def test_complex(self): _.Text(text="block", style=_.TextStyle(code=True)), _.Text(text=" "), _.Text(text="test", style=_.TextStyle(italic=True)), + _.Text(text=" "), + _.Text(text="links", style=_.TextStyle(underline=True)), _.Link(text="Slack website!", url="https://slack.com"), ] ),