WA Mod Bot

Documentation & online configuration generator

Overview

A WhatsApp moderation bot built with Baileys. It detects profanity, warns users, and provides admin tools for group management.

git clone https://github.com/martinsuii/wa-bot.git
cd wa-bot
npm install
npm start

On first run, scan the QR code in your terminal via WhatsApp → Linked Devices → Link a Device. Credentials are saved to ./auth/ and reused on subsequent starts.

Core Features

Profanity detection20+ languages, leet-speak normalization, suffix/prefix evasion handling
Warning systemTracked per user, auto-punishes after reaching the limit
Anti-spam5 messages in 5 seconds triggers auto-mute
Ban enforcementAuto-kicks banned users if re-added, rejects join requests
Multi-language8 languages, per-group setting
Custom badwordsGroup-specific word lists
Welcome & goodbyeConfigurable messages for joining/leaving members
PersistenceAll data survives restarts via JSON files in ./data/
Config sharingExport/import group settings as a portable code

How It Works

  1. The bot connects to WhatsApp Web via Baileys
  2. It listens for messages in all groups it's a member of
  3. With admin privileges, it scans messages for profanity
  4. Offending messages are deleted and the sender receives a DM warning
  5. Admin commands (? prefix) allow moderators to warn, kick, ban, mute, and configure the bot

Requirements

  • Node.js 18+
  • A WhatsApp account (used as the bot's number)

Commands

Public Commands

These work for anyone, in both groups and DMs.

CommandDescription
!pingBot responds with "Pong!"
!statusShows connection status and uptime
!coinflipFlip a coin (heads/tails)
!helpShows public command list

Admin Commands

These require the bot to have admin privileges in the group. They use the ? prefix and require @mentioning the target user.

CommandDescription
?warn @user [reason]Warn user via DM, increments warning count
?warnings @userShow warning history for the user
?kick @userRemove user from the group
?ban @userBan user (auto-reject rejoin)
?unban @userRemove ban, allowing rejoin
?mute @user <time> [s|m|d]Auto-delete user's messages for duration
?unmute @userRemove mute
?addword <word>Add a group-specific banned word
?removeword <word>Remove a group-specific banned word
?purge <n>Delete the last n messages tracked by the bot
?ignore @userIgnore a user (skip moderation & profanity checks)
?unignore @userStop ignoring a user
?statsShow moderation statistics
?settingsShow current group configuration
?helpShow admin command list with available languages

Configuration Commands

CommandDescription
?set-lang <code>Set bot language for this group
?set-warnlimit <n>Warnings before auto-punish (default: 3)
?set-warnpunish ban|kick|mute [dur]Punishment for reaching warn limit
?set-antispam on|offToggle anti-spam feature
?set-welcome <msg>Set welcome message for new members
?set-goodbye <msg>Set goodbye message for leaving members

Use {user} as a placeholder for the member's name in welcome/goodbye messages.

Export & Import

CommandDescription
?exportGenerate a code with the group's full configuration
?import <code>Apply a configuration code to this group

Generate a code in the Config Maker tab, then send it in any group with ?import.

Auto-Moderation

When the bot detects profanity in a message, it automatically:

  1. Deletes the message
  2. DMs the sender a warning
  3. Records the warning

If a user reaches the warn limit (default 3), they are auto-punished (ban/kick/mute) according to the group's warnPunish setting.

Languages

The bot supports 8 languages. Language is set per-group and persists across restarts.

CodeLanguage
enEnglish (default)
csČeština (Czech)
esEspañol (Spanish)
deDeutsch (German)
frFrançais (French)
ptPortuguês (Portuguese)
ruРусский (Russian)
idBahasa Indonesia

Setting a language

?set-lang cs

All bot messages in that group will use the selected language: profanity warnings, admin command responses, auto-moderation messages, status and help output.

If an unsupported code is used, the bot responds with the list of valid codes. If no language is set, or a translation key is missing, English is used as the fallback.

Config Maker

Import an existing code

Invalid code. Make sure it's a valid base64 config.

Configure your group

Anti-spam

Custom Commands

Commands you define here run a list of steps when triggered. Placeholders: {user} sender number, {args} text after the command, {result} last web fetch result.

Send the ?import <code> command in your group to apply this configuration.

Copied to clipboard