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

Link Snippets: Sending multiple link/buttons #87

Closed
muelerma opened this issue May 21, 2019 · 2 comments
Closed

Link Snippets: Sending multiple link/buttons #87

muelerma opened this issue May 21, 2019 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@muelerma
Copy link

Hello everybody,

I played around with this but could not get it to work. Basically I just want that when sending a snippet message, there are multiple links shown below the title.

I tried two different variations here, first expanding the "buttons" list, secondly expanding the elements list, but still only one link is shown (like in the gif in the readme):
1st try:

  "attachment":{
    "type":"template",
    "payload":{
      "template_type":"generic",
      "elements":[
        {
          "title":"Title",
          "buttons":[ {
            "title":"Link 1",
            "url": "http://link1.url"
          },
          {
            "title":"Link 2",
            "url": "http://link2.url"
          }
        ]
      }
    ]
  }
}
}
emit(...)

2nd try:

message = {
  "attachment":{
    "type":"template",
    "payload":{
      "template_type":"generic",
      "elements":[
        {
          "title":"Title 1",
          "buttons":[ {
            "title":"Link 1",
            "url": "http://link1.url"
          },
        {
          "title":"Title 2",
          "buttons":[ {
            "title":"Link 2",
            "url": "http://link2.url"
          }
        ]
      }
    ]
  }
}
}
emit(...)

Somehow I think from the way the keys are named in this payload ("elements", "buttons") it must be possible to send and display multiple...

@radicand
Copy link

It looks like its hardcoded to one element at the moment: https://github.com/mrbot-ai/rasa-webchat/blob/ad6c44a0823cee81e0e2e331c69e416fba410ce0/src/components/Widget/index.js#L207-L215 . I would also love to see support for multiple items as well.

@MatthieuJnon
Copy link
Contributor

Please follow this issue #263 for proper documentation of available response types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants