wa-sticker-hamma
v2.3.6
Published
<div align="center"> <img src="https://i.ibb.co/sHwxdFm/nightcore.jpg" alt="WATCIKER" width="500" />
Downloads
61
Maintainers
Readme
WA-STICKER-HAMMA
Whatsapp Sticker Creator/Formatter!
Installation
> npm i wa-sticker-hamma
Usage
Importing
💜 JavaScript
const hamma_sticker = require('wa-sticker-hamma')
💜 TypeScript
import * as hamma_sticker from 'wa-sticker-hamma'
Raw Functions
Add Metadata to Webp
const webpWithMetadata = await hamma_sticker.setMetadata('Pack Title', 'Author', image.webp) //returns the webp buffer with metadata
Create an exif metadata file
const exif = createExif('Pack', 'Author', 'filename') //returns the filename with ".exif"
Creating Sticker
Note: The following methods need imageMagick Legacy CLI tools
to be installed in your system
Regular Sticker
const sticker = new hamma_sticker.Sticker('image.png', {})
await sticker.build()
const sticBuffer = await sticker.get()
Non-streched sticker
const image = 'https://example.com/example.png'
const sticker = new hamma_sticker.Sticker(image, { crop: false })
await sticker.build()
const sticBuffer = await sticker.get()
Non-cropped Animated sticker
const sticker = new hamma_sticker.Sticker('./image.mp4', { crop: false, animated: true })
await sticker.build()
const sticBuffer = await sticker.get()
Sticker with Pack and Author Name
const sticker = new hamma_sticker.Sticker('https://example.com/sample.mp4', { crop: false, animated: true, pack: 'Pack', author: 'AUTHOR' })
await sticker.build()
const sticBuffer = await sticker.get()
Saving/Sending
Saving to File
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'))