slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.63k stars 1.12k forks source link

Reply in thread using ResponseURL #1185

Open Albert221 opened 1 year ago

Albert221 commented 1 year ago
_, _, _, err = client.SendMessage(
    payload.Channel.ID,
    slack.MsgOptionResponseURL(payload.ResponseURL, slack.ResponseTypeInChannel),
    slack.MsgOptionTS(payload.Message.ThreadTimestamp),
    slack.MsgOptionText(reply, false),
)

This is my code. The MsgOptionTS sets the thread_ts, but it's not used later. I need it to send a message in thread: https://api.slack.com/interactivity/handling#publishing_in_thread

Logs:

slack-go/slack2023/03/25 10:02:05 chat.go:227: Sending request: {"text":"-","response_type":"in_channel","replace_original":false,"delete_original":false,"metadata":{"event_type":"","event_payload":null},"blocks":null}