What happened
Assigning metadata with client.PostMessage, it didn't work.
Expected behavior
Assigning MetaData using MsgOptionPostMessageParameters() (like in here) should include given key-value pair in the message metadata.
Steps to reproduce
- Post a message to a channel with
MetaData defined, and log the received message event. In the posted message event, the event_type and event_payload of MetaData are empty.
...
"metadata": {
"event_type": "",
"event_payload": null
},
...
reproducible code
package handlers
import (
"github.com/slack-go/slack"
)
func main {
api = slack.New("xoxb-xxx")
// Define PostMessageParameters
messageParameters := slack.PostMessageParameters{
MetaData: slack.SlackMetadata{
EventType: "reaction_added",
EventPayload: map[string]interface{}{
"event_id": "123",
},
},
}
// Post a message to a channel with the created messageParameters
_, _, err := api.PostMessage(
"channel-name",
slack.MsgOptionText("Hello", false),
slack.MsgOptionPostMessageParameters(messageParameters),
)
}
Versions
- Go:
1.23
- slack-go/slack:
0.15.0
What happened
Assigning metadata with
client.PostMessage, it didn't work.Expected behavior
Assigning
MetaDatausingMsgOptionPostMessageParameters()(like in here) should include given key-value pair in the message metadata.Steps to reproduce
MetaDatadefined, and log the received message event. In the posted message event, theevent_typeandevent_payloadof MetaData are empty.reproducible code
Versions
1.230.15.0