Class ChatCommands
java.lang.Object
io.github.icrazyblaze.twitchmod.chat.ChatCommands
This class is where all the commands are registered for use in ChatPicker.
- See Also:
ChatPicker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Commands are registered here fromChatPicker.doCommand(java.lang.String, java.lang.String)
.static void
initDynamicCommands(String argString, String sender)
Commands that are registered here need to be re-added to the command registry every time a command is checked because they have changing ("dynamic") arguments.static void
registerCommand(Runnable runnable, String... keys)
Adds a command to a list that ChatPicker checks.
-
Constructor Details
-
ChatCommands
public ChatCommands()
-
-
Method Details
-
registerCommand
Adds a command to a list that ChatPicker checks. TheregisterCommand(java.lang.Runnable, java.lang.String...)
method takes two arguments: a runnable, and any number of command aliases.registerCommand(() -> CommandHandlers.myCommand(), "mycommand", "mycommandalias");
- Parameters:
runnable
- The function linked to the commandkeys
- Aliases for the command- See Also:
ChatPicker
-
initCommands
public static void initCommands()Commands are registered here fromChatPicker.doCommand(java.lang.String, java.lang.String)
. -
initDynamicCommands
Commands that are registered here need to be re-added to the command registry every time a command is checked because they have changing ("dynamic") arguments.- Parameters:
argString
- the argument for the commandsender
- the name of the command sender
-
getRegisteredCommands
- Returns:
- a sorted list of all the currently registered commands and their aliases
-