2

My Slack app sends a radio-button question to the users. The app is built using bolt-js. The radio buttons are inside an input block (ref: Slack Block Kit).

According to bolt-js reference for the method app.action:

... Note that action elements included in an input block do not trigger any events.

However, I still receive events on the app.action listener from elements that are inside the input block.

The code for sending the message is this:

await client.chat.postMessage({
  "channel": channelId,
  "blocks": [
    {
      "type": "input",
      "label": {
        "type": "plain_text",
        "text": "Some question"
      },
      "element": {
        "type": "radio_buttons",
        "options": [
          {
            "text": {
              "type": "plain_text",
              "text": "Option A",
            },
            "value": "value-0"
          },
          {
            "text": {
              "type": "plain_text",
              "text": "Option B",
            },
            "value": "value-1"
          },
        ],
        "action_id": "some_action",
      }
    }
  ],
  "text": "Some Text"
});

I have tried:

  • Removing the app.action('some_action') listener for this particular action. With this, the app logs show the following error:

[ERROR] An incoming event was not acknowledged within 3 seconds. Ensure that the ack() argument is called in a listener.

  • Removing the "action_id": "some_action" line from the block json. I still get the above mentioned error in the logs.

  • Explicitly setting "dispatch_action": false in the block json (which is false by default according to the input block reference). The event is still triggered.

I do not want the event to be triggered. What am I doing wrong?

dryairship
  • 6,022
  • 4
  • 28
  • 54

0 Answers0