WATCIKER

WA-STICKER-FORMATTER

Whatsapp Sticker Creator/Formatter!



Make sure you have ImageMagick installed in your system before using this

🏮 Installation

> npm i wa-sticker-formatter

🎋 Usage

Importing

💛 JavaScript

const WSF = require('wa-sticker-formatter')

💙 TypeScript

import * as WSF from 'wa-sticker-formatter'

🎨 Creating Sticker

Regular Sticker

const sticker = new WSF.Sticker('image.png', {})
await sticker.build()
const sticBuffer = await sticker.get()

Non-streched sticker

const image = 'https://example.com/example.png' 
const sticker = new WSF.Sticker(image, { crop: false })
await sticker.build()
const sticBuffer = await sticker.get()

Non-cropped Animated sticker

const sticker = new WSF.Sticker('./image.mp4', { crop: false, animated: true })
await sticker.build()
const sticBuffer = await sticker.get()

Sticker with Pack and Author Name

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()

Setting Metadata Seperetely

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')

💌 Saving/Sending

Saving to File

fs.writeFile('sticker.webp', sticBuffer)

Sending With Baileys

conn.sendMessage(jid, sticBuffer, MessageType.sticker)
client.sendRawWebpAsSticker(jid, sticBuffer.toString('base64'))