X Tutup
Skip to content

Use "type": "block_actions" when "type" is absent and "action_id" exists in App.action listener constraints #65

@seratch

Description

@seratch

Currently, some patterns supported by Bolt for JS are not yet available with Bolt for Python. For example, Bolt for Python requires "type": "block_actions" in the constraint object in an equivalent code to the following JS code. Also, it doesn't support filtering by a given block_id in the case yet.

https://github.com/slackapi/bolt-js/blob/0b37456f4781bf9262a36a6d200732840a156903/docs/_basic/listening_actions.md#listening-to-actions-using-a-constraint-object

// Your middleware will only be called when the action_id matches 'select_user' AND the block_id matches 'assign_ticket'
app.action({ action_id: 'select_user', block_id: 'assign_ticket' },
  async ({ action, ack, context }) => {
    await ack();
    try {
      const result = await app.client.reactions.add({
        token: context.botToken,
        name: 'white_check_mark',
        timestamp: action.ts,
        channel: action.channel.id
      });
    }
    catch (error) {
      console.error(error);
    }
  });

Reproducible in:

The slack_bolt version

v0.4.0a0

Python runtime version

any

OS info

any

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup