Whatsticker
A Whatsapp bot that turns pictures, small videos and gifs into stickers
Chat with Whatsticker
Usage
https://user-images.githubusercontent.com/23453888/172902050-7e039696-2b31-469f-8d39-c900b80fae4b.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 also add it to group chats and it will work the exact same way. There might be occasional downtime but except it gets blocked it should be pretty reliable
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
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 |