sticker-bot
v1.0.0
Published
A WhatsApp bot that converts images to stickers from the terminal.
Readme
WhatsApp Sticker Bot
A WhatsApp bot that converts images to stickers using the !sticker command. Built with TypeScript, bundled with Bun, and run on Node.js.
[!IMPORTANT] USE AT YOUR OWN RISK: This bot uses unofficial WhatsApp Web APIs. WhatsApp may detect and block your account for using automated tools that violate their Terms of Service. The author is NOT LIABLE for any account bans, restrictions, or other consequences that may result from using this bot. By using this software, you acknowledge and accept all risks associated with automated WhatsApp interactions.
Features
- 🎨 Convert images to WhatsApp stickers
- 🔗 Support for direct image URLs
- 📱 QR code authentication
- 💾 Persistent authentication (LocalAuth)
- ✨ Colored console logging with Chalk
Prerequisites
- Node.js runtime (v24 or later)
- FFmpeg installed on your system
- WhatsApp account
Installation
Install the published command globally from npm:
npm install --global sticker-botTo install from source instead, clone the repository:
git clone https://github.com/AHaldner/sticker-bot.git
cd sticker-botBuilding from source additionally requires Bun v1.3.14 or later. Install dependencies and build the Node.js command with Bun:
bun install
bun run buildInstall FFmpeg:
# macOS (using Homebrew)
brew install ffmpeg
# Verify installation
which ffmpegCreate a .env file in the directory where you run the bot and set the FFmpeg path:
FFMPEG_PATH=/usr/local/bin/ffmpegNote: Update the path based on your FFmpeg installation location (use which ffmpeg to find it).
Usage
Start the globally installed bot:
sticker-botWhen running from source, use:
npm startThen scan the QR code with WhatsApp on your phone:
- Open WhatsApp on your phone
- Go to Settings > Linked Devices
- Tap "Link a Device"
- Scan the QR code displayed in the terminal
Send a message to any chat:
!sticker https://example.com/image.pngThe bot will convert the image at the URL into a sticker and send it back to the chat.
How It Works
- The bot listens for messages starting with
!sticker - Extracts the image URL from the message
- Downloads and converts the image to a sticker
- Sends the sticker back to the same chat
Technologies Used
- Node.js - JavaScript runtime
- Bun - Development package manager and build tool
- whatsapp-web.js - WhatsApp Web API
- TypeScript - Type-safe JavaScript
- qrcode-terminal - QR code generation
- Chalk - Terminal styling
Project Structure
sticker-bot/
├── index.ts # Main bot logic
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── .env # Environment variables (create this)
└── README.md # This fileTroubleshooting
FFmpeg not found
If you encounter FFmpeg errors:
- Ensure FFmpeg is installed:
which ffmpeg - Update the
FFMPEG_PATHin your.envfile with the correct path - Common paths:
- macOS (Homebrew):
/usr/local/bin/ffmpegor/opt/homebrew/bin/ffmpeg - Linux:
/usr/bin/ffmpeg
- macOS (Homebrew):
Authentication issues
Delete the .wwebjs_auth folder and restart the bot to re-authenticate.
Sticker creation fails
- Ensure the image URL is publicly accessible
- Check that the image format is supported (PNG, JPEG, WEBP)
- Verify the image size is reasonable (WhatsApp has size limits)
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Andrin Haldner
Legal Notice
This project is unofficial and is not affiliated with, authorized, maintained, sponsored, or endorsed by WhatsApp LLC or Meta Platforms, Inc. WhatsApp is a trademark of its respective owner.
This software relies on unofficial WhatsApp Web automation. Its use may violate WhatsApp's Terms of Service and may result in account restrictions or suspension. Users are solely responsible for ensuring that their use complies with applicable laws, third-party rights, and platform terms.
