client.on('messageCreate', async message => // Check if the message has attachments if (message.attachments.size > 0) const attachment = message.attachments.first();

Edit config/imagepng.yml :

Note: On some operating systems, this may require additional build tools (like Python or C++ compiler) to be installed on your machine.

if (inputFormat !== 'png') image = await sharp(input).png().toBuffer();