AgentSkillsCN

whatsapp

通过 Green API 实现 WhatsApp 自动化。支持发送消息、语音笔记、图片,并轻松管理群组成员。

SKILL.md
--- frontmatter
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:

ScriptUse
send-message.tsText messages
send-voice.tsVoice notes (converts to OGG)
send-image.tsImages with captions
get-group-members.tsExtract 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

InputNormalized
0501234567972501234567@c.us
+972501234567972501234567@c.us
972501234567972501234567@c.us

Default Numbers

Configure your test number in skill for quick access:

AliasNumber
myself / me / testYOUR_PHONE_NUMBER

Notes

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