node-slack-interactive-messages icon indicating copy to clipboard operation
node-slack-interactive-messages copied to clipboard

Allow RegExp callback_id constraint matches to expose match results

Open aoberoi opened this issue 8 years ago • 1 comments

Description

If the adapter is going to use a RegExp to match against the callback_id, it would be useful to be able to pick out the parts in a capture group so you don't have to once again parse the callback_id inside the handler.

This would probably look like:

  • Change the matching implementation from using RegExp.test() to RegExp.exec()
  • Expose the return value to the handler function, somehow. Ideas:
  • as another argument to the handler, handler(payload, respond, matches) where matches is the value
  • inside an ext property of payload, so that in the future there is a dedicated namespace for new types of data to be exposed to the handler from. so, for example, you might find these results in payload.ext.callbackIdMatches.

Requirements

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

aoberoi avatar Apr 27 '18 22:04 aoberoi

Addressed by #138. If this seems like a mistake, please fell free to open a new issue in this project's new repository.

shaydewael avatar Jul 16 '19 20:07 shaydewael