public class UnrecognizedCommandEvent extends org.bukkit.event.Event
Allows external plugins to handle commands sent to Minecord in Discord that are not part of Minecord's commands.
isHandled()should be checked and made sure to be
falsebefore using the command.
handledcannot be set to
false, should be set to
declareHandled(), and is automatically updated to
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Method SummaryModifier and TypeMethodDescription
voidDeclares this unknown command has been handled.
net.dv8tion.jda.api.entities.UserGets the user that sent the command.Gets the mention string for the author.Gets the tag for the author.Gets the command that was sent by the user.
getReply()Gets the current reply to the unknown command.
booleanChecks if the command has been handled by an external plugin yet.
voidSets a new reply to be sent to the author.
Methods inherited from class org.bukkit.event.Event
(String command, net.dv8tion.jda.api.entities.User author)
getHandlers@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
- Specified by:
getHandlerListpublic static org.bukkit.event.HandlerList getHandlerList()
getCommandpublic String getCommand()Gets the command that was sent by the user.
- the command that was used.
getAuthorpublic net.dv8tion.jda.api.entities.User getAuthor()Gets the user that sent the command.
- the user that executed the command.
getReplypublic String getReply()Gets the current reply to the unknown command. By default this value is
getAuthorAsMention() + ", that is not a valid command."
- the reply that will be sent.
setReplypublic void setReply
(@Nonnull String reply)Sets a new reply to be sent to the author. This will set
reply- the new reply to send.
isHandledpublic boolean isHandled()Checks if the command has been handled by an external plugin yet.
- if the command has been handled yet.
declareHandledpublic void declareHandled()Declares this unknown command has been handled. For nearly all cases, plugins should declare it if they recognize the command.
handledcannot be set back to
getAuthorAsTagpublic String getAuthorAsTag()Gets the tag for the author. Equivalent to calling
getAuthor().getAsTag()For those who do not want to reference JDA's library.
- the tag of the author.
getAuthorAsMentionpublic String getAuthorAsMention()Gets the mention string for the author. Equivalent to calling
getAuthor().getAsMention()For those who do not want to reference JDA's library.
- the mention string of the author.