1.2.2 • Published 1 year ago

optifine-cape-uploader v1.2.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Usage

const {
   getCape
} = require('optifine-cape-uploader');

(async () => {
   const result = await getCape('exampleUsername', null, 'YOUR_IMGUR_CLIENT_ID');

   switch (result) {
   case 'InvalidAspectRatio':
      console.error('The cape does not have a valid 2:1 aspect ratio.');
      break;
   case 'InvalidResizeDimensions':
      console.error('The provided resize dimensions are invalid.');
      break;
   case 'NoCapeAvailable':
      console.error('The user does not have an Optifine cape available.');
      break;
   case 'ProcessingError':
      console.error('An error occurred while processing the cape.');
      break;
   case 'UploadFailed':
      console.error('Upload to Imgur failed.');
      break;
   case 'UploadError':
      console.error('Error during upload to Imgur.');
      break;
   default:
      console.log('Imgur image link:', result.imgurLink);
   }
})();

Here are some examples of the expected output:

Default Size (140x280)

Expected output:

Custom Size (e.g., 128x128)

Expected output:

Note

  • resizeDimensions: This parameter is optional and defines the size of the cape image to be generated. It should be provided in the format 'Width x Height'. Replace null with the specific dimensions you want, such as '128x128'. If not provided, the function will use the default dimensions '140x280'.
1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago