Use carousal from custom action for fb messenger and telegram #8720

msg as carousal from rasa in fb messenger or telegram how can we do it, do anyone have idea??

send carousel format msg from rasa

Hi @vivek22122014 ,

could you please elaborate in full sentences what you want to do? From what I can guess based on your message, you’ll need a custom channel connector.

I want to send msg as carousal from cutsom action in facebook messenger

To display a carousel in Facebook Messenger you just have to pass some JSON objects in your response. Those elements have to be formatted as expected by FB defined here. That would look something like this:

carousel_slides = [
  {
    "title": ...
    "subtitle": ...
    "image_url": ...
    "buttons": []
  }
]

Once you have your list of JSON elements you want to include in your carousel all you have to do is call:

dispatcher.utter_message(elements=carousel_slides)

Rasa will take care of appending the other metadata elements to the carousel and append your carousel slides to the response.

1 Like

Thanks but this gives invalid syntax error @m.vielkind :slight_smile:

Can you provide an example of what you’re doing? The example I provided was only for Facebook. You asked about Telegram as well, I’m not as familiar with that one so the syntax may change a little with that channel.

@vivek22122014 please check this Post. I have mentioned the code to get the carousel in fb for the buttons to open a webpage