Web Interface
WBOT includes a built-in web server that provides a graphical interface to manage your bot's configuration and view incoming messages. This is particularly useful when running the bot on a remote server.
Enabling the Web Interface
To enable the web interface, you must configure the server
object within the appconfig
section of your bot.json
file.
- Open
bot.json
in a text editor. - Add or uncomment the
server
object. - Set a
port
,username
, andpassword
.
{
"appconfig": {
"headless": true,
...
"server": {
"port": 8080,
"username": "admin",
"password": "your_secure_password"
}
},
...
}
port
: The network port the server will listen on.username
&password
: Credentials for Basic HTTP Authentication to protect access.
After saving the changes, restart the WBOT process. The terminal will log a message indicating that the server is running.
Accessing the Interface
Once the bot is running, you can access the interface in your web browser.
- If running locally:
http://localhost:8080
- If running on a server:
http://<your_server_ip>:8080
You will be prompted to enter the username and password you configured in bot.json
.
Features
The web interface is divided into two main sections.
1. Flow Editor (/
)
The main page provides a visual representation of your bot's reply logic.
- Visual Flow: It displays the
On Message
trigger connected to all the rules defined in yourbot.json
. - Add Rule: Click the
+
icon to open a modal where you can add a new rule, including triggers (contains
orexact
), theresponse
text, and file attachments. - Delete Rule: Each rule has a
-
icon that allows you to remove it from the configuration.
Changes made here are saved directly to your bot.json
file and are loaded by the bot automatically.
2. Messages Viewer (/messages
)
This page displays a table of all messages received by the bot for the current day. It is a convenient way to monitor the bot's activity without checking the terminal logs.
The table includes:
- Timestamp: When the message was received.
- Sender: The name of the contact or group.
- Message: The content of the message.
This data is read from the messages.json
file, which logs all incoming messages for the day.