WhatsApp Send Message
Send WhatsApp messages using Green API - to groups or individual participants.
Prerequisites
- •Green API account at green-api.com
- •Instance created and authorized (QR code scanned)
- •Credentials configured in
.envfile
Setup
1. Install Dependencies
bash
cd /home/user/architect-workshops/.claude/skills/whatsapp-send-message/scripts npm install
2. Configure Credentials
Copy .env.example to .env and fill in your credentials:
bash
cp .env.example .env
Edit .env:
code
GREEN_API_INSTANCE_ID=your_instance_id GREEN_API_TOKEN=your_api_token
Get these from green-api.com console.
Usage
Send to Group
bash
cd /home/user/architect-workshops/.claude/skills/whatsapp-send-message/scripts npx ts-node send_message.ts --group "GROUP_ID" --message "Your message here"
Send to Individual
bash
npx ts-node send_message.ts --phone "972501234567" --message "Your message here"
Send File (Image/Video/Audio/Document)
bash
npx ts-node send_message.ts --phone "972501234567" --file "/path/to/image.jpg" --caption "Check this out!" npx ts-node send_message.ts --group "GROUP_ID" --file "/path/to/video.mp4" --caption "Workshop recording"
Send to All Group Participants (DM each)
bash
npx ts-node send_message.ts --group "GROUP_ID" --dm-all --message "Your message here"
Options
| Option | Description |
|---|---|
--group <ID> | Group ID (format: 120363xxx@g.us) |
--phone <NUMBER> | Phone number (international format, no +) |
--message <TEXT> | Message text to send |
--file <PATH> | Path to file (image/video/audio/document) |
--caption <TEXT> | Caption for the file (optional) |
--dm-all | Send DM to each participant instead of group |
--dry-run | Preview without sending |
Examples
Send Thank You to Workshop Group
bash
npx ts-node send_message.ts \ --group "120363044291817037@g.us" \ --message "תודה רבה על ההשתתפות בסדנה! 🎉 המצגת והקוד זמינים בלינק: [URL]"
Send Materials to Each Participant
bash
npx ts-node send_message.ts \ --group "120363044291817037@g.us" \ --dm-all \ --message "היי! תודה שהשתתפת בסדנה. הנה החומרים: [URL]"
Send Poster to Group
bash
npx ts-node send_message.ts \ --group "120363044291817037@g.us" \ --file "/path/to/poster.jpg" \ --caption "🎉 הסדנה מתחילה עכשיו!"
Preview Before Sending
bash
npx ts-node send_message.ts \ --group "120363044291817037@g.us" \ --message "Test message" \ --dry-run
Workflow
Post-Workshop Follow-up
- •Get the Group ID from workshop.md
- •Compose thank you message with:
- •Thanks for attending
- •Link to materials/recording
- •Next workshop teaser
- •Send to group or DM each participant
Example Message Templates
Thank You (Group):
code
🎉 תודה על ההשתתפות בסדנה! 📚 חומרי הסדנה: [URL] 🎥 הקלטה: [URL] נתראה בסדנה הבאה! 💪
Follow-up (DM):
code
היי [NAME], תודה שהשתתפת בסדנה "[TOPIC]"! יש לך שאלות? אשמח לעזור. הנה הלינק לחומרים: [URL] אביץ
Integration with Workshop Updates
When user says "send follow-up for workshop X":
- •Read workshop.md to get Group ID
- •Ask user for message content (or use template)
- •Confirm with
--dry-runfirst - •Send the message
- •Update workshop.md to mark "Follow-up sent" as done
Defaults
| Contact | Phone Number | Notes |
|---|---|---|
| Aviz (me) | 972503973736 | Default for testing or "send to me" |
When user says "send to me" or "send to aviz", use: --phone 972503973736
Notes
- •Phone must be connected to internet
- •Phone format: international without + (e.g.,
972501234567) - •Group format:
XXXXXXXXXX@g.us - •Max message length: 20,000 characters
- •Supported file types: images (jpg, png, gif), videos (mp4, mov), audio (mp3, ogg, wav), documents (pdf, doc, xls)
- •Max file size: 100MB for media, 16MB for documents
- •Be mindful of rate limits when DMing many participants
- •Always preview with
--dry-runbefore bulk sending