michelle-go is a modular WhatsApp bot written in Go and powered by whatsmeow. The project is designed around an event-driven architecture, category-based command modules, and a growing internal framework for normalization, dispatching, and policy enforcement.
whatsmeow-based WhatsApp Web integration- Modular command registry with category-driven organization
- Interactive login flow for QR or pairing code
- SQLite-backed session and runtime persistence
- Per-user economy: daily limit, extra limit, balance, premium, XP
- Category-based quota enforcement for AI, downloader, tools, maker, sticker, primbon, random, and stalk commands
- Game system with clue progression, surrender flow, and reward balancing
- Event normalization, dispatching, edit tracking, anti-delete, and poll state tracking
- Group-level feature toggles such as welcome, goodbye, anti-spam, and anti-delete
- Go 1.21+
- SQLite 3
- A valid
.envfile
git clone https://github.com/MichelleBot/michelle-go.git
cd michelle-go
go mod tidy
cp .env.example .env
go run main.goThe bot is configured through environment variables.
| Variable | Description | Required |
|---|---|---|
BOT_OWNERS |
Comma-separated owner phone numbers without spaces | Yes |
BOT_PREFIX |
Comma-separated command prefixes | No |
SESSION_DB |
SQLite DSN for WhatsApp session and runtime storage | No |
LOGIN_METHOD |
qr or paircode |
No |
PAIRING_PHONE |
Pairing phone number when using pairing mode | No |
LOG_LEVEL |
Bot log level | No |
TIMEZONE |
Runtime timezone used by utility features | No |
STICKER_PACK_NAME |
Sticker pack name metadata | No |
STICKER_AUTHOR |
Sticker author metadata | No |
ANTISPAM_MAX_PER_SECOND |
Anti-spam threshold per second | No |
ANTISPAM_MAX_PER_MINUTE |
Anti-spam threshold per minute | No |
ANTISPAM_BAN_DURATION_SECS |
Temporary anti-spam ban duration | No |
MICHELLEBOT_ENABLED |
Enable external API-backed features | No |
MICHELLEBOT_BASE_URL |
Base URL for the MichelleBot API | No |
GEMINI_COOKIE |
Cookie used by Gemini-related functionality | No |
When there is no stored session, the bot starts an interactive CLI login setup.
QRmode displays the login QR directly in the terminal.Pairing Codemode prompts for an international phone number and validates the format.
If a valid WhatsApp session already exists in the session database, the bot reconnects automatically without asking for login again.
src/config— environment loading and validationsrc/core— command system, context, event normalization, stores, and shared runtime primitivessrc/handler— event intake, dispatching, message processing, revoke/edit/reaction/poll handlerssrc/middleware— anti-spam and command limiter middlewaresrc/serialize— WhatsApp message building, media sending, downloads, and protocol helperssrc/commands— modular feature packages grouped by category
whatsmeow event -> normalizer -> dispatcher -> specialized handler
The bot now separates event intake from event processing so that message, reaction, edit, revoke, poll, presence, receipt, and call handling can evolve independently.
- Free users receive
100daily limit. - Premium users receive
500daily limit. - Daily limit resets at
00:00 UTC.
Purchased or owner-added limit is stored separately as extra limit and is not removed by the daily reset.
The bot supports two different policies per command:
Quota— consumes user limit when the command is usedLimit— rate-limits repeated usage inside a time window
Example:
core.Use(&core.Command{
Name: "menu",
Category: "general",
Quota: core.PerUserQuota(1),
Limit: core.PerUserLimit(30, time.Minute),
Handler: func(ptz *core.Ptz) error { ... },
})mylimit— view total limit, daily limit, extra limit, balance, and premium statusbalance— view balance, XP, and owner top-up contactbuylimit <amount>— buy extra limit using balanceleaderboard— top XP and top balance users with masked numbersaddlimit,addsaldo,addprem— owner commands for managing user economy
Group-level toggles are available through .enable and .disable, including:
- welcome
- goodbye
- antidelete
- announce
- locked
- approval
- restrict
- ephemeral
The bot keeps an in-memory message snapshot store for supported message types. When anti-delete is enabled in a group, the bot can restore or resend deleted content for:
- text
- image
- video
- audio / voice note
- document
- sticker
- location / live location
- contact
- general
- group
- downloader
- sticker
- maker
- tools
- primbon
- random
- stalk
- ai
- games
- owner
- search
- info
michelle-go/
├── main.go
├── README.md
├── .env.example
├── go.mod
└── src/
├── api/
├── commands/
├── config/
├── core/
├── handler/
├── middleware/
├── serialize/
└── utils/
- Run
go test ./...to validate the full module. - Run
go build ./...to ensure the project still compiles. - Keep command behavior category-consistent when applying quota or economy rules.
- Prefer extending the normalized event layer before adding new event-driven features.
This project is licensed under the Apache 2.0 License. See LICENSE for details.