nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: slack-go/slack
Pull request #1372 (2025-02-09 19:25:43)

feat: add markdown block
There's a new block for markdown per changelog entry at https://api.slack.com/changelog#entry-february_2025_0.

More information can be found in
https://api.slack.com/reference/block-kit/blocks#markdown.


Patch:
diff --git a/block.go b/block.go
index f0e2888..33a7875 100644
--- a/block.go
+++ b/block.go
@@ -1,9 +1,5 @@
 package slack
 
-// @NOTE: Blocks are in beta and subject to change.
-
-// More Information: https://api.slack.com/block-kit
-
 // MessageBlockType defines a named string type to define each block type
 // as a constant for use within the package.
 type MessageBlockType string
@@ -20,6 +16,7 @@ const (
 	MBTRichText MessageBlockType = "rich_text"
 	MBTCall     MessageBlockType = "call"
 	MBTVideo    MessageBlockType = "video"
+	MBTMarkdown MessageBlockType = "markdown"
 )
 
 // Block defines an interface all block types should implement
diff --git a/block_markdown.go b/block_markdown.go
new file mode 100644
index 0000000..e22a0d1
--- /dev/null
+++ b/block_markdown.go
@@ -0,0 +1,34 @@
+package slack
+
+// MarkdownBlock defines a block that lets you use markdown to format your text.
+//
+// This block can be used with AI apps when you expect a markdown response from an LLM
+// that can get lost in translation rendering in Slack. Providing it in a markdown block
+// leaves the translating to Slack to ensure your message appears as intended. Note that
+// passing a single block may result in multiple blocks after translation.
+//
+// More Information: https://api.slack.com/reference/block-kit/blocks#markdown
+type MarkdownBlock struct {
+	Type    MessageBlockType `json:"type"`
+	BlockID string           `json:"block_id,omitempty"`
+	Text    string           `json:"text"`
+}
+
+// BlockType returns the type of the block
+func (s MarkdownBlock) BlockType() MessageBlockType {
+	return s.Type
+}
+
+// ID returns the ID of the block
+func (s MarkdownBlock) ID() string {
+	return s.BlockID
+}
+
+// NewMarkdownBlock returns an instance of a new Markdown Block type
+func NewMarkdownBlock(blockID, text string) *MarkdownBlock {
+	return &MarkdownBlock{
+		Type:    MBTMarkdown,
+		BlockID: blockID,
+		Text:    text,
+	}
+}


Test patch:
diff --git a/block_markdown_test.go b/block_markdown_test.go
new file mode 100644
index 0000000..45fe3c5
--- /dev/null
+++ b/block_markdown_test.go
@@ -0,0 +1,17 @@
+package slack
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+)
+
+func TestNewMarkdownBlock(t *testing.T) {
+	markdownBlock := NewMarkdownBlock("test", "*asfd*")
+
+	assert.Equal(t, markdownBlock.BlockType(), MBTMarkdown)
+	assert.Equal(t, string(markdownBlock.Type), "markdown")
+	assert.Equal(t, markdownBlock.ID(), "test")
+	assert.Equal(t, markdownBlock.BlockID, "test")
+	assert.Equal(t, markdownBlock.Text, "*asfd*")
+}
Repository: slack-go/slack
Pull request #1449 (2025-06-13 16:40:34)

Unmarshal Timezone state changes / BlockAction for Timepicker
This diff completes the rest of the implementation from #1448 , as it was accidentally missed out of the first PR.
The first PR allows the user to provide a Timezone to the slack model in blockkit, but this PR allows the application to read state updates from slack (i.e. read a changed timezone value)



Patch:
diff --git a/block.go b/block.go
index 42ac840..7c4f993 100644
--- a/block.go
+++ b/block.go
@@ -52,6 +52,7 @@ type BlockAction struct {
 	SelectedDate          string              `json:"selected_date"`
 	SelectedTime          string              `json:"selected_time"`
 	SelectedDateTime      int64               `json:"selected_date_time"`
+	Timezone              string              `json:"timezone"`
 	InitialOption         OptionBlockObject   `json:"initial_option"`
 	InitialUser           string              `json:"initial_user"`
 	InitialChannel        string              `json:"initial_channel"`


Test patch:
diff --git a/interactions_test.go b/interactions_test.go
index 17b9e06..a8f2687 100644
--- a/interactions_test.go
+++ b/interactions_test.go
@@ -144,6 +144,19 @@ const (
 							"type": "conversations_select",
 							"value": "C1AB2C3DE"
 						}
+					},
+          "some_datetime": {
+            "value": {
+              "type": "datetimepicker",
+              "selected_date_time": null
+            }
+          },
+					"some_timepicker": {
+						"value": {
+							"type": "timepicker",
+							"timezone": "Europe/Berlin",
+							"initial_time": "12:00"
+						}
 					}
 				}
 			},
@@ -306,6 +319,19 @@ func TestViewSubmissionCallback(t *testing.T) {
 							Value: "C1AB2C3DE",
 						},
 					},
+					"some_datetime": {
+						"value": BlockAction{
+							Type: "datetimepicker",
+							// No selected datetime!
+						},
+					},
+					"some_timepicker": {
+						"value": BlockAction{
+							Type:        "timepicker",
+							InitialTime: "12:00",
+							Timezone:    "Europe/Berlin",
+						},
+					},
 				},
 			},
 			AppInstalledTeamID: "T1ABCD2E12",