Configuration Reference (bot.json
)
The entire behavior of WBOT is controlled by the bot.json
file. This document provides a detailed reference for all available configuration options.
Main Structure
The bot.json
file has several top-level keys:
{
"appconfig": { ... },
"bot": [ ... ],
"blocked": [ ... ],
"allowed": [ ... ],
"noMatch": "...",
"smartreply": { ... }
}
appconfig
This object contains application-level settings that control the bot's core behavior.
Key | Type | Description |
---|---|---|
headless |
Boolean | If true , the Chromium browser runs in the background. Set to false for the initial QR scan or for debugging. |
isGroupReply |
Boolean | If true , the bot will respond to messages in group chats. Defaults to false . |
webhook |
String | A global webhook URL. The bot will send a POST request with message data to this URL for every message it receives. Leave empty to disable. |
downloadMedia |
Boolean | If true , the bot automatically saves any incoming media (images, audio, etc.) to the receivedMedia folder. |
replyOnMedia |
Boolean | If true , the bot will attempt to find a matching rule even if the message only contains media with no text caption. |
replyUnreadMsg |
Boolean | If true , the bot will process and reply to any unread messages it finds upon startup. |
CustomInjectionFolder |
String | A relative path to a folder containing custom JavaScript files to be injected into the WhatsApp Web page for advanced customization. |
quoteMessageInReply |
Boolean | If true , the bot's response will be sent as a reply quoting the original message. |
server |
Object | Configuration for the built-in web interface. See Web Interface documentation. |
server
Object
Key | Type | Description |
---|---|---|
port |
Number | The port on which the web server will run. |
username |
String | The username for basic authentication. |
password |
String | The password for basic authentication. |
bot
This is an array of rule objects. The bot iterates through this array to find a match for each incoming message.
Rule Object Properties
Key | Type | Description |
---|---|---|
contains |
Array | An array of strings. If an incoming message includes any of these strings (case-insensitive), this rule is triggered. |
exact |
Array | An array of strings. If an incoming message is an exact match for any of these strings (case-insensitive), this rule is triggered. |
response |
String | The text response to send. Supports Spintax and variables. |
file |
Array | An array of file paths (relative to the executable) to send as attachments. |
afterSeconds |
Number | An optional delay in seconds before sending the reply. |
webhook |
String | A rule-specific webhook URL. This is triggered only when this specific rule is matched. |
responseAsCaption |
Boolean | If true and a file is specified, the response text is sent as the file's caption instead of a separate message. |
Example Rule:
{
"contains": ["github"],
"exact": [],
"response": "Sending an image!",
"file": ["./mediaToBeSent/github.png"],
"responseAsCaption": true
}
Note: For each rule, you should define either
contains
orexact
, but not both for the same rule.
blocked
An array of strings, where each string is a phone number (including country code, without the +
). The bot will not reply to any messages from numbers in this list.
Example:
"blocked": ["1234567890", "44987654321"]
allowed
An array of strings for phone numbers. If this array is not empty, it acts as a whitelist. The bot will only reply to numbers present in this list.
Example:
"allowed": ["1234567890"]
noMatch
A string that is sent as a default reply when no rules in the bot
array are matched. It also supports Spintax.
Example:
"noMatch": "{🤔|🤷♂️|Sorry, I didn't understand that.}"
smartreply
Note: This feature is currently under maintenance.
This object configures suggestion buttons that can appear in the chat interface.
Key | Type | Description |
---|---|---|
suggestions |
Array | An array of strings that will appear as clickable suggestion buttons. |
clicktosend |
Boolean | If true , clicking a suggestion button immediately sends the message. |