sptzxgo is a modular and scalable WhatsApp bot built in Golang. It leverages the powerful whatsmeow library for WhatsApp Web integration and provides a flexible, event-driven architecture for handling commands and automating tasks efficiently.
-
WhatsApp Web Integration:
- Designed to interact with both group and personal chats.
- Full duplex messaging and event handling.
-
Command Management System:
- Modular commands organized into categories (e.g., AI tools, games, group utilities).
- Dynamic command registration and easy extensibility.
-
Database Session Management:
- Utilizes
SQLite3for fast, lightweight storage of user sessions.
- Utilizes
-
Environment-Driven Configuration:
- Easily configurable via
.envfiles for dynamic runtime settings.
- Easily configurable via
-
Games and Trivia:
- Built-in mini-games like trivia, quizzes, and more.
-
Custom Anti-Spam Features:
- Rate limits (max messages per second / minute).
- Ban users exceeding limits (duration customizable).
-
Advanced Bot Customization
- Timezone-aware settings.
- Dynamic sticker production (custom sticker name/author).
To use this bot effectively, make sure you meet the requirements below:
- Golang Version: 1.21 or later
- Database: SQLite version 3
- Other Utilities:
- A valid
.envconfiguration file (see setup section).
- A valid
git clone https://github.com/siputzx/sptzxgo.git
cd sptzxgoRun the following command to install dependencies:
go mod tidy-
Copy the example
.envfile:cp .env.example .env
-
Open
.envand customize the following fields:
| Variable | Description | Required |
|---|---|---|
BOT_OWNERS |
Comma-separated WhatsApp owners' numbers | Yes |
BOT_PREFIX |
Define available bot prefixes | No |
SESSION_DB |
Path to your SQLite database | No |
LOGIN_METHOD |
Either qr or paircode |
No |
PAIRING_PHONE |
Phone number for pairing | Necessary if paircode |
Save the file after configuration changes.
Once everything is set up, execute:
go run main.gosptzxgo/
├── main.go (application entry point)
├── .env.example (runtime system environment definitions)
├── src/
│ ├── commands (modular commands: AI, games, groups, etc.)
│ ├── core (central bot systems, e.g. context storage)
│ ├── handler (managing message + status events)
│ ├── middleware (anti-spam)
│ ├── serialize (helpers for WhatsApp message objects)
│ └── config (environment + runtime loader)
This project is licensed under the Apache 2.0 License. See the LICENSE file for full details.
Contributions, issues, and feature requests are welcome! Feel free to fork this repository and submit your improvements as pull requests.