Skip to content

Converting from image/gif/videos on whatsapp to a sticker by using a caption in a chat where the bot is present

License

Notifications You must be signed in to change notification settings

deven96/whatsticker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whatsticker

mythra

Release Pipeline Production

A Whatsapp bot that turns pictures, small videos and gifs into stickers

Chat with Whatsticker

Usage

example_video.mp4

Simple Requirements

If you are not interested in running a copy of the project then feel free to use the whatsticker number provided. You can only send private messages and it cannot be added to group chats

Technical Requirements

Setting up

  • Download Go modules

    # Downloads go modules
    go mod tidy
  • Create a meta business app for whatsapp cloud API found here WhatsApp FAQ. Make sure to add the whatsapp product for the app.

  • Retrieve the access token from the app to be later used as BEARER_ACCESS_TOKEN

  • Start ngrok on port 9000 (using us region or adding the webhook would be an issue)

    ngrok -http 9000 --region us
  • Create a webhook by following Configure WebHook and add the ngrok link given to you. Save the verify token add to be later used as VERIFY_TOKEN.

  • Configure the webhook to subscribe to messages.

Running The Bot

  • Export the necessary tokens
export VERIFY_TOKEN=<xxxxxxx>
export BEARER_ACCESS_TOKEN=<xxxxxxx>

Architecture

Arch Diagram

Open the architecture on draw.io

Limits/Issues

  • Media sizes/length enforced by whatsapp (100KB image, 500KB video)
  • Video conversion takes time using ffmpeg to be able to whittle away at quality in order to achieve 500KB
  • Animated stickers (from videos) may not maintain aspect ratio

License

This project is opened under the MIT License which allows very broad use for both academic and commercial purposes

Credits

Library/Resource Use
tulir/whatsmeow whatsmeow is a Go library for the WhatsApp web multidevice API.
ffmpeg A complete cross platform solution to record, convert and stream video (and audio).
cwebp Compress an image file into WebP file
webpmux Write exif file to set metadata on stickers
prometheus Live metrics of stickerization

About

Converting from image/gif/videos on whatsapp to a sticker by using a caption in a chat where the bot is present

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project