Discord.js using an Image from merge-images as an embed thumbnail

I’m using merge-images and canvas to mix an image with other Images however the issue here is I don’t know how to set a discord.js message embed as the image i made using merge-images

const mergeImages = require('merge-images')
const { Canvas, Image }  = require('canvas');

module.exports = {
    name: 'skin',
    description: 'views your skin avatar',
    async execute(message, args, client, prefix) {
        let items = [`assets/colors/${skinData}.png`, `assets/outfits/${outfitData}.png`, `assets/hats/${hatData}.png`, `assets/pets/${petData}.png`];
        
        
        let b64 = await mergeImages(items, { Canvas: Canvas, Image: Image });
        b64 = b64.split(';base64,').pop();
        
        const embed = new Discord.MessageEmbed()
        .setTitle('a')
        .setThumbnail(b64)
        message.channel.send(embed)
         
    }
}

Ignore the items dir those are working I have checked the issue is setting the image from
let b64 = await mergeImages(items, { Canvas: Canvas, Image: Image }); b64 = b64.split(';base64,').pop(); into the .setThumbnail() function I have tried in the shown code but is isn’t working

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.