Passing arguments to events subscriptions
See original GitHub issueHi!!
I have a question about how to pass information from a button event to the the button subscription…
I modified the bootbot source code to work something out, but I would to confirm if there is another way before I make a pull request. It is something like:
chat.say({
text: 'Some product here',
buttons: [
{ type: 'postback', title: 'More info', payload: 'INFO:product_id' }
]
});
bot.on('postback:INFO', (payload, chat, data, args) => {
console.log(args); // should print "product_id"
});
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:18 (6 by maintainers)
Top Results From Across the Web
C# Passing Parameters - Dynamic Event Subscription
Returns a List of expressions that represent the arguments to be passed to the delegate static IEnumerable<Expression> ...
Read more >Passing variables or arguments to an event action in PowerShell
The solution is simple. We just use the -MessageData parameter of Register-ObjectEvent. So, all event subscriptions get the object and can be ...
Read more >Passing Arguments to Event Listeners - Coding Explained -
See how to pass arguments to event listeners in Vue, and what happens by default, as well as how to use the $event...
Read more >Event Parameters Passed by Event Handlers - Plesk Obsidian
Event Parameters Passed by Event Handlers. This section describes the parameters that can be used with handlers that you set up for specific...
Read more >How to subscribe to and unsubscribe from events - C# ...
To subscribe to events programmatically · Define an event handler method whose signature matches the delegate signature for the event. · Use the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi guys. I think that also worth implement support of regexp parameters of postback events as at bot.hear(). I look forward to a solution of this issue. P.S Charca, thank you for awesome and lightweight lib. You rock 😃
@caiolopes absolutely, go ahead!