Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

whatsapp-bot-builder

БесплатноБез исполняемых скриптовНе проверен

Builds WhatsApp bots and integrations using the WhatsApp Business API (Cloud API). Use when the user wants to create a WhatsApp bot, send template messages…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

WhatsApp Bot Builder

Overview

Builds WhatsApp bots using the official Cloud API (hosted by Meta). Covers account setup, webhook configuration, sending and receiving messages, template messages for outbound campaigns, interactive components (buttons, lists), media handling, pricing and messaging limits, and production deployment. Does NOT use unofficial libraries — only the official WhatsApp Business Platform.

The examples use Graph API v24.0, the newest version in the Cloud API changelog as of this update. Pin the version in one constant so it is easy to bump.

Instructions

1. Account Setup

  1. Create a Meta Business account at https://business.facebook.com
  2. Go to https://developers.facebook.com → Create App → Business type
  3. Add the "WhatsApp" product to the app
  4. In WhatsApp > API Setup:
    • Note the Phone Number ID and WhatsApp Business Account ID
    • Use the temporary token shown there only for testing; for production create a System User token in Business Settings
  5. Add a test recipient number, or register and verify your business number

Required credentials:

WHATSAPP_TOKEN=EAAxxxxxxx          # System User access token (production)
WHATSAPP_PHONE_ID=123456789        # Phone Number ID
WHATSAPP_BUSINESS_ID=987654321     # WhatsApp Business Account ID
WHATSAPP_VERIFY_TOKEN=my_secret    # Webhook verification token (you choose this)
WHATSAPP_APP_SECRET=abc123         # App secret, used to verify X-Hub-Signature-256

2. Webhook Setup

WhatsApp posts incoming messages and delivery statuses to your HTTPS endpoint:

const express = require('express');
const crypto = require('crypto');
const app = express();

// Keep the raw body: the signature is computed over the exact bytes Meta sent
app.use(express.json({
  verify: (req, _res, buf) => { req.rawBody = buf; },
}));

// Verification handshake (GET)
app.get('/webhook', (req, res) => {
  if (req.query['hub.mode'] === 'subscribe' &&
      req.query['hub.verify_token'] === process.env.WHATSAPP_VERIFY_TOKEN) {
    res.status(200).send(req.query['hub.challenge']);
  } else {
    res.sendStatus(403);
  }
});

// Incoming messages and statuses (POST)
app.post('/webhook', (req, res) => {
  const expected = 'sha256=' + crypto
    .createHmac('sha256', process.env.WHATSAPP_APP_SECRET)
    .update(req.rawBody).digest('hex');
  const given = req.get('X-Hub-Signature-256') || '';
  if (given.length !== expected.length ||
      !crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected))) {
    return res.sendStatus(401);
  }

  // Acknowledge first, then process; any non-200 makes Meta retry
  res.sendStatus(200);
  for (const change of req.body.entry?.[0]?.changes ?? []) {
    const value = change.value;
    for (const message of value.messages ?? []) {
      handleMessage(message, value.metadata.phone_number_id).catch(console.error);
    }
    for (const status of value.statuses ?? []) {
      handleStatus(status).catch(console.error);
    }
  }
});

Register the callback URL and verify token in the app dashboard under WhatsApp → Configuration. Subscribe to the messages field: delivery and read receipts arrive in the same field as a statuses array, not as separate subscriptions.

Webhook behavior to design for:

  • A POST that does not get HTTP 200 is retried immediately and then with decreasing frequency for up to 7 days; after that it is dropped.
  • Deduplicate on the message id and status id, because retries can redeliver a payload.
  • A batch can contain up to 1000 updates; handle every entry in it.

3. Sending Messages

Every send goes to POST https://graph.facebook.com/v24.0/{PHONE_ID}/messages:

Text message (only inside the 24-hour customer service window):

const GRAPH = 'https://graph.facebook.com/v24.0';

async function sendMessage(payload) {
  const res = await fetch(`${GRAPH}/${process.env.WHATSAPP_PHONE_ID}/messages`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.WHATSAPP_TOKEN}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ messaging_product: 'whatsapp', ...payload }),
  });
  if (!res.ok) throw new Error(`WhatsApp send failed ${res.status}: ${await res.text()}`);
  return res.json();
}

await sendMessage({ to: '14155552671', type: 'text', text: { body: 'Your order shipped.' } });

Interactive reply buttons (max 3; button title max 20 characters; body max 1024 characters):

await sendMessage({
  to: '14155552671',
  type: 'interactive',
  interactive: {
    type: 'button',
    body: { text: 'How can I help you?' },
    action: {
      buttons: [
        { type: 'reply', reply: { id: 'support', title: 'Support' } },
        { type: 'reply', reply: { id: 'sales', title: 'Sales' } },
        { type: 'reply', reply: { id: 'info', title: 'Store info' } },
      ],
    },
  },
});

**Interactive list (max 10 rows in total across all sections; button text max 20 char

Полный SKILL.md на GitHub

Установить whatsapp-bot-builder в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл whatsapp-bot-builder?

Builds WhatsApp bots and integrations using the WhatsApp Business API (Cloud API). Use when the user wants to create a WhatsApp bot, send template messages, handle incoming messages, build interactive lists and buttons, process media, or automate customer communication via WhatsApp. Trigger words: whatsapp bot, whatsapp business api, whatsapp integration, whatsapp cloud api, whatsapp template, whatsapp webhook, whatsapp automation, whatsapp chatbot, meta business, whatsapp flows.

Как установить скилл whatsapp-bot-builder?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл whatsapp-bot-builder запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить whatsapp-bot-builder с