Giter Club home page Giter Club logo

bot's Introduction

Whatsapp Bot con Python

Descarga el proyecto

git clone https://github.com/lorenzobarrantes/Bot.git

Solicitar el archivo .env para el correcto funcionamiento

Funcionalidades

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

Para probarlo localmente

  1. Dirigete al directorio donde descargaste el proyecto
  cd chatbotwms
  1. Crea un ambiente virtual con al menos la version de python 3.10

Requiere pip y virtualenv

pip install pip
pip install virtualenv

Crear carpeta .venv (si no esta en la clonacion)

  virtualenv .venv
  1. Activa el ambiente virtual

Linux/Mac

  source .venv/bin/activate

Windows

   .\.venv\Scripts\activate 
  1. Instala las dependencias
  pip install -r requirements.txt
  1. Corre la aplicacion
  python app.py
  1. Checkear que este levantada http://127.0.0.1:5000/bienvenido

Simular mensajes del usuario con postman

Ingresar la URL
http://127.0.0.1:5000/webhook
Hacer un POST

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"
        }]
  }]
}

video: https://www.youtube.com/watch?v=puYWiZDJnL0&ab_channel=bigdateros

bot's People

Contributors

lorenzobarrantes avatar jpierr3 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.