Class Command

    • Constructor Detail

      • Command

        public 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:
        true if has, false otherwise
      • 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 in CommandManager it also might happen when the bot was mentioned except of the bot prefix. Also according to settings in CommandManager prefixes may vary between servers.
        Parameters:
        context - data about the trigger
        args - the arguments typed when triggered
        Returns:
        command execution success state