optifine-cape-uploader
v1.2.2
Published
```javascript const { getCape } = require('optifine-cape-uploader');
Downloads
20
Maintainers
Readme
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)
Custom Size (e.g., 128x128)
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'
. Replacenull
with the specific dimensions you want, such as'128x128'
. If not provided, the function will use the default dimensions'140x280'
.