Skip to content

Latest commit

 

History

History
95 lines (72 loc) · 1.98 KB

README.md

File metadata and controls

95 lines (72 loc) · 1.98 KB

Whatsapp Bot con Python

Impulsa tu negocio con un bot usando las apis oficiales de whatsapp. pueden ver el video paso a paso en el siguiente enlace: https://youtu.be/puYWiZDJnL0

Descarga el proyecto

git clone https://github.com/JPierr3/bigdateros-whatsappbot-python.git

Funcionalidades

  • Enviar mensaje de texto
  • Enviar menus como botones o listas
  • Enviar stickers
  • Marcar los mensajes como "visto" (doble check azul)
  • Reaccionar con emojis los mensajes del usuario
  • Enviar documentos pdf

Para probarlo localmente

  1. Dirigete al directorio donde descargaste el proyecto
  cd bigdateros-whatsappbot-python
  1. Crea un ambiente virtual con la version de python 3.10
  virtualenv -p 3.10.11 .venv
  1. Activa el ambiente virtual
  source .venv/bin/activate
  1. Instala las dependencias
  pip install -r requirements.txt
  1. Corre el aplicativo
  python app.py

Simular mensajes del usuario con postman

Ingresar la URL
http://127.0.0.1:5000/webhook


en body, seleccionar "raw" y tipo "JSON", no olvidar agregar tu número
{
  "object": "whatsapp_business_account",
  "entry": [{
      "id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
      "changes": [{
          "value": {
              "messaging_product": "whatsapp",
              "metadata": {
                  "display_phone_number": "PHONE_NUMBER",
                  "phone_number_id": "PHONE_NUMBER_ID"
              },
              "contacts": [{
                  "profile": {
                    "name": "NAME"
                  },
                  "wa_id": "PHONE_NUMBER"
                }],
              "messages": [{
                  "from": "agrega tu numero",
                  "id": "wamid.ID",
                  "timestamp": "TIMESTAMP",
                  "text": {
                    "body": "hola"
                  },
                  "type": "text"
                }]
          },
          "field": "messages"
        }]
  }]
}