angga759 / wa-sticker-formatter

Sticker Creator for WhatsApp

Home Page:https://www.npmjs.com/package/wa-sticker-formatter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Sticker Creator for WhatsApp

https://www.npmjs.com/package/wa-sticker-formatter


Languages

Language:C 94.9%Language:TypeScript 4.9%Language:JavaScript 0.3%