Package org.javacord.api.interaction
Class SlashCommandOptionBuilder
- java.lang.Object
-
- org.javacord.api.interaction.SlashCommandOptionBuilder
-
public class SlashCommandOptionBuilder extends java.lang.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 SlashCommandOptionBuilder
addChannelType(ChannelType channelType)
Adds a channel type to the slash command option.SlashCommandOptionBuilder
addChoice(java.lang.String name, int value)
Adds an int choice for the slash command option.SlashCommandOptionBuilder
addChoice(java.lang.String name, java.lang.String value)
Adds a string choice for the slash command option.SlashCommandOptionBuilder
addChoice(SlashCommandOptionChoice choice)
Adds a choice for the slash command option.SlashCommandOptionBuilder
addDescriptionLocalization(DiscordLocale locale, java.lang.String localization)
Adds a description localization for the given locale.SlashCommandOptionBuilder
addNameLocalization(DiscordLocale locale, java.lang.String localization)
Adds a name localization for the given locale.SlashCommandOptionBuilder
addOption(SlashCommandOption option)
Adds a slash command option to the slash command option.SlashCommandOption
build()
Builds the slash command option.SlashCommandOptionBuilder
setAutocompletable(boolean autocompletable)
Sets if this option can be autocompleted.SlashCommandOptionBuilder
setChannelTypes(java.util.Collection<ChannelType> channelTypes)
Sets the channel types for the slash command option.SlashCommandOptionBuilder
setChoices(java.util.List<SlashCommandOptionChoice> choices)
Sets the choices of the slash command option.SlashCommandOptionBuilder
setDecimalMaxValue(double decimalMaxValue)
Sets the maximum value permitted for theSlashCommandOptionType.DECIMAL
slash command option.SlashCommandOptionBuilder
setDecimalMinValue(double decimalMinValue)
Sets the minimum value permitted for theSlashCommandOptionType.DECIMAL
slash command option.SlashCommandOptionBuilder
setDescription(java.lang.String description)
Sets the description of the slash command option.SlashCommandOptionBuilder
setLongMaxValue(long longMaxValue)
Sets the maximum value permitted for theSlashCommandOptionType.LONG
slash command option.SlashCommandOptionBuilder
setLongMinValue(long longMinValue)
Sets the minimum value permitted for theSlashCommandOptionType.LONG
slash command option.SlashCommandOptionBuilder
setName(java.lang.String name)
Sets the name of the slash command option.SlashCommandOptionBuilder
setOptions(java.util.List<SlashCommandOption> options)
Sets the slash commands for the slash command option.SlashCommandOptionBuilder
setRequired(boolean required)
Sets if the slash command option is required.SlashCommandOptionBuilder
setType(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(java.lang.String name)
Sets the name of the slash command option.- Parameters:
name
- The name.- Returns:
- The current instance in order to chain call methods.
-
addNameLocalization
public SlashCommandOptionBuilder addNameLocalization(DiscordLocale locale, java.lang.String localization)
Adds a name localization for the given locale.- Parameters:
locale
- The locale to add this localization for.localization
- The option name localization.- Returns:
- The current instance in order to chain call methods.
-
setDescription
public SlashCommandOptionBuilder setDescription(java.lang.String description)
Sets the description of the slash command option.- Parameters:
description
- The description.- Returns:
- The current instance in order to chain call methods.
-
addDescriptionLocalization
public SlashCommandOptionBuilder addDescriptionLocalization(DiscordLocale locale, java.lang.String localization)
Adds a description localization for the given locale.- Parameters:
locale
- The locale to add this localization for.localization
- The option description localization.- 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 the option is required.- Returns:
- The current instance in order to chain call methods.
-
setAutocompletable
public SlashCommandOptionBuilder setAutocompletable(boolean autocompletable)
Sets if this option can be autocompleted.- Parameters:
autocompletable
- Whether the option can be autocompleted.- Returns:
- The current instance in order to chain call methods.
-
addChoice
public SlashCommandOptionBuilder addChoice(SlashCommandOptionChoice choice)
Adds a choice for the slash command option.- Parameters:
choice
- The choice.- Returns:
- The current instance in order to chain call methods.
-
addChoice
public SlashCommandOptionBuilder addChoice(java.lang.String name, java.lang.String value)
Adds a 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(java.lang.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(java.util.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 a 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(java.util.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.
-
addChannelType
public SlashCommandOptionBuilder addChannelType(ChannelType channelType)
Adds a channel type to the slash command option.- Parameters:
channelType
- The channel type.- Returns:
- The current instance in order to chain call methods.
-
setChannelTypes
public SlashCommandOptionBuilder setChannelTypes(java.util.Collection<ChannelType> channelTypes)
Sets the channel types for the slash command option.- Parameters:
channelTypes
- The channel types.- Returns:
- The current instance in order to chain call methods.
-
setLongMinValue
public SlashCommandOptionBuilder setLongMinValue(long longMinValue)
Sets the minimum value permitted for theSlashCommandOptionType.LONG
slash command option.- Parameters:
longMinValue
- The minimum value permitted.- Returns:
- The current instance in order to chain call methods
-
setLongMaxValue
public SlashCommandOptionBuilder setLongMaxValue(long longMaxValue)
Sets the maximum value permitted for theSlashCommandOptionType.LONG
slash command option.- Parameters:
longMaxValue
- The maximum value permitted.- Returns:
- The current instance in order to chain call methods
-
setDecimalMinValue
public SlashCommandOptionBuilder setDecimalMinValue(double decimalMinValue)
Sets the minimum value permitted for theSlashCommandOptionType.DECIMAL
slash command option.- Parameters:
decimalMinValue
- The minimum value permitted.- Returns:
- The current instance in order to chain call methods
-
setDecimalMaxValue
public SlashCommandOptionBuilder setDecimalMaxValue(double decimalMaxValue)
Sets the maximum value permitted for theSlashCommandOptionType.DECIMAL
slash command option.- Parameters:
decimalMaxValue
- The maximum value permitted.- Returns:
- The current instance in order to chain call methods
-
build
public SlashCommandOption build()
Builds the slash command option.- Returns:
- The built option.
-
-