discord-canvas
discord-canvas copied to clipboard
Image size in fortniteShop()
The size of the generated image is larger than 8mb and discord cannot process it.
Is there a way to optimize the image before it gets posted ? Seen a npm packages (tinify) BUT since the image name keeps changing.
Yes tinify does the trick.
const tinify = require("tinify"); tinify.key = APIKEYS.Tinify;
await tinify.fromFile(image).toFile(image);
The image is the path to the file and after that it's creating the MessageAttachment.