CapyBot is a WhatsApp bot that can create stickers. It's built with TypeScript and uses the Baileys library for WhatsApp Web API integration.
- Image Stickers: Convert images to WhatsApp stickers
- Video Stickers: Create animated stickers from videos (max 15 seconds)
- Media Processing: Support for various image and video formats
- Real-time Messaging: Handle incoming WhatsApp messages automatically
- QR Code Authentication: Easy setup with QR code scanning
Before running this project, make sure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn or pnpm
- FFmpeg (for video processing)
# Using Homebrew
brew install ffmpeg
# Using MacPorts
sudo port install ffmpeg
sudo apt update
sudo apt install ffmpeg
Download from FFmpeg official website or use Chocolatey:
choco install ffmpeg
-
Clone the repository
git clone https://github.com/capy-company/capybot.git cd capybot
-
Install dependencies
npm install
-
Build the project
npm run build
For development with hot reload:
npm run dev
First build, then run:
npm run build
npm start
# Using ts-node with watch mode
npm run dev:node
# Using tsx (recommended for development)
npm run dev
- Start the bot using one of the commands above
- Scan the QR code that appears in your terminal with your WhatsApp mobile app:
- Open WhatsApp on your phone
- Go to Settings > Linked Devices
- Tap "Link a Device"
- Scan the QR code displayed in your terminal
- Wait for connection - you should see "✅ CapyBot connected successfully!" in your terminal
- Send a message to your own number (if you're using your own WhatsApp account) or to the number to which you've linked the bot.
capybot/
├── src/
│ ├── bot.ts # Main bot entry point
│ ├── constants/ # Configuration constants
│ ├── handlers/ # Message and media handlers
│ ├── services/ # Media processing services
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
├── auth_info/ # WhatsApp authentication data (auto-generated)
├── temp/ # Temporary media files
├── dist/ # Compiled JavaScript files
└── package.json
npm run build
- Compile TypeScript to JavaScriptnpm start
- Run the compiled botnpm run dev
- Run in development mode with hot reloadnpm run lint
- Run ESLint to check code qualitynpm run lint:fix
- Fix ESLint issues automaticallynpm run format
- Format code with Prettiernpm run format:check
- Check code formattingnpm run quality
- Run lint, format check, and buildnpm run clean
- Remove compiled files
The bot uses default configurations for media processing. You can modify these in src/constants/config.ts
:
- Video Stickers: Max 15 seconds, 50MB file size
- Dimensions: 512x512 pixels
- FPS: 60 frames per second
- Quality: Medium
Sticker creation settings are located in src/constants/config.ts
. You can adjust:
- Maximum sticker size (dimensions and/or file size)
- Sticker quality
-
FFmpeg not found
- Make sure FFmpeg is installed and accessible in your PATH
- Restart your terminal after installation
-
Authentication issues
- Delete the
auth_info/
folder and restart the bot - Scan the new QR code
- Delete the
-
Port conflicts
- The bot doesn't use specific ports, but ensure no other WhatsApp Web sessions are active
-
Media processing errors
- Check file formats and sizes
- Ensure FFmpeg is properly installed
This project uses:
- ESLint for code linting
- Prettier for code formatting
- Husky for git hooks
- lint-staged for pre-commit checks
- Strict mode enabled
- ES2022 target
- ESNext modules
- Fork the repository
- Create a feature branch
- Make your changes
- Run quality checks:
npm run quality
- Commit your changes
- Push to your branch
- Create a pull request
- - Rate limiting:
- Limit the number of stickers per minute.
- Implement spam prevention mechanisms.
- - Media enhancements:
- Research maximum sticker size limits.
- Background removal for images
- Text-to-sticker generation
- - Performance optimizations
- Queue system for processing stickers
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please:
- Check the troubleshooting section above
- Search existing issues
- Create a new issue with detailed information
Note: This bot is for personal use. Please respect WhatsApp's terms of service and use responsibly.