A simple, lightweight WhatsApp bot base built with Go and WhatsMeow library. Perfect for learning and building your own WhatsApp automation.
This project is currently under active development and will continue to be improved as needed. New features, bug fixes, and enhancements are being added regularly. Feel free to contribute or suggest improvements!
Note: This is a base template designed to be extended with your own features. The core functionality is stable, but additional features are continuously being developed.
- Go 1.24 or higher
- SQLite3
- Clone the repository:
git clone https://github.com/FahriAdison/Furina-Go.git
cd Furina-Go- Install dependencies:
go mod tidy- Build the application:
go build- Run the bot:
./furina-bot- Enter your WhatsApp number (format: +62xxx)
- Enter the pairing code shown into WhatsApp Web/Desktop
- Bot will connect and ready to receive messages
./furina-bot- Enter your phone number when prompted
- Enter the displayed pairing code in WhatsApp Web/Desktop
- Bot will connect automatically
The bot now uses a modular plugin architecture. All features are organized as plugins in the plugins/ directory.
- Ping Plugin (
plugins/general/ping.go): Simple test plugin- Commands:
!ping,!pong - Purpose: Test bot connectivity and response
- Commands:
- Create a new file in the appropriate subfolder (
plugins/general/,plugins/admin/, etc.) - Implement the
Plugininterface:
package general
import (
"furina-bot/lib"
"go.mau.fi/whatsmeow"
"go.mau.fi/whatsmeow/types/events"
)
type MyPlugin struct{}
// Ensure plugin implements the interface
var _ lib.Plugin = (*MyPlugin)(nil)
func NewMyPlugin() *MyPlugin {
return &MyPlugin{}
}
func (p *MyPlugin) GetName() string {
return "myplugin"
}
func (p *MyPlugin) GetCommands() []string {
return []string{"mycommand", "test"}
}
func (p *MyPlugin) GetDescription() string {
return "Description of my plugin"
}
func (p *MyPlugin) HandleMessage(client *whatsmeow.Client, message *events.Message) error {
// Handle the command here
return nil
}- Register the plugin in
main.goin theregisterPlugins()function:
func registerPlugins() {
// Existing plugins...
// Add your new plugin
myPlugin := general.NewMyPlugin()
pluginManager.RegisterPlugin(myPlugin)
}The bot uses a prefix-based command system:
- Default prefix:
! - Commands are case-insensitive
- Format:
!command [arguments] - Examples:
!ping,!help,!status
The bot uses default configuration. For customization, you can modify:
- Database path in
sessionsDirvariable - Logging level in
dbLogandclientLog - User agent in
PairPhone()parameters
- Sessions stored in
lib/sessions/directory - Automatic folder creation on first run
- Database contains login info and device keys
- Persistent connection across restarts
- Minimal console output
- Error-level logging only
- Connection status updates
- Message reception logs
# Install Go dependencies
go mod tidy
# Run in development mode
go run main.go
# Build for production
go build -o furina-bot# Build optimized binary
go build -ldflags="-s -w" -o furina-bot
# Run as service
./furina-bot-
"Failed to connect to WhatsApp"
- Check internet connection
- Verify WhatsApp Web is not active on other devices
- Try clearing session data:
rm -rf lib/sessions
-
"Database permission denied"
- Ensure
lib/sessions/directory is writable - Check file permissions:
chmod 755 lib/sessions/
- Ensure
-
"Invalid phone number format"
- Use international format: +62xxx
- Include country code
- Remove spaces and special characters
For debugging, you can modify logging levels in main.go:
// Change ERROR to DEBUG for verbose logging
dbLog := waLog.Stdout("Database", "DEBUG", true)
clientLog := waLog.Stdout("Client", "DEBUG", true)- Session Encryption: WhatsApp sessions are encrypted by default
- Local Storage: All data stored locally, no external servers
- Minimal Permissions: Only requires basic message access
- Clean Shutdown: Proper disconnection on exit
- Enhanced command system with prefix support
- Plugin architecture for modular features
- Improved error handling and recovery
- Better session management
- Database integration for user data and settings
- Group management and admin features
- Media message handling (images, documents, etc.)
- Webhook support for external integrations
- Docker containerization
- Configuration file support
- Rate limiting and anti-spam features
- Multi-device session support
- Web dashboard for bot management
- Analytics and usage statistics
- Backup and restore functionality
- Advanced message filtering
This project is licensed under the GPL-2.0 license - see the LICENSE file for details.
- Fork the repository
- Create feature branch:
git checkout -b feature/new-feature - Commit changes:
git commit -am 'Add new feature' - Push to branch:
git push origin feature/new-feature - Submit pull request
- WhatsMeow - WhatsApp Web API library
- go-sqlite3 - SQLite driver for Go
This bot is created for educational and development purposes. Make sure to comply with WhatsApp's Terms of Service when using this bot.
Development Notice: As this project is under continuous development, some features may change or be deprecated in future versions. Always check the latest documentation and changelog before updating.
Made with ❤️ By Papah-Chan
