Coder Social home page Coder Social logo

bigdateros-whatsappbot-langchain's Introduction

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

1. obtener media_id desde whatsapp
   en body, seleccionar "form-data" e ingresar key: messaging_product   y Value: whatsapp
   adicional agregar key: file  y marcarlo como archivo

2. simular mensaje pdf
   en body seleccionar "raw" y marcar tipo JSON
{
  "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": "WHATSAPP_ID"
                }],
              "messages": [{
                  "from": "ingresa tu numero",
                  "id": "wamid.ID0",
                  "timestamp": "1689257642",
                  "type": "document",
                  "document": {
                    "filename": "HarryPotter_la_piedra_filosofal.pdf",
                    "mime_type": "application/pdf",
                    "sha256": "IMAGE_HASH",
                    "id": " ingresa id del archivo"
                  }
                }]
          },
          "field": "messages"
        }]
    }]
}


3. simular mensaje texto
   en body seleccionar "raw" y marcar tipo JSON
{
  "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": "ingresa tu numero",
                  "id": "wamid.ID7",
                  "timestamp": "1689257642",
                  "text": {
                    "body": "asd?"
                  },
                  "type": "text"
                }]
          },
          "field": "messages"
        }]
  }]
}

bigdateros-whatsappbot-langchain's People

Contributors

jpierr3 avatar

Stargazers

 avatar varelaseb avatar  avatar Jean Pierre avatar chat_bot avatar Juan Muñoz avatar Arenaweb avatar Rodrigo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.