1

Is it possible to have multiple menu attachment and allow users to select each menu before sending back the collated response?

 return Promise.resolve({
  text: `Rate each game`,
  attachments: [
    ...games.map(game => ({
      color: "#5A352D",
      title: game,
      callback_id: "game:done",
      actions: [
        {
          name: "done",
          text: "Select a score",
          type: "select",
          value: "game:done",
          options: [
            { text: 1, value: 1 },
            { text: 2, value: 2 }
          ]
        }
      ]
    }))
  ]
});

This images shows how it renders But, I need to call the callback only when the user has finished scoring each game.

Perhaps, I can provide an additional button for that, but how can I handle callback for these menu actions

AJUdensi
  • 25
  • 2
  • 6

1 Answers1

1

Choosing a menu option will always fire a request to your app. But you could replace the former message and recreate the menu list each time and show the remaining menus to the user until all are chosen. Technically it will be a new message each time, but by replacing the old message the user will not notice.

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • Thanks Eric. So, I wrote this to remove games that have been rated. And that worked perfectly. Thanks for the suggestion. – AJUdensi Dec 06 '17 at 18:35