Package net.discordservices.dservices4j
Class Commands
- java.lang.Object
-
- net.discordservices.dservices4j.Commands
-
public class Commands extends Object
Class used for posting Command information (name, description and category) to the Discordservices API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Commands.CommandInfo
Class used for theaddCommand(...)
methods.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Commands
addCommand(Commands.CommandInfo command)
Adds a command to the list using aCommandInfo
instance.Commands
addCommands(List<Commands.CommandInfo> commands)
Adds the provided commands to the list using the provided List ofCommandInfo
instances.Commands
addCommands(Commands.CommandInfo... commands)
Adds the provided commands to the list using the providedCommandInfo
instances.void
postCommands()
Posts the previously set commands to the Discordservices API.Commands
setCommands(List<Commands.CommandInfo> commands)
Sets the provided commands for the list using the provided List ofCommandInfo
instances.Commands
setCommands(Commands.CommandInfo... commands)
Sets the provided commands for the list using the providedCommandInfo
instances.
-
-
-
Method Detail
-
addCommand
public Commands addCommand(Commands.CommandInfo command)
Adds a command to the list using aCommandInfo
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 providedCommandInfo
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 ofCommandInfo
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 providedCommandInfo
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 ofCommandInfo
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.
-
-