Make sure you have ImageMagick
installed in your system before using this
> npm i wa-sticker-formatter
const WSF = require('wa-sticker-formatter')
import * as WSF from 'wa-sticker-formatter'
const sticker = new WSF.Sticker('image.png', {})
await sticker.build()
const sticBuffer = await sticker.get()
const image = 'https://example.com/example.png'
const sticker = new WSF.Sticker(image, { crop: false })
await sticker.build()
const sticBuffer = await sticker.get()
const sticker = new WSF.Sticker('./image.mp4', { crop: false, animated: true })
await sticker.build()
const sticBuffer = await sticker.get()
const sticker = new WSF.Sticker('https://example.com/sample.mp4', { crop: false, animated: true, pack: 'Pack', author: 'AUTHOR' })
await sticker.build()
const sticBuffer = await sticker.get()
const sticker = new WSF.Sticker('https://example.com/sample.mp4')
sticker.setAuthor('Me! ใฝ') //Now Supports Emojis! ๐
sticker.setPack('My Pack! ๐ฑ')
await sticker.build()
const sticBuffer = await sticker.get()
You can also set metadata using the following function too
import { setMetadata } from 'wa-sticker-formatter'
const sticBuffer = await setMetadata('Pack', 'Author','image.webp')
Create Manual exif file
import { createExif } from 'wa-sticker-formatter'
createExif('Pack', 'Author', 'metadata')
fs.writeFile('sticker.webp', sticBuffer)
Sending With Baileys
conn.sendMessage(jid, sticBuffer, MessageType.sticker)
Sending With Open-Wa/Wa-Automate-Nodejs
client.sendRawWebpAsSticker(jid, sticBuffer.toString('base64'))