Package com.reign.kat.lib.command
Class Command
java.lang.Object
com.reign.kat.lib.command.Command
- Direct Known Subclasses:
- ButtonTestCommand,- ClearPlaylistCommand,- CommandExceptionTestCommand,- DebugParentCommand,- HelpCommand,- JoinCommand,- KillCommand,- LeaveCommand,- LevelCommand,- LoopCommand,- LyricsCommand,- MoveCommand,- NowPlayingCommand,- ParentCommand,- PlayCommand,- PlayNextCommand,- PrefixCommand,- QueueCommand,- RemoveCommand,- SeekCommand,- ShuffleCommand,- SkipCommand,- SlapCommand,- TestCommand,- TimingCommand,- VoiceRecogDebugCommand,- VoiceStateCommand
- 
Field SummaryFieldsModifier and TypeFieldDescriptionList of argument Converters, parsed on command executionprotected static final org.slf4j.Loggerfinal StringName of the CommandList of pre commands which are ran before command executionprotected intRequired Discord permission to run the commandprotected PermissionGroupTypeRequired permission to run the command
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddConverter(Converter<?> converter) Add a Converter to the commandvoidaddPreCommand(BiFunction<Context, CommandParameters, PreCommandResult> precommand) Add a Pre command to the commandabstract voidexecute(Context ctx, CommandParameters args) voidexecuteCommands(Context ctx, List<String> args) Calls the parent command before calling a subcommandgetName()intReturns the argument signature for the command.getSubcommand(String alias) booleanvoidinvokeCommand(Context c, CommandParameters args) booleanisPrivileged(net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.channel.concrete.TextChannel channel) booleanvoidregisterSubcommand(Command command) voidsetRequiredDiscordPermission(int permBitfield) Set the required Discord permissions a user must have to execute the command.voidsetRequiredPermissionGroup(PermissionGroupType permission) Set the required permission type a user must have to execute the command.voidsetShowTyping(boolean status) net.dv8tion.jda.api.interactions.commands.build.CommandData
- 
Field Details- 
logprotected static final org.slf4j.Logger log
- 
nameName of the Command
- 
requiredPermissionRequired permission to run the command
- 
requiredDiscordPermissionprotected int requiredDiscordPermissionRequired Discord permission to run the command
- 
convertersList of argument Converters, parsed on command execution
- 
precommandsList of pre commands which are ran before command execution
 
- 
- 
Constructor Details- 
Command
 
- 
- 
Method Details- 
addConverterAdd a Converter to the command
- 
addPreCommandAdd a Pre command to the command
- 
updateSlashDatapublic net.dv8tion.jda.api.interactions.commands.build.CommandData updateSlashData()
- 
registerSubcommand
- 
getSubcommand
- 
getAliases
- 
getPrimaryAlias
- 
getName
- 
getDescription
- 
setShowTypingpublic void setShowTyping(boolean status) 
- 
isShowTypingpublic boolean isShowTyping()
- 
getRequiredCountpublic int getRequiredCount()
- 
getSignatureReturns the argument signature for the command.
 For example, the command!kick UserID opt:reason 
 would build a signature string of:-kick <user:User> [reason: String] - Returns:
- String signature
 
- 
setRequiredPermissionGroupSet the required permission type a user must have to execute the command.- Parameters:
- permission- PermissionGroupType to limit execution to (and above).
 
- 
setRequiredDiscordPermissionpublic void setRequiredDiscordPermission(int permBitfield) Set the required Discord permissions a user must have to execute the command. Examples:MANAGE_MESSAGES, ADMINISTRATOR`.
 It may be better to use setRequiredPermissionGroup instead, unless the command action would require a Discord permission - a command to delete messages, for example.- Parameters:
- permBitfield- DiscordPermission bitfield of permissions.
 
- 
isPrivilegedpublic boolean isPrivileged(net.dv8tion.jda.api.entities.Member member, net.dv8tion.jda.api.entities.channel.concrete.TextChannel channel) 
- 
execute- Throws:
- Exception
 
- 
executeCommandsCalls the parent command before calling a subcommand- Parameters:
- ctx- Context of the command
- args- string args to convert into Converters
- Throws:
- Exception
 
- 
invokeCommand- Throws:
- Exception
 
- 
hasChildrenpublic boolean hasChildren()
 
-