Package com.mrivanplays.jdcf
Class Command
- java.lang.Object
-
- com.mrivanplays.jdcf.Command
-
- Direct Known Subclasses:
CommandHelp,CommandPrefix,CommandShutdown
public abstract class Command extends java.lang.ObjectRepresents a command. Extending classes may use the annotations located incom.mrivanplays.jdcf.datato give more information about the command itself (aliases, description, usage)
-
-
Constructor Summary
Constructors Constructor Description Command()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanexecute(@NotNull CommandExecutionContext context, @NotNull CommandArguments args)JDCF calls this method when the command was triggered from a message.booleanhasPermission(@NotNull PermissionCheckContext context)An overridable method which checks if the member has the required permission to execute the command.
-
-
-
Method Detail
-
hasPermission
public boolean hasPermission(@NotNull @NotNull PermissionCheckContext context)An overridable method which checks if the member has the required permission to execute the command.- Parameters:
context- permission check context- Returns:
trueif has,falseotherwise
-
execute
public abstract boolean execute(@NotNull @NotNull CommandExecutionContext context, @NotNull @NotNull CommandArguments args)JDCF calls this method when the command was triggered from a message. This will always happen when the command name was prefixed with the bot's prefix. According to settings inCommandManagerit also might happen when the bot was mentioned except of the bot prefix. Also according to settings inCommandManagerprefixes may vary between servers.- Parameters:
context- data about the triggerargs- the arguments typed when triggered- Returns:
- command execution success state
-
-