Class Commands


  • public class Commands
    extends Object
    Class used for posting Command information (name, description and category) to the Discordservices API.
    • Method Detail

      • addCommand

        public Commands addCommand​(Commands.CommandInfo command)
        Adds a command to the list using a CommandInfo instance.
        Parameters:
        command - The Command that should be added.
        Returns:
        This class after the command was added. Useful for chaining.
      • addCommands

        public Commands addCommands​(Commands.CommandInfo... commands)
        Adds the provided commands to the list using the provided CommandInfo instances.
        Parameters:
        commands - The commands to add.
        Returns:
        This class after the command was added. Useful for chaining.
      • addCommands

        public Commands addCommands​(List<Commands.CommandInfo> commands)
        Adds the provided commands to the list using the provided List of CommandInfo instances.
        Parameters:
        commands - The commands to add.
        Returns:
        This class after the command was added. Useful for chaining.
      • setCommands

        public Commands setCommands​(Commands.CommandInfo... commands)
        Sets the provided commands for the list using the provided CommandInfo instances.
        This will remove all previously set commands!
        Parameters:
        commands - The commands to set.
        Returns:
        This class after the commands were set. Useful for chaining.
      • setCommands

        public Commands setCommands​(List<Commands.CommandInfo> commands)
        Sets the provided commands for the list using the provided List of CommandInfo instances.
        This will remove all previously set commands!
        Parameters:
        commands - The commands to set.
        Returns:
        This class after the commands were set. Useful for chaining.
      • postCommands

        public void postCommands()
        Posts the previously set commands to the Discordservices API.

        Rate Limits

        By default will the Wrapper only perform one request per 15 seconds per endpoint.
        If however, the Request either isn't successful or gets rate limited will those errors be logged in your terminal.

        Throws:
        NullPointerException - When no command was previously set.