UNPKG

discord-image-generation

Version:

discord-image-generation is a powerful module that allow you to generate awesome images.

13 lines 532 B
const jimp = require(`jimp`); const { validateURL } = require(`../functions`); module.exports = class Circle { async getImage(image) { if (!image) return console.error(`You must provide an image as a first argument.`); let isValid = await validateURL(image); if (!isValid) return console.error(`You must provide a valid image URL or buffer.`); image = await jimp.read(image); image.resize(480, 480); image.circle(); return await image.getBufferAsync(`image/png`); } };