Choices

A block can also contain buttons, or Choices. These can be added using the pushChoice function to push a ChoiceBuilder Block, of which there are several, depending on need. UrlCB links to a URL, BlockCB points to a BlockId. Here a button, that leads points back to the Menu, is added to the BasicBB with the result string

basicBB.pushChoice(
    new BlockCB("60e2b7f2ba7625f3fb73dd56")
        .addTitle(Languages.ENGLISH, "Back to Menu")
);

Some Choices that are used quite often, including the one above, has been pre-built so there is no need to build it repeatedly.

basicBB.pushChoice(backToMenu());

Last updated