list

A list with multiple options, the click event on one of them, sends a payload that can be captured by a postback action block.

Platforms

Usage

@reply.list(
  {
    text: "Which pet do you like the most?",
    button: "Answer",
    sections:[
      {
        title: "Dogs",
        rows:[
          {
            title: "Labrador Retriever",
            payload: set_payload("pet_preferences", {pet: "dog", breed: "labrador_retriever"}),
          },
          {
            title: "German Shepherd",
            payload: set_payload("pet_preferences", {pet: "dog", breed: "german_shepherd"}),
          },
          {
            title: "Border Collie",
            payload: set_payload("pet_preferences", {pet: "dog", breed: "border_collie"})
          }
        ]
      },
      {
        title: "Cats",
        rows:[
          {
            title: "Persian",
            payload: set_payload("pet_preferences", {pet: "cat", breed: "persian"}),
          },
          {
            title: "Abyssinian",
            payload: set_payload("pet_preference", {pet: "cat", breed: "abyssinian"}),
          },
          {
            title: "Siamese",
            payload: set_payload("pet_preference", {pet: "cat", breed: "siamese"})
          }
        ]
      }
    ]
  }
)

Both arguments header and footer are optional, please read more information in the official WhatsApp documentation.

Last updated