"Satu" means "One" in Indonesian - One bot, endless possibilities.
A sleek and powerful WhatsApp bot framework that unifies your WhatsApp experience. Built with TypeScript and Baileys, Satu provides a robust foundation for creating your own WhatsApp automation with elegance and simplicity. Whether you're building a business automation, group management, or just a fun bot, Satu makes it seamless.
- 🔐 Persistent Authentication: Never lose your session with SQLite-based session storage
- 📱 QR Code Support: Effortless login with QR code scanning
- 🎮 Command Handler: Intuitive command system for easy bot interaction
- 🔄 Auto Reconnect: Smart reconnection handling for uninterrupted service
- 📝 TypeScript Support: Full type safety and modern development experience
- 🗄️ Database Integration: Lightning-fast SQLite database with better-sqlite3
- 🚦 Status Management: Real-time connection status tracking
- 📋 Logging System: Comprehensive logging with Pino
- Node.js v14 or higher
- npm or yarn
- SQLite3
- Clone the repository
git clone https://github.com/MasRama/satu.git
cd satu- Install dependencies
npm install
# or
yarn install- Set up the database
npx knex migrate:latest- Start the bot
npm run dev
# or
yarn dev- Scan QR Code When you first run the bot, it will generate a QR code in the console. Scan this with your WhatsApp to authenticate.
The bot comes with a command handler system. Here's how to use it:
// Example command in your chat
!help // Shows available commands
!ping // Check if bot is responsive
// Add your custom commandsAdd new commands by creating files in the commands directory:
// commands/example.ts
export default {
name: 'example',
description: 'An example command',
execute: async (msg, args) => {
// Your command logic here
}
}src/
├── commands/ # Bot commands
├── services/ # Core services
│ ├── BaileyAuth.ts # Authentication handling
│ └── WhatsApp.ts # Main WhatsApp client
├── utils/ # Utility functions
└── index.ts # Entry point
The bot can be configured through environment variables and the config directory:
- Database settings in
knexfile.ts - WhatsApp client options in
src/services/WhatsApp.ts - Command settings in
src/commands/index.ts
// Send a message
WhatsApp.sendMessage(jid: string, message: string)
// Get connection status
WhatsApp.status // Returns: 'disconnected' | 'connecting' | 'connected' | 'qr'
// Check if ready
WhatsApp.ready // Returns: booleanContributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Baileys - The awesome WhatsApp Web API library
- Knex.js - SQL query builder
- TypeScript - For the amazing type system
Made with ❤️ using TypeScript and Baileys