home / skills / aviz85 / claude-skills-library / whatsapp

This skill helps you send WhatsApp messages, voice notes, and images via Green API, and retrieve group members for streamlined automation workflows.

npx playbooks add skill aviz85/claude-skills-library --skill whatsapp

Review the files below or copy the command above to add this skill to your agents.

Files (9)
skill.md
2.0 KB
---
name: whatsapp
description: "WhatsApp automation using Green API. Send messages, voice notes, images, and get group members."
version: "1.0.0"
author: aviz85
tags:
  - whatsapp
  - messaging
  - automation
enhancedBy:
  - get-contact: "Auto-lookup contact by name. Without it: ask user for phone directly"
  - speech-generator: "Generate voice audio with TTS. Without it: send existing audio files only"
setup: "./SETUP.md"
setup_complete: false
---

# WhatsApp Automation (Green API)

> **First time?** If `setup_complete: false` above, run `./SETUP.md` first, then set `setup_complete: true`.

Send messages and get group information via WhatsApp.

## Workflow

1. **Get contact** - Use `get-contact` skill or ask user for phone
2. **Send message** - Text, voice, image, or file
3. **Confirm delivery** - Check response for success

## Scripts

All scripts in `scripts/` folder:

| Script | Use |
|--------|-----|
| `send-message.ts` | Text messages |
| `send-voice.ts` | Voice notes (converts to OGG) |
| `send-image.ts` | Images with captions |
| `get-group-members.ts` | Extract group phone numbers |

## Quick Examples

```bash
cd scripts/

# Text message
npx ts-node send-message.ts --phone "972501234567" --message "Hello!"

# Voice note
npx ts-node send-voice.ts --phone "972501234567" --audio "/path/audio.mp3"

# Image with caption
npx ts-node send-image.ts --phone "972501234567" --image "/path/image.jpg" --caption "Check this!"

# Preview without sending
npx ts-node send-message.ts --phone "972501234567" --message "Test" --dry-run
```

## Phone Formats

| Input | Normalized |
|-------|------------|
| `0501234567` | `[email protected]` |
| `+972501234567` | `[email protected]` |
| `972501234567` | `[email protected]` |

## Default Numbers

Configure your test number in skill for quick access:

| Alias | Number |
|-------|--------|
| **myself / me / test** | `YOUR_PHONE_NUMBER` |

## Notes

- Use `--dry-run` to preview before bulk operations
- Voice notes require `ffmpeg` installed
- Rate limits apply when sending many messages

Overview

This skill automates WhatsApp messaging using the Green API to send text, voice notes, images, and to retrieve group member lists. It provides ready-to-run TypeScript scripts for common tasks and simple phone normalization and dry-run options for safe testing. It is focused on practical automation for notifications, media delivery, and group data extraction.

How this skill works

The skill exposes scripts that call Green API endpoints to send messages and media or to query group members. Phone inputs are normalized to the required WhatsApp format, audio files are converted to OGG for voice notes, and responses include delivery/status checks so you can confirm success. A dry-run mode lets you preview payloads without sending live messages.

When to use it

  • Send automated text notifications or reminders to individual contacts.
  • Deliver images with captions or voice notes as part of workflows.
  • Extract phone numbers from WhatsApp groups for list management.
  • Preview messages before bulk runs using dry-run to avoid mistakes.
  • Integrate into TypeScript-based automation pipelines or CI scripts.

Best practices

  • Normalize and validate phone numbers before sending to avoid rejected requests.
  • Use --dry-run when testing new message templates or large batches.
  • Install ffmpeg if you plan to send voice notes to ensure proper conversion to OGG.
  • Respect rate limits and throttle bulk sends to avoid API errors or temporary blocks.
  • Keep your test number configured (alias: myself/me/test) to quickly validate flows without affecting real users.

Example use cases

  • Send appointment reminders to customers via send-message.ts in a scheduled job.
  • Convert meeting recordings to OGG and send as voice notes with send-voice.ts.
  • Share product images and announcements with captions using send-image.ts.
  • Collect group participant numbers with get-group-members.ts for community engagement lists.
  • Run a dry-run of a campaign to validate personalization and templates before live delivery.

FAQ

Do I need any external tools to send voice notes?

Yes — ffmpeg is required to convert audio files to the OGG format used by WhatsApp voice notes.

How should I format phone numbers?

You can input local or international formats (e.g., 0501234567 or +972501234567); the scripts normalize them to the WhatsApp ID format like [email protected].