Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 253 forks source link

Add ability to regex postbacks #119

Open FnTm opened 6 years ago

FnTm commented 6 years ago

There was an open issue #87 which asked for ability to regex postbacks. Since I also really needed this functionality - I went ahead and did a quick implementation to get the discussion going.

The api is a complete copy of bot.hear(). This also takes in either a string | RegExp or an array of such, and makes a map to verify later.

I can go ahead and add tests for this, if this is something we'd want to move forwards with. @Charca what do you think?

//cc @mraaroncruz @PandawanFr as both of you originally requested this feature.

FnTm commented 4 years ago

@Charca I know that I'm committing necromancy by reviving this issue, but what do you think of going ahead with this? I've been realising that my branch is something like a year behind the master, and I'd like to update to a later version, but also would like to keep using the changes introduced here (I've been using them for more than a year, and no issues yet)

FnTm commented 4 years ago

@Charca the Message Tag issue forced me to update my fork to work with master. Could we maybe use this opportunity to review the possibility of merging this PR?

Or is there something more that I should do before this is ready?

As I've mentioned above - I've been running this in my (tiny) production for ~2 years now without any issues.

Charca commented 4 years ago

Hey @FnTm, apologies for the huge delay. As I mentioned in other issues and PRs, I'm not actively working on this project and have not worked with Messenger bots in a while.

This PR looks good to me and I think we can merge it. Would it be possible to add a small section in the README file with some simple instructions on how to use this new method? Thank you.

FnTm commented 4 years ago

yes, for sure! I'll add that ASAP, and ping you for a review.