public final class CommandHandlers
extends java.lang.Object
Constructor and Description |
---|
CommandHandlers() |
Modifier and Type | Method and Description |
---|---|
void |
clearCommands()
Clear commands in here, and all underlying command handlers.
|
java.util.Set<Command> |
getCommands()
Get all commands registered in RPF
|
java.util.Set<Command> |
getCommands(java.lang.String handler)
Get the commands from a specific handler
|
void |
newHandler(java.lang.String name,
java.lang.Class<? extends CommandHandler> handler,
Injector injector)
Create a new command handler, with a custom type
|
void |
newHandler(java.lang.String name,
Injector injector)
Create a new command handler.
|
void |
overrideHandler(java.lang.String name,
java.lang.Class<? extends CommandHandler> handler,
Injector injector) |
void |
process(java.lang.String commandHandler,
User user,
java.lang.String message)
Find and run a command in a specific handler.
|
public void process(java.lang.String commandHandler, User user, java.lang.String message)
commandHandler
- Handler to attempt to find the command inuser
- User running the commandmessage
- Message, including command prefix, command, and arguments.public void newHandler(java.lang.String name, Injector injector)
name
- String the command handler will be referenced byinjector
- Instance of the applications injector.public void newHandler(java.lang.String name, java.lang.Class<? extends CommandHandler> handler, Injector injector)
name
- String the command handler will be referenced byhandler
- Class of the command handlerinjector
- Instance of the application's injectorpublic void overrideHandler(java.lang.String name, java.lang.Class<? extends CommandHandler> handler, Injector injector)
public java.util.Set<Command> getCommands(java.lang.String handler)
handler
- Handler namepublic java.util.Set<Command> getCommands()
public void clearCommands()