WhatsApp Bot/Gateway that can be controlled via SQL Database and Web Dashboard in Real-Time, running independently as a Background Service.
1. Database Preparation (MySQL, Oracle, SQL Server)
Before running the Bot, make sure your database structure has been imported. The table parameters (inbox, outbox, sent) are the main core of this program.
Use the provided SQL Dump according to your Database engine:
- Create Tables - MySQL.sql
- Create Tables - Oracle.sql
- Create Tables - SQLServer.sql
2. BOT Credential Configuration
WAGW PRO handles its settings dynamically. You can set the Database Password, Connection Type, and Send Delay directly from the WAGW PRO Dashboard website.
Important: If you input wrong Database Credentials, WAGW PRO will show "Disconnected / Checking" on the Web Screen. Just move to the Config tab, fix your ID/Password, click Save, then Restart the application.
3. How to Run (Choose One)
METHOD 1: Automatic Background Service [Recommended]
Make your bot a pure Windows System Service (Auto-starts silently after computer Reboot).
- Double click Install_to_Windows_Service.bat
- If Windows User Account Control appears, click Yes.
- Once successfully installed, you no longer need the CMD Terminal. (Use Uninstall_Windows_Service.bat if you want to permanently remove it).
METHOD 2: Semi-Background Soft Run
Runs invisibly temporarily (only stays connected as long as the PC isn't shut down).
- Double click START.bat
- The terminal screen will be hidden via PowerShell and the Web Browser will open automatically.
- To turn it off manually at any time, you must routinely click STOP.bat.
4. Link WhatsApp & Web Dashboard
After WAGW PRO is running, open your Chrome/Edge browser and go to:
http://localhost:3000
If the connection is successful, the QR Code will appear clearly on your screen.
Open WhatsApp on your Phone → Linked Devices → Scan just like WhatsApp Web.
5. Sending Messages (Outbox SQL & API)
WAGW PRO natively supports two sending methods: Inserting records into the Database (Outbox Table) OR triggering REST API instructions.
A. Outbox SQL Insert Method
Perfect control via your Backend Server (PHP/Java/Python).
1. Text Message:
INSERT INTO outbox (wa_no, wa_text) VALUES ('628123456789', 'Hello, from SQL!');
2. Send Image with Caption:
Logic: If the wa_media column is filled with a local image path, it's processed as an Image Send. The wa_text becomes the Caption.
INSERT INTO outbox (wa_no, wa_text, wa_media) VALUES ('6281..', 'Product Photo', 'C:\\images\\product.jpg');
3. Send File/Document (PDF, DOCX):
Logic: If the wa_file column is filled, it's processed as a Document File attachment.
INSERT INTO outbox (wa_no, wa_text, wa_file) VALUES ('6281..', 'Here is your attachment', 'C:\\docs\\invoice.pdf');
4. Send Buttons:
INSERT INTO outbox (wa_no, wa_text) VALUES ('6281..', 'TEXTWITHBUTTON! Choose Option|Visit Web|http://web.com');
5. Send Poll (Vote):
INSERT INTO outbox (wa_no, wa_text) VALUES ('6281..', 'POLLVOTE! Your favorite fruit?:Apple:Mango');
B. Send via REST API JSON
You can Hit the localhost API URL with POST method using JSON body.
Full Payload for Media and File:
POST http://localhost:3000/api/send
{
"no": "628123456789",
"text": "Hello, this is an API message!",
"media": "C:\\images\\product1.jpg",
"file": "C:\\docs\\invoice.pdf"
}
*Leave the "media" or "file" keys empty if you only want to send standard Text.
Info: This Send API works by registering the JSON payload as a new row into the `outbox` table queue. WAGW PRO will automatically digest and send it according to the Delay interval system!
6. Incoming Message Integration (Webhook & Inbox)
WAGW PRO will record all incoming chat history (Sender number, Text, Time) directly into the inbox database table. You can inspect it periodically.
In addition to the database database, you can intercept incoming messages *Live* (Real-Time) to your own HTTP Webhook link.
- Input your Webhook URL inside the Config Tab of the Web Dashboard (Example: http://domain.com/webhook.php)
- The WAGW PRO system will perform a POST Request carrying parameters: wa_no, text, and isMedia every time someone sends a WA message.
- Check the webhook.php file provided in this application folder to study its mechanics (includes examples of `Auto Reply`).
7. Executing Bot EXE (Local Environment only)
Besides Webhook, WAGW PRO can directly trigger an external Windows Executable (e.g., a Bot built with VB6 or C#) upon receiving a message.
- Input your .exe Path in the Config Tab (Example: C:\Bot\mybot.exe)
- The system will launch your EXE with a single Shell argument: [Sender]~~[Text]~~0. Example:
C:\Bot\mybot.exe "628123456789~~Hello Server~~0"
VB6 Snippet:
Dim args() As String
args = Split(Command$(), "~~")
8. Running on Cloud VPS (Hosting)
If you want to host WAGW PRO on an online Linux/Windows Virtual Private Server (VPS), the steps are similar, but make sure to open port 3000 on your Server Firewall.
- Run the Bot and open http://YOUR-VPS-IP:3000 globally from your home browser to scan the QR Code.
- If deploying to Linux VPS, run npm install, then use PM2 (pm2 start wabot.js) instead of the BAT files to keep it alive.
Alert: Standard Shared Hosting (like CPANEL without SSH terminal) CANNOT run WAGW PRO. WhatsApp bot nodes require continuous background processes, not just Apache web server.