/go/send: send from the Command Line

/go/send drains a WhatsApp send queue stored in MariaDB and dispatches each message through one of several WhatsApp-linked "device" sessions, using mudslide (run through npx). It rotates across devices, enforces a per-device send quota and a 5-minute cooldown between sends from the same device, and retires a device after repeated delivery failures. It's meant to be run on a short, repeating schedule (for example, every minute from cron); each run processes at most 15 messages. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/send

If Node.js (and npx) isn’t installed yet, the first run only installs it and exits; run the command again afterward to actually process the queue.

Options

None. Everything comes from GoAdmio’s configuration and the CRM database:

Input Where it comes from
Queue and device database name /etc/wa, or crm if that file doesn’t exist
Linked device sessions Subfolders of /whatsapp/
Per-device send quota, cooldown timer, failure count The Member table (keyed by phone number) and a failed counter file in each device’s folder
Queued messages The Whatsapp table, filtered to CID=2 (see Known issues)

Examples

# Run it directly
/go/send

# Typical setup: run every minute from cron
* * * * * /go/send >> /var/log/go/send-cron.log 2>&1

# Check a device's quota and last-send time
sudo mariadb -N -e "select Mobile, Send, Max, TimeStamp from crm.Member where Mobile='15551234567'"

Output

Please wait 37 seconds

or, per message attempted:

----------------------------------------
Sender: 15551234567 (3/50)
Sending "Reminder" To 15559876543 (From /whatsapp/15551234567)...

Invalid mobile number 0123
Mobile 15551234567 not have an account

See the full reference at /go/send and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *