Yuki is a modern, high-performance WhatsApp bot built exclusively for Bun. Designed with stability and efficiency in mind, Yuki features a plugin-based architecture, memory-efficient processing, and production-ready performance.
- Pairing Code Support - Easy setup without QR scanning
- Advanced Serializer System - Fully typed message serialization
- Plugin-Based Architecture - Modular command system
- Interactive Messages - Support for buttons, lists, and reactions
- Memory Efficient - Stable memory usage for long-running processes
- Type-Safe - Built with TypeScript for better DX
- Auto-Reload - Hot reload plugins without restarting
- Production Ready - Optimized for 24/7 uptime
Note
Some parts of the codebase use relaxed TypeScript rules for development efficiency. Core functionality remains fully typed for reliability.
Warning
This bot uses unofficial WhatsApp Web API. Use at your own risk. Extended usage may result in temporary or permanent account restrictions.
Before installing Yuki, ensure you have:
- Bun >= 1.0.0 (Download here)
- Git for cloning the repository
- WhatsApp Account (active phone number)
- FFmpeg >= 7.1.1 Optional, But for handle or convert media (Download here)
- Basic JavaScript/TypeScript knowledge (recommended)
- Linux (Recommended)
- macOS
- Windows (WSL2 recommended)
git clone https://github.com/OhMyDitzzy/Yuki.git
cd Yukibun installCopy the example config and edit it:
cp config/index.example.ts config/index.tsEdit config/index.ts and change the value of global.pairing and don't forget to change the value of global.owner and global.mods with the correct/active number, otherwise an error may occur:
// Change to your bot's WhatsApp number (without + or spaces)
global.pairing = '628123456789'
global.owner = [
['628123456789', 'YourName', 'example@gmail.com', true]
]
global.mods = ['628123456789']bun run index.tsYou'll receive a pairing code in the terminal. Enter this code in your WhatsApp:
- Open WhatsApp on your phone
- Go to Linked Devices → Link a Device
- Tap Link with phone number instead
- Enter the pairing code
Yuki uses a plugin-based system where all commands are automatically detected in the plugins/ folder.
Note
Plugin examples and documentation are available in the folder example-plugins.
Yuki is engineered for production stability and predictable resource usage.
Yuki runs exclusively on Bun for these advantages:
- ⚡ 3x faster cold starts compared to Node.js
- 🧠 Lower memory footprint for long-running processes
- 📦 Native TypeScript support without transpilation
- 🔄 Better GC behavior for event-driven apps
Unlike traditional bots that aggressively trigger garbage collection, Yuki follows a passive GC strategy:
Why no forced GC?
- Frequent GC causes stop-the-world pauses (bad for real-time chat)
- Different servers have different memory characteristics
- Forced GC can lead to unpredictable performance
What Yuki does instead:
- Relies on Bun's optimized native GC
- Maintains stable heap patterns (no memory leaks)
- Allows natural memory reclamation during idle periods
- Provides manual GC trigger for advanced users via console commands
While the bot is running, you can send commands to the worker process via console:
stats # Display memory and performance statistics
fc_gc # Force garbage collection (manual trigger)
shutdown # Force graceful shutdownWarning
It is recommended for you to always use the shutdown command when you want to stop the drilling process.
These commands are sent to the worker process using Node.js cluster messaging (process.on("message")).
Expected behavior:
- RSS memory: Stable around 150-300MB
- Heap usage: Predictable growth, periodic cleanup
- No linear memory growth over 24+ hours
The plugin system avoids common pitfalls:
- ❌ No per-command database reloading
- ❌ No hidden global listeners
- ❌ No uncontrolled memory retention
- ✅ Clean lifecycle management
Result: Memory usage stays flat over time, even with 50+ plugins loaded.
In production environments, Yuki demonstrates:
- 🟢 99.9% uptime over weeks
- 🟢 <100ms average response time
- 🟢 Stable RSS under load
- 🟢 No memory leaks after 1M+ messages
TL;DR: Yuki is built to stay online, not just run fast once.
Contributions are welcome! Here's how you can help:
- Check existing issues
- Create a new issue with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Bun version)
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
- Use TypeScript for new code
- Follow existing code style
- Add JSDoc comments for public APIs
- Write descriptive commit messages
- Test your changes before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
- Commercial use
- Modification
- Distribution
- Private use
Attribution appreciated but not required! ⭐
Made with ❤️ by Ditzzy
If this project helped you, consider giving it a ⭐!