question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing arguments to events subscriptions

See original GitHub issue

Hi!!

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:open
  • Created 7 years ago
  • Reactions:1
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
dlocationcommented, Feb 24, 2017

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 😃

3reactions
Charcacommented, Feb 23, 2017

@caiolopes absolutely, go ahead!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found