Skip to content

MenuBuilder

Bonus Feature

Selection Menus are only available for servers with bonus!

This data type describes the selection menu builder. Almost all the methods return the same builder, so it is possible to build a method chains like this:

JuniperBot Template
{% do channel
    .createEmbed()
    .withDescription('Oh, hi!')
    .addSelectMenu('STRING', 'selectedSpecies', 'Who are you?', '27a55ca1-c13b-47f5-b8ad-e0da6329a53f')
      .addOption('Otter', 'otterOption', ':otter:')
      .addOption('Fox', 'foxOption', ':fox_face:')
      .withDefaultOption('foxOption')
    .endMenu()
    .send()
%}

Methods

withMinValues(Amount)

Sets the minimum amount of values user has to select (0-25, 1 by default).

Returns: MenuBuilder

withMaxValues(Amount)

Sets the maximum amount of values user can select at once (1-25, 1 by default).

Returns: MenuBuilder

withRequiredRange(Minimum, Maximum)

Sets the range of values user has to select (two previous methods combined).

Returns: MenuBuilder

addOption(Label, Value, Emote, Description)

Adds a new selection options for menus of STRING type (25 at max).

Returns: MenuBuilder

withDefaultOptions(Options)

Sets options selected by default.

Returns: MenuBuilder

withDefaultOption(Option)

Sets single option selected by default.

Returns: MenuBuilder

withChannelTypes(Types)

Sets channels type for CHANNEL menu.

Returns: MenuBuilder

withChannelType(Type)

Sets single channel type for CHANNEL menu.

Returns: MenuBuilder

endMenu()

Returns an Embed object related to this menu. Used to continue the method chain for Embed.

Returns: Embed

All rights sniffed.