Skip to content

Commit

Permalink
fix: Assistant Prompts and Status, send channel_id with request (slac…
Browse files Browse the repository at this point in the history
…k-go#1344)

This is a fix for [PR
1331](slack-go#1331), which I mistakenly
removed the channel_id parameter from the API request during feedback.

Without channel_id provided, the call always returns
`invalid_arguments`.
  • Loading branch information
MattDavisRV authored and gautamr95 committed Dec 13, 2024
1 parent a24b24b commit 59a58da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func (api *Client) SetAssistantThreadsSuggestedPromptsContext(ctx context.Contex
values.Add("thread_ts", params.ThreadTS)
}

values.Add("channel_id", params.ChannelID)

// Send Prompts as JSON
prompts, err := json.Marshal(params.Prompts)
if err != nil {
Expand Down Expand Up @@ -98,6 +100,8 @@ func (api *Client) SetAssistantThreadsStatusContext(ctx context.Context, params
values.Add("thread_ts", params.ThreadTS)
}

values.Add("channel_id", params.ChannelID)

// Always send the status parameter, if empty, it will clear any existing status
values.Add("status", params.Status)

Expand Down

0 comments on commit 59a58da

Please sign in to comment.