Class SlashCommandBuilder



  • public class SlashCommandBuilder
    extends Object
    This class is used to create new slash commands.
    • Constructor Detail

      • SlashCommandBuilder

        public SlashCommandBuilder​()
        Creates a new slash command builder.
    • Method Detail

      • setName

        public SlashCommandBuilder setName​(String name)
        Sets the name of the slash command.
        Parameters:
        name - The name.
        Returns:
        The current instance in order to chain call methods.
      • setDescription

        public SlashCommandBuilder setDescription​(String description)
        Sets the description of the slash command.
        Parameters:
        description - The name.
        Returns:
        The current instance in order to chain call methods.
      • addOption

        public SlashCommandBuilder addOption​(SlashCommandOption option)
        Adds an slash command option to the slash command.
        Parameters:
        option - The option.
        Returns:
        The current instance in order to chain call methods.
      • setOptions

        public SlashCommandBuilder setOptions​(List<SlashCommandOption> options)
        Sets the slash commands for the slash command.
        Parameters:
        options - The options.
        Returns:
        The current instance in order to chain call methods.
      • setDefaultPermission

        public SlashCommandBuilder setDefaultPermission​(Boolean defaultPermission)
        Sets the default permission for the slash command whether the command is enabled by default when the app is added to a server.
        Parameters:
        defaultPermission - The default permission.
        Returns:
        The current instance in order to chain call methods.
      • getDelegate

        public SlashCommandBuilderDelegate getDelegate​()
        Gets the delegate used by the slash command builder internally.
        Returns:
        The delegate used by this slash command builder internally.