Open tgray2os opened 9 months ago
I believe this is because the interactive_blocks
parameter of SendMessage says it only accepts button
and workflow_button
interactive elements only. See the description of the parameter on our documentation here: https://api.slack.com/reference/functions/send_message#arg_interactive_blocks
As a workaround, you should have complete freedom to post valid blocks using a custom function and the client.chat.postMessage
API.
I see, thanks! I missed that piece of the docs, but that does explain it. I'll figure out a different way to go about what I was trying to do.
The
deno-slack
versionsDeno runtime version
OS info
Describe the bug
I'm using the Schema.slack.functions.SendDM function to try to send a message. I'm using the interactive_blocks option to try to send a static select menu in the message. If I use the example block code here my code works. However once I change it to something created in Block Kit Builder, it no longer works. The message fails with the following error
Function 'Send a message to a person' (Slack function) failed invalid_interactive_element
. In trying different blocks I've also seeninvalid_interactive_block_type
.Steps to reproduce
Scenario 1: This code works using the example from here
Scenario 2: The following code works if I remove the
interactive_blocks
piece - a DM gets sent to the user. With theinteractive_blocks
option it fails. The blocks code was pulled directly from Block Kit Builder.Expected result
Expected result is to have a DM containing a drop-down selection menu sent to the specified user.
Actual result
Scenario 1: A DM with approve/deny buttons is sent to the user.
Scenario 2: When run with the
interactive_blocks
option the following error is produced:Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.