Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a regex to postback callbacks #87

Closed
mraaroncruz opened this issue Nov 25, 2017 · 1 comment
Closed

Allow a regex to postback callbacks #87

mraaroncruz opened this issue Nov 25, 2017 · 1 comment

Comments

@mraaroncruz
Copy link
Collaborator

mraaroncruz commented Nov 25, 2017

Can we do this in a way that doesn't muddle the api for bot.on?

Some ideas:

bot.on(/postback:PRODUCT[0-9]{1,3}/, (payload, chat) => {})

bot.postback(/PRODUCT[0-9]{1,3}/, (payload, chat) => {})

bot.on('postback', /postback:PRODUCT[0-9]{1,3}/, (payload, chat) => {})

Anyone else have any API ideas here?

@Pandawan
Copy link

Pandawan commented Jan 7, 2018

👍 I also need this for my bot. I need to make buttons that allow you to unsubscribe from a given topic and wanted to do so like this:

bot.on(/postback:UNSUB_(\S*)/i, (payload, chat, data) => {

But it seems like that is not available... Please add!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants