Skip to content

Add context.matches support in app.message handlers #37

Description

@seratch

Description

As with Bolt for jS, the app.message handler should provide context.matches to listener functions.

app.message(/^(hi|hello|hey).*/, async ({ context, say }) => {
  // RegExp matches are inside of context.matches
  const greeting = context.matches[0];

  await say(`${greeting}, how are you?`);
});

https://github.com/slackapi/bolt-js/blob/%40slack/bolt%402.2.3/docs/_basic/listening_messages.md#using-a-regexp-pattern

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue here.

Activity

  1. added this to the 0.3.0a0 milestone on Aug 12, 2020
  2. self-assigned this
    on Aug 12, 2020
  3. added a commit that references this issue on Aug 25, 2020
    2086247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions