Package org.javacord.api.interaction
Class SlashCommandOptionBuilder
- java.lang.Object
-
- org.javacord.api.interaction.SlashCommandOptionBuilder
-
public class SlashCommandOptionBuilder extends Object
-
-
Constructor Summary
Constructors Constructor Description SlashCommandOptionBuilder()Creates a new slash command option builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SlashCommandOptionBuilderaddChoice(String name, int value)Adds an int choice for the slash command option.SlashCommandOptionBuilderaddChoice(String name, String value)Adds an string choice for the slash command option.SlashCommandOptionBuilderaddChoice(SlashCommandOptionChoice choice)Adds an choice for the slash command option.SlashCommandOptionBuilderaddOption(SlashCommandOption option)Adds an slash command option to the slash command option.SlashCommandOptionbuild()Builds the slash command option.SlashCommandOptionBuildersetChoices(List<SlashCommandOptionChoice> choices)Sets the choices of the slash command option.SlashCommandOptionBuildersetDescription(String description)Sets the description of the slash command option.SlashCommandOptionBuildersetName(String name)Sets the name of the slash command option.SlashCommandOptionBuildersetOptions(List<SlashCommandOption> options)Sets the slash commands for the slash command option.SlashCommandOptionBuildersetRequired(boolean required)Sets if the slash command option is required.SlashCommandOptionBuildersetType(SlashCommandOptionType type)Sets the type of the slash command option.
-
-
-
Method Detail
-
setType
public SlashCommandOptionBuilder setType(SlashCommandOptionType type)
Sets the type of the slash command option.- Parameters:
type- The type.- Returns:
- The current instance in order to chain call methods.
-
setName
public SlashCommandOptionBuilder setName(String name)
Sets the name of the slash command option.- Parameters:
name- The name.- Returns:
- The current instance in order to chain call methods.
-
setDescription
public SlashCommandOptionBuilder setDescription(String description)
Sets the description of the slash command option.- Parameters:
description- The description.- Returns:
- The current instance in order to chain call methods.
-
setRequired
public SlashCommandOptionBuilder setRequired(boolean required)
Sets if the slash command option is required.- Parameters:
required- Whether or not the option is required.- Returns:
- The current instance in order to chain call methods.
-
addChoice
public SlashCommandOptionBuilder addChoice(SlashCommandOptionChoice choice)
Adds an choice for the slash command option.- Parameters:
choice- The choice.- Returns:
- The current instance in order to chain call methods.
-
addChoice
public SlashCommandOptionBuilder addChoice(String name, String value)
Adds an string choice for the slash command option.- Parameters:
name- The name of the choice.value- The value of the choice.- Returns:
- The current instance in order to chain call methods.
-
addChoice
public SlashCommandOptionBuilder addChoice(String name, int value)
Adds an int choice for the slash command option.- Parameters:
name- The name of the choice.value- The value of the choice.- Returns:
- The current instance in order to chain call methods.
-
setChoices
public SlashCommandOptionBuilder setChoices(List<SlashCommandOptionChoice> choices)
Sets the choices of the slash command option.- Parameters:
choices- The choices.- Returns:
- The current instance in order to chain call methods.
-
addOption
public SlashCommandOptionBuilder addOption(SlashCommandOption option)
Adds an slash command option to the slash command option.- Parameters:
option- The option.- Returns:
- The current instance in order to chain call methods.
-
setOptions
public SlashCommandOptionBuilder setOptions(List<SlashCommandOption> options)
Sets the slash commands for the slash command option.- Parameters:
options- The options.- Returns:
- The current instance in order to chain call methods.
-
build
public SlashCommandOption build()
Builds the slash command option.- Returns:
- The built option.
-
-